Status of matched token and item from list

Status of matched token and item from list

anggoro_p
Not applicable
2 Views
9 Replies
Message 1 of 10

Status of matched token and item from list

anggoro_p
Not applicable

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?

0 Likes
Accepted solutions (1)
3 Views
9 Replies
Replies (9)
Message 2 of 10

raja_sekaran
Not applicable
Accepted solution

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

Message 3 of 10

anggoro_p
Not applicable

@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
Message 4 of 10

raja_sekaran
Not applicable

@Anggoro P

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

support-updated.fsm

0 Likes
Message 5 of 10

anggoro_p
Not applicable

@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
Message 6 of 10

raja_sekaran
Not applicable

@Anggoro P

if you would like to have a normal increment for each token you can use getoutput(activity) + 1, here is the model 9615-support-updated-2.fsm . If you want to have increment for each row (arrival point), here is the model support-new.fsm

0 Likes
Message 7 of 10

anggoro_p
Not applicable

@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
Message 8 of 10

raja_sekaran
Not applicable

@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
Message 9 of 10

anggoro_p
Not applicable

@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
Message 10 of 10

raja_sekaran
Not applicable

@Anggoro P

It works well for me. support-new-1.fsm