question

Jeremy R avatar image
0 Likes"
Jeremy R asked Matthew Gillespie commented

Set label on backorder

I noticed that in the documentation, it is mentioned that you can set labels on List Backorders.

Is there any way to set a particular label on a backorder when pulling from a List? If I retrieve the .backOrders() property of a List I can get a list of all of its backorders and set labels on those, but is there any way to define that I want a particular label to be set on the backorder when I pull from the List?

I haven't been able to figure out how to do this either using the "Pull from List" process activity or the List.pull FlexScript command.

Without a way to set these labels when pulling from the list, I don't really understand how labels on List.Backorders are supposed to be used. Is there at least some way to get a reference to the backorder I just created and set the labels on that backorder? The only way I can possibly see to do that would be to get the full list of backorders and try to match the backorder I just created against the properties I just used to create it.

FlexSim 18.2.3
listlabelflexsim 18.2.3backorder
5 |100000

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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie commented

The easiest way to get a reference to the backorder is through the List.PullResult object you get when you call List.pull() in FlexScript.

List.PullResult result = List("TestList").pull("", 1, 1);
if(result.backOrder)
    result.backOrder.Priority = 200;

This functionality is used by the People module when acquiring resources because the same patient can be requesting multiple resources at the same time with different priorities per request, so rather than putting the Priority label on the patient the label is place on the individual request (backorder). This value is then used in the list's Back Order Queue Strategy:

ORDER BY backOrder.Priority DESC
· 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.

Jeremy R avatar image Jeremy R commented ·

Ah, thanks Matthew. I hadn't fully looked into the List.pull documentation, so I hadn't realised that I could get the backOrder off of List.PullResult. I always just treated the return value of List.pull as the items successfully pulled from the list (or null if none were pulled).

That process should let me set labels on backorders whenever I use the List.pull FlexScript command.

Is there any equivalent approach when using the "Pull from List" process flow activity?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Jeremy R commented ·

Anthony's answer shows how you could use the max wait timer to do this, but otherwise, no, there's no easy way to access the backorder from the Pull from List activity.

0 Likes 0 ·
anthony.johnson avatar image
3 Likes"
anthony.johnson answered anthony.johnson edited

Attached is a model that sets labels on the back order. I use the pull from list's max wait timer to set a label on the back order immediately after performing the pull (without releasing the token from the activity). Then a different process prints all the back order labels to the output console.

That said, in recalling when we designed the List.BackOrder API, I don't remember a specific use case that we discussed that would have required back order labels. It may have been that we just said "this might be a nice feature" without specifically enumerating use cases that require it. In practice, I would suggest just putting labels on the puller, i.e. the token or object that is pulling from the list. Then you can just use the expression puller.LabelName in the pull query or the back order queue strategy. I think this would cover most if not all the use cases that back order labels would otherwise be used for.

BackOrderLabels.fsm


backorderlabels.fsm (29.6 KiB)
5 |100000

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