question

Sara R4 avatar image
0 Likes"
Sara R4 asked Connor A commented

Creating Shift Patterns in Process Flow

I have a question regarding creating shift patterns using process flow. I have created a process flow for a sequence of process steps. A source creates tokens (each representing one process run) that proceed through the sequences of activities. This process represents a sequence of events that can occur only 5 days a week during specific shifts. Therefore, I need a way to have tokens stop (or be delayed) during the off-work periods.

To find a way to add this in, I looked on the Forums and found a starting point on a previous thread (attached), where an End of Shift Signal notifies an operator to go home by pushing a token to a list that the operator pulls tasks from. I do not have operators in my model, but was considering leveraging this approach. However, after some further modeling, I determined I would have to include a Decide activity before every process step (there are many) to have the token check a list for the End of Shift task before continuing with processing. Does anyone have a better way to do this that can be handled by adding in fewer activities?

I apologize that I cannot share my model due to confidentially concerns. Please let me know if any clarification is needed.

Thanks!

operator-shift-schedule.fsm

FlexSim 21.0.1
processflowshift pattern
· 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.

Connor A avatar image Connor A commented ·

Hi @Sara R4, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

You could try to use the activites in the "Preemption" category for this.

1636360210234.png

"Save Token Context" saves the current status of the token(s) to a label on it. "Release Token" pulls them from their current activity and moves them to a different activity in the process flow. "Restore Token Context" will move them back to their previous activity (at the point when the context was saved) and they will resume from that point.

This can be used to "pause" tokens, by saving their context, moving them to a holding activity and then moving them back by restoring the context. Be careful though, if any pending events require the token to be in a certain position, you might run into problems when forcefully moving them around. If they are in a "Wait for Event" activity for example and the event happens while the token is paused, it will be stuck after restoring the context because it missed the event.

In the attached example, I use a time table to send a message to the process flow when a break starts/ends. An event-triggered source listens to those and creates a token that pulls the others into the "Token Store". Because the processor is also paused, the tokens can't miss the process finish event in the "Wait for Event" activity.

To save/release/restore tokens you need a reference to them. For this, I use an array label assigned to the process flow itself. When a token enters, it is added to array and later removed again before disappearing in the sink. Due to the variable process times, the tokens might arrive at the end in a different order, so I iterate over the array until the correct entry is found and then remove it.

PauseTokensExample.fsm


5 |100000

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

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.