question

Stan Davis avatar image
0 Likes"
Stan Davis asked Stan Davis commented

How to Reevaluate Resource Activity List Back Orders via Code

Probably a simple answer, but how does one call the reevaluateBackOrders() method on the list behind an object-mode Resource activity via custom code?

I tried this but no joy...

List mylist = Model.find("Tools/ProcessFlow/ProcessFlow/Resource");

mylist.reevaluateBackOrders();


Thanks, Stan

FlexSim 21.2.4
backorder reevaluation
· 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.

Stan Davis avatar image Stan Davis commented ·

Tried this. No errors, but didn't cause the resource to reevaluate the back orders...

Object myobj = Model.find("Tools/ProcessFlow/ProcessFlow/Resource");

List mylist = myobj.attrs.variables.subnodes["list"];

mylist.reevaluateBackOrders();



0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Stan Davis commented

The activity creates copies of the list for each process flow instance. If it is an instanced flow, these will be subnodes of "...>stats/instances" ("..." is the path to the activity object). In case of a general process flow, there is only one instance under "...>stats/globalInstance".

The actual list node can be found under those instance nodes.

1636712665137.png

The following code should then work to reevaluate the back orders:

List resourceList = Model.find("/Tools/ProcessFlow/ProcessFlow/Resource>stats/globalInstance/list");
resourceList.reevaluateBackOrders();

1636712665137.png (15.3 KiB)
· 3
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 Matthew Gillespie ♦♦ commented ·
@Felix Möhlmann @Stan Davis The caveat here is that we don't make any guarantee that this will work in future versions if we make changes to the underlying structure. The only fully supported way to do this currently is to use a process flow List activity and point it at a global list and then call reevaluateBackOrders() on the global list.
0 Likes 0 ·
Stan Davis avatar image Stan Davis Matthew Gillespie ♦♦ commented ·
Understood. Too far committed with the current model to change. Thanks - Stan
0 Likes 0 ·
Stan Davis avatar image Stan Davis commented ·

Felix, That worked. I had built a small test model with a single process flow. The list was still copied under the stats/instances. There is nothing under stats/globalInstance. Thanks again - Stan

0 Likes 0 ·