question

Shinya O avatar image
0 Likes"
Shinya O asked Shinya O commented

How to add a custom state to the "Wait for Finish" pulldown menu on Create TS

Hi,

I know how to add a custom state to the StateTable, but I do not know how to add the custom state to the following pulldown menu.

Thanks in advance.

1669267451033.png



FlexSim 22.0.4
statetablecreatetswaitforfinish
1669267451033.png (31.7 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.

1 Answer

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Shinya O commented

The dropdown menu is populated using the "defaultstatelist" subnodes from the Main tree.

1669276116345.png

This happens in the "coldlinkx" of the Create TS properties GUI. This can be found under the View tree.

1669276182776.png

In order to edit either of these to add options to the dropdown menu, you have to enable development mode in your FlexSim copy, as described in the module development manual page. (Add a button with the "savedefaultviewproject" applicationcommand).

With this enable you can for example add a node to the defaultstatelist.

1669276452883.png

1669276469385.png

If you only need that custom state in a couple places in a single project, then I would suggest to just edit the treenode value of the "Create TS" activity that governs which state is used. Just make sure to not touch the dropdown GUI afterwards, so the entered value is not overwritten with the selection made there.

1669276565915.png

Alternatively, you could also create the tasksequence in a Custom Code activity with TaskSequence.create() and enter the correct state value directly as a parameter.

The following code does essentially the same as the Create TS activity with default settings (apart from assigning the task executer to a label and waiting until the tasksequence is actually started.

TaskSequence TS = TaskSequence.create(token.resource, 0, PREEMPT_NOT, STATE_ALLOCATED_IDLE);
token.taskSequence = TS;
TS.dispatch();

1669276116345.png (30.2 KiB)
1669276182776.png (75.1 KiB)
1669276452883.png (2.1 KiB)
1669276469385.png (14.1 KiB)
1669276565915.png (19.6 KiB)
· 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.

Shinya O avatar image Shinya O commented ·
Thank you very much.
0 Likes 0 ·

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.