How to identify which event the Event triggered source listened to?

How to identify which event the Event triggered source listened to?

pinakin_k
Not applicable
33 Views
10 Replies
Message 1 of 11

How to identify which event the Event triggered source listened to?

pinakin_k
Not applicable

[ FlexSim 18.0.3 ]

I have a process flow, where I am using one event triggered source activity to listen to 2 events. My objective is to identify the event that triggered it, so that I can reference it in my further process.

12007-eventtriggeredsource.png

As you can see in the picture, two events are listened to, and both are global table references.

I want to identify, by using labels or any other similar identifier, which event was listened to, so that I can reference it in my further process. I don't want to use 2 event triggered sources.

Thank you!

0 Likes
Accepted solutions (1)
34 Views
10 Replies
Replies (10)
Message 2 of 11

joshua_s
Not applicable
Accepted solution

To reference the Event triggered, you can type token.Event, or token.("insert desired label name") in the Assign Event Object To box. This will assign the object that was fired to a label on the token.

12009-event-trigger-assign.png

Message 3 of 11

pinakin_k
Not applicable

So, if i put token.Event, then how do I reference this in my further process.

I plan on referencing the event in following manner

if(token.firstevent?)
{
return 1;
}
else
{
return 2;
}

So how do I name the token coming from each event?

0 Likes
Message 4 of 11

joshua_s
Not applicable

Try comparing the names, for instance one of your events was named TableEvent:

if(token.Event.name=="TableEvent")
{
return 1;
}
else
{
return 2;
}
0 Likes
Message 5 of 11

pinakin_k
Not applicable

For each event would the label values follow the sequence of the events added in the source? Because if this is the case, I would design my model in that manner.

0 Likes
Message 6 of 11

joshua_s
Not applicable

Each token created will have that label assigned to it from its source and the event that triggered the creation of that token.

0 Likes
Message 7 of 11

pinakin_k
Not applicable

12085-eventtriggeredsource.png

It only has one assign event to Object, So I cannot give the label to each event

0 Likes
Message 8 of 11

joshua_s
Not applicable

Regardless of how many events you listen to in the source activity, the "Assign Event Object" will assign a label with the value of the specific object that was triggered, and once it fires, the token moves on and does not listen to any other events that are triggered at the source.

0 Likes
Message 9 of 11

pinakin_k
Not applicable

@Joshua S ok, but the source should listen to other events even if it listened to the first event. I want to do this because I have 15 event triggered sources, but i want to include all the events under one source, to make it simpler. I use 15 sources, which depict each machine. The sources operate on one simple sub flow. The tokens from each source have same label names but different label values, which get differentiated in the sub flow.

Instead of all this i just want to use one event triggered source to listen to these events. As these events would be working simultaneously.

0 Likes
Message 10 of 11

joshua_s
Not applicable

@Pinakin K Here is a model I put together where there are several sources that filter into a queue. In my process flow the the Event-Triggered Source is then listening to each of those sources waiting for them to create an object. Let the process run a little and then click through the different tokens to see that their label "Event" has a different value for each token referencing the trigger source. listening-to-several-events.fsm

0 Likes
Message 11 of 11

jeff_nordgren
Not applicable

@Pinakin K,

Maybe you didn't understand what @Joshua S said? He said, "Regardless of how many events you listen to in the source activity, the "Assign Event Object" will assign a label with the value of the specific object that was triggered, and once it fires, the token moves on and does not listen to any other events that are triggered at the source."

Maybe that last part about the token "does not listen to any other events" is what is confusing you? The Source continues to listen for events. After an event is triggered, it creates a token with the labels on it and the token leaves the Source. The Source is always listening for any all all events. Does that clear it up?

0 Likes