Create a child token using FlexScript

Create a child token using FlexScript

jeremy_r
Not applicable
26 Views
3 Replies
Message 1 of 4

Create a child token using FlexScript

jeremy_r
Not applicable

[ FlexSim 18.2.0 ]

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.

Accepted solutions (1)
27 Views
3 Replies
Replies (3)
Message 2 of 4

sebastian_hemmannE3JAU
Collaborator
Collaborator

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
Message 3 of 4

JordanLJohnson
Autodesk
Autodesk
Accepted solution

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.

.


Jordan Johnson
Principal Software Engineer
>

Message 4 of 4

jeremy_r
Not applicable

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