question

Jeremy R avatar image
1 Like"
Jeremy R asked Jeremy R commented

Create a child token using FlexScript

When my token moves through a specific set of activities, I would like to create a copy of it in another activity so that I can click on the copy and see a parent-child link between them.

However, I cannot seem to figure out how to do this in FlexScript. While it's easy to create child tokens using the "Create Tokens" and "Run Sub Flow", I'd like to do this without having to add an activity to my process flow.

FlexSim 18.2.0
flexscriptchild tokens
· 1
5 |100000

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

Sebastian Hemmann avatar image Sebastian Hemmann commented ·

Do I understand you right, that you are not looking for a way to create a token via code like:

createtoken(obj instanceObject, obj/str activity, int start);

//or

Token.create(obj instanceObject, obj/str activity, int start);

but want to give this created token an information if it is a sibling, child or independent token!?

0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
3 Likes"
Jordan Johnson answered Jeremy R commented

In version 2019 (available now in beta), we modified the Token.create() method to allow you to specify a parent token, as well as the label access rules.

In previous versions, it isn't possible through FlexScript. You will need to use an activity. Consider using the Split activity, which seems like it does what you are trying to do.

· 1
5 |100000

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

Jeremy R avatar image Jeremy R commented ·

Unfortunately, for aesthetic reasons I don't want an activity block like a Split in my process flow, and want to do it purely using FlexScript. I think I'll wait for 2019 to be stable and use that instead.

0 Likes 0 ·