I need to know how many jobs it has in its queue and take a decision based on this
I need to know how many jobs it has in its queue and take a decision based on this
I assume you have a model with classic 3D logic: input and output connections, edges for center ports and so on. Your model hasn’t got a dispatcher to distribute tasksequences (transport jobs). Then you need to get a property on a variable node in the object tree of your Taskexecuter called tasksequencequeue.
please refer to the example of dispatcher subclass of Taskexecuter class api in manual.
The feature of a dispatcher is inherited for every taskexecuter in FlexSim.
obj(dispatcher).taskSequences.length
obj(dispatcher) is in this case a reference to your Taskexecuter.
if my assumptions aren’t applying to your model, then please be so kind and attach your model or better an example model of your matter in your question. Thanks!
thanks for your prompt reply !
I have several ASRS in the model so I stored the reference into "token.traslo". when I write: "int numTaskSequences = token.traslo.taskSequences.length;" it gives this exception: "FlexScript exception: Label property taskSequences retrieved on /ASRSvehicle1. Label does not exist".
I have also tried this one w/o success: "int numTaskSequences = token.traslo.as(Object).taskSequences.length;"
Could this code also achieve the same purpose: "int numTaskSequences = token.traslo.subnodes.length;" ? it does not give exception but so far it gave me always a zero outcome, I don't know if this is for it considers the only task it has, as already completed, or it is a reference to something else. Thank you, your comment is really appreciated !
token.traslo.as(Dispatcher).taskSequences.length
Hi @CHRISTIAN B3,
We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.
If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.
15 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved