question

shanice.c avatar image
0 Likes"
shanice.c asked Joerg Vogel answered

Decide activity using double


Hello, in Decide activity, the connector value it returns is integer like this.

1660022115093.png

While I need to double in my Decide activity, I use custom code instead, but all tokens still go to first connector. 1660021995119.png



FlexSim 22.1.0
decide
1660021995119.png (58.8 KiB)
1660022115093.png (48.2 KiB)
5 |100000

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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

HERE!
give a name each connector behind a decide activity!

Switch by case in process flow

5 |100000

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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

'id' is a special property of tokens (as you can tell by the fact that it appears in purple font). It is a unique identification number for the token. The first created token will have an id of 1, the second of 2 and so on.

If you have a label called "id", you have to use different syntax so FlexSim knows that you want to access a label with that name and not get the id number of the token.

token.labels["id"].value

The numbers in your screenshot are probably only used as an example, but seeing how they are each just offset by 0.5 from the connector rank, you could also use

int returnValue = token.labels["id"].value + 0.5;
return returnValue;
5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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