question

Adam J avatar image
0 Likes"
Adam J asked Joshua S commented

Order to execute messages

If one object recieves two messages from two differents objects for example two queues. In which order it will execute them ? Is there any way (apart from process flow) that will allow to choose which message the object will execute first ?

FlexSim 18.0.8
on message trigger
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

·
Allister Wilson avatar image
1 Like"
Allister Wilson answered Mischa Spelt commented

Assuming both messages are scheduled at the same simulation time, they will be executed in the same order they were created.
The only way to control which message is processed first is to ensure the first one you want processed is created first.

Is there a reason you don't want to use process flow? This sort of ordering problem is generally a non-issue when using it.

· 3
5 |100000

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

Mischa Spelt avatar image Mischa Spelt commented ·

Have you considered using Global Lists? They were made to solve the kind of synchroniztaion problems you used to have to send messages all over for. You can add Global Lists to the Toolbox and use the "Pull From List" and "Push To List" options in the trigger dropdowns without using Process Flow.

1 Like 1 ·
Adam J avatar image Adam J commented ·

Thank you for the answer. That's being said, I have two message based on two conditions so I don't know how to make sure that one of the two executes first unless I define a delay message for each one. As for process flow I avoid for time being working with 'cause I still don't know how to use it properly. I prefer to use triggers.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Adam J commented ·

You cannot decide which received message will be executed first, because the OnMessage trigger has been already fired. You can identify the order in which the messages are received. You set a ascending parameter value into the messages. You set the parameter value into a label at the receiving object, too, which message should be received first. Then you compare the values at receiving of the message. If the parameter value doesn’t match you send the message again with no delay with the parameters of the receiving message.

2 Likes 2 ·

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.