question

Anggoro P avatar image
0 Likes"
Anggoro P asked Raja Sekaran commented

Status of matched token and item from list

Hi, I am using tokens to pull items from a list. I want to monitor both the matched token-item and unmatched token-item (later, will be considered as lost sales or failed). I am aware that the failed one can be labelled as 'failed' and released to sink, for example. However, I am interested in having two tables of lists of matched and unmatched token-item. Any idea how to store the data?

And what happens to matched token-item, is it considered as finished token, and then it will be deleted by system or not?

Choose One
pull from list
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Raja Sekaran avatar image
2 Likes"
Raja Sekaran answered Raja Sekaran commented

Hi @Anggoro P ,

You can use custom code activity to write a data to a global table. In the attached model, I have assigned OrderID to each token when they are created. If the pull does not succeed within the given time, the token will move to failed(custom code) activity. In Custom code activity, add a row to the table(Failed) and write the OrderID to the table, in the same way for the tokens that have been pulled from the list. This way you can monitor this.

support.fsm


support.fsm (19.3 KiB)
· 8
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Anggoro P avatar image Anggoro P commented ·

@Raja Sekaran

Thanks for the idea! Do you know how to modify the value of orderID instead of getoutput(activity)+1, in order to label them uniquely if I use schedule source? because if the quantity of (time 1) = 10, then there are 10 times orderID of 1 and the next orderID jumps to 11

Many thanks!

0 Likes 0 ·
Raja Sekaran avatar image Raja Sekaran Anggoro P commented ·

@Anggoro P

Here I have reattached the model with some changes. Is this what you are looking for?

support-updated.fsm

0 Likes 0 ·
support-updated.fsm (20.5 KiB)
Anggoro P avatar image Anggoro P Raja Sekaran commented ·

@Raja Sekaran

Thank you for the reply

Yes, I have also tried by using rowNumber, but still not what I desired.

If I run your new model, the orderID on global table still generates 1,1,1,1,1,1,1 (10x) and 11, 11, 11, (10x), etc. Instead of that, I would like to have normal increment like 1, 2, 3, 4 , 5, etc. Any idea?

0 Likes 0 ·
Show more comments
Anggoro P avatar image Anggoro P commented ·

@Raja Sekaran

I got the problem. I think because I set the orderID directly on schedule source (without separated assign label activity), it created the same orderID for all tokens generated on the same period.

Is it the general rule behind assigning label on the schedule source?

Thank you!

0 Likes 0 ·
Raja Sekaran avatar image Raja Sekaran Anggoro P commented ·

@Anggoro P

Yes, it will assign the same value (OrderID) for all the tokens generated on the same period, because you adding labels to the token when they are created. I would suggest not to use getoutput(activity) +1 on schedule source, In this case, it will not work.

0 Likes 0 ·
Anggoro P avatar image Anggoro P Raja Sekaran commented ·

@Raja Sekaran

Thanks a lot! A quick further question: if I want to combine string and int for the orderID by using

"US_" + numtostring(getoutput(activity)+1)

seems doesn't work. Any idea to change it?

0 Likes 0 ·
Show more comments