Triggering wait for event in process flow using sendmessage()

Triggering wait for event in process flow using sendmessage()

rhramac
Enthusiast Enthusiast
298 次查看
12 条回复
1 条消息(共 13 条)

Triggering wait for event in process flow using sendmessage()

rhramac
Enthusiast
Enthusiast

[ FlexSim 21.2.4 ]

Is there a way to trigger wait for event activity in process flow from using sendmessage()?


sendmsg.fsm

0 个赞
已接受的解答 (1)
299 次查看
12 条回复
回复 (12)
2 条消息(共 13 条)

joerg_vogel_HsH
Mentor
Mentor
已接受的解答

I think, it is more likely the on receive message event, that you can evaluate.

0 个赞
3 条消息(共 13 条)

jason_lightfootVL7B4
Autodesk
Autodesk

In you case you can just detect that a token enters/exits the activity: "Custom Code- Send message"

0 个赞
4 条消息(共 13 条)

rhramac
Enthusiast
Enthusiast

Hi Jason, Thanks for your response. I asked this as part of bigger model where I use a customized library in flexsim. I add instruction to travel, and then instruction to send message, so that the message is triggered after travel is completed. So detecting token entry exit to custom code will not help.


1651978624945.png



0 个赞
5 条消息(共 13 条)

rhramac
Enthusiast
Enthusiast
Hi Joerg, can you explain it a bit?
0 个赞
6 条消息(共 13 条)

jason_lightfootVL7B4
Autodesk
Autodesk
The OnMessage event is common on the objects and a wait for event activity, when you sample an object that has the event, will offer OnMessage as the triggering event. This is not the sending of the message but the receiving.
0 个赞
7 条消息(共 13 条)

rhramac
Enthusiast
Enthusiast
So can a wait for event activity listen to itself, if there is a message being passed to it or can it listen to only 3D objects
0 个赞
8 条消息(共 13 条)

jason_lightfootVL7B4
Autodesk
Autodesk

Doesn't look like it from either the dropdown list you get when you sample it, or a simple test.

I think pushing to and pulling from lists are a much better option for synchronization like this - so much more transparent.

0 个赞
9 条消息(共 13 条)

rhramac
Enthusiast
Enthusiast
I was able to send message to queue and use wait for event to listen to it. Since the send message has only double parameter. I send passed an object with all details in the fromObject argument. Thanks to @Logan Gold for walking me through the process.
0 个赞
10 条消息(共 13 条)

jason_lightfootVL7B4
Autodesk
Autodesk

Glad you were able to articulate what you were looking for with Logan. You're still not detecting the message sending event unless it's sent and received in zero time. If it's a delayed message then you'll not be able to detect the sending event

0 个赞
11 条消息(共 13 条)

rhramac
Enthusiast
Enthusiast
In my case I am sending regular sendmessage() and not delayed. Can you please elaborate why it would not work for a delayed message? Curious.
0 个赞
12 条消息(共 13 条)

jason_lightfootVL7B4
Autodesk
Autodesk
You're detecting the receiving of the message, not the sending of it. So if the message is delayed by n seconds you're not going to know when it was sent unless you also pass that as a parameter.
0 个赞
13 条消息(共 13 条)

rhramac
Enthusiast
Enthusiast
Makes sense. Thanks for the explanation.
0 个赞