question

Noah Z avatar image
0 Likes"
Noah Z asked Ben Wilson edited

How do I give priority to partially completed Task Sequences?

I'm trying to figure out the best way to make sure task sequences get ordered correctly in a dispatcher's queue. If an operator is working on a processor and his shift ends(via time table) then he sends back the partially completed task sequence to a dispatcher (which can then send the partially finished task sequence out to another operator who is connected to the dispatcher). The problem I'm running into is when there are already task sequences in queue at the dispatcher I need a way to make sure the partially completed task sequence jumps ahead of any of the "not yet started" task sequences in the dispatcher queue but not ahead of any other partially completed task sequences. I need a way to make the task sequences sort by FIFO within groups (the two groups being unstarted task sequences and partially completed task sequences).

FlexSim 16.0.1
task sequencedispatcher
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

Brenton King avatar image
1 Like"
Brenton King answered Ben Wilson edited

That is the purpose of "Priority" field on all of the task sequence activities and commands. Higher priority tasks are bumped in the line. If tasks have the same priority value they would be selected FIFO. You may be able to get by with just the priority value, however, if you need a more sophisticated method you may need to put the tasks onto a list and have the dispatcher pull work off of that list. This could be done with or without the use of process flow. There are some picklist options for this in the Flow>"Use Transport" field of any object. You would use the "Push to Task Sequence List" option. Then you would select, "Pull from Task Sequence List" in the OnResourceAvailable trigger of the disptacher or task executer. That picklist option allows you to do some cool priority stuff by taking advantage of SQL in the query field.

· 2
5 |100000

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

Noah Z avatar image Noah Z commented ·

Thanks for your comments @Brenton King. It sounds like I need to reassign the priority of the task sequence if the operator working on the process goes off shift during the middle of the process. I'm struggling a bit with how to make this happen.

I've attached a model where there are two processors that need help from an operator. I have the operator alternating between being on shift and off shift every hour. When he is working on a process and his shift ends he sends the semi-completed task sequence back to the dispatcher (through his output port...I need this to happen because in my real model I will have multiple operators connected to the same dispatcher and I want the "in progress" task to be handed off to another operator if possible (i.e. not tied to the operator that just left work)). When he comes back on shift in the next hour he always goes to service the other flowitem in the other processor because that work request got sent to the dispatcher before the partially completed task sequence arrived to the dispatcher. How do I change the ts priority as it is being sent back to the dispatcher from the operator who is going off shift?

0 Likes 0 ·
Brenton King avatar image Brenton King ♦ Noah Z commented ·

You can give the partial completed task sequences a higher priority by placing this code in the "Queue Strategy" field of the dispatcher:

/**Give Partial Completed Tasks Priority*/
treenode tasksequence = param(1);
treenode current = ownerobject(c);
 
int taskHasStarted = gettotalnroftasks(tasksequence) !=getnroftasks(tasksequence);
 
return getpriority(tasksequence) + taskHasStarted * 100;

The queue strategy field is fired whenever the dispatcher receives a tasksequence, even returned task sequences. This code looks at the total number of tasks in the task sequence and sees how many have been completed. If they aren't the same it knows that it is partial completed and sorts it first.

Hope this makes sense. I'm going to close this issue now because we are moving to our new "Answers" format for support. I will try moving this over to that system so that other people can learn from this.

Thanks!

0 Likes 0 ·