Task Sequence losing "drop from list" reference

Task Sequence losing "drop from list" reference

kyle_p1
Not applicable
492 Views
4 Replies
Message 1 of 5

Task Sequence losing "drop from list" reference

kyle_p1
Not applicable

[ FlexSim 22.1.2 ]

I am having problems with a bus routing model. The model is designed to pickup people at various bus stops and drop them off based on a bus route loop. The only way I've been able to get this to work is with Task Sequence Lists. I don't like working with these, but the functionality is great if you can get them to work.

I am getting the following error:

time: 243.000000 exception: FlexScript exception: Invalid down cast. Object is not an instance of the target type. at MODEL:/Bus1>variables/loadtrigger i: MODEL:/Tools/GlobalLists/TSList1/26/onFulfill/1

And have narrowed it down to this variable in a trigger in which I am pulling task sequences:

1657134244918.png


I think the model is losing the reference to the task sequence and then cannot find it when it goes to drop the task sequence. This seems to happen when it grabs a task from the onResourceAvailable trigger and then more tasks are added to the task list before it can unload all of the items it loaded. I'm fine with the error just persisting but it seems to be creating artifacts to where certain tasks in the task list get left on the list and never executed (once per error). I would guess this is the task the bad reference points to when the drop task from list fails.


I have attached the file I'm working with. Let me know if anything needs clarification.


Bus Example.fsm

0 Likes
Accepted solutions (1)
493 Views
4 Replies
Replies (4)
Message 2 of 5

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution

I would change current to be Object and then have a new local variable called te for the TaskExecuter task - but even if you do that you'll still have the problem that param(1) isn't a valid item when the trigger is called in the Callback case. You could put the test for callback case before you assign the item variable.

This is a purely technical answer - I've not looked into how or why you're doing what you are.

Message 3 of 5

kyle_p1
Not applicable
What is the Callback case doing? Seems like it's listening for an event, but I'm not sure what event and why.
0 Likes
Message 4 of 5

jason_lightfoot_adsk
Autodesk
Autodesk

It's the case where the pull is unsuccessful but you leave a backorder on the list. Then when the backorder is fulfilled this trigger is fired again. You no longer have a callback handler in your code so it can't do anything with that anyway. Drop a new task executer in a model and add a PullFrom List option to the Load Trigger and you'll see the differences between your code and the standard trigger option.

Perhaps you could describe the intention behind what you're doing and we can advise you on the approach more generally.


0 Likes
Message 5 of 5

kyle_p1
Not applicable
I got it working by not pushing the ts query to a backorder for the load operation. If there is no item to load then the ts is handled by the onResourceAvailable trigger. Thank you for your help!
0 Likes