FlexScript Exception FlexSim 17.1

FlexScript Exception FlexSim 17.1

kari_payton
Not applicable
305 Views
5 Replies
Message 1 of 6

FlexScript Exception FlexSim 17.1

kari_payton
Not applicable

[ FlexSim 17.1.0 ]

numberofcranesneeded-tur-rev-11.fsm

Hi,

I am getting a new error when I open my model in 17.1. Any idea why?

exception: FlexScript exception: Invalid down cast. Object is not an instance of the target type. 
0 Likes
Accepted solutions (1)
306 Views
5 Replies
Replies (5)
Message 2 of 6

sam_stubbsYXX86
Community Manager
Community Manager

There have been others reporting similar issues. It looks like this could be a bug in 17.1 I'll let the developers know.

0 Likes
Message 3 of 6

Matthew_Gillespie
Autodesk
Autodesk

You can run this model without any errors in 17.0?



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 4 of 6

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

There is a bug in some of the Task Sequence activity headers that wasn't throwing an exception in 17.0, but is now correctly throwing one in 17.1. We're fixing the bug and will add an update script for 17.1.1 so future updates to 17.1 won't show this error. For now, you can run this script in your script console to fix your model:

replacedata_s(model(), "Object executer = param(4); //Or Task Sequence", "treenode executer = param(4); //Or Task Sequence")


Matthew Gillespie
FlexSim Software Developer

Message 5 of 6

kari_payton
Not applicable

Yes. I don't get any error messages in 17.0. @Matthew Gillespie I also get an error on my synchronize points that I wasn't receiving before. "exception: Label property splitID retrieved on token id:664. Label does not exist. At /Tools/ProcessFlow/ProcessFlow/Synchronize"

0 Likes
Message 6 of 6

Matthew_Gillespie
Autodesk
Autodesk

In 17.1 label access was made more strict so that it throws an exception when you try to access a label that isn't there. Synchronize and Join activities have their Partition ID fields set by default to token.splitID. This now throws an exception if the token doesn't have a splitID. For 17.1.1 we've updated that line to be token.splitID? , which is the way you can say get me the value of this label if it exists.

You have a couple options:

1. You could wait until we release 17.1.1 (hopefully tomorrow) and then open the old 17.0 version of your model in 17.1.1 and the update script will update all fields that say token.splitID to token.splitID?

2. Go through and change the partitionID of each activity to token.splitID? or just clear it out with the X button if your don't want to use a partitionID.

3. If you're not even using the splitID field on any of the activities you can run this script to zero out the splitIDs:

treenode pfs = model().subnodes.assert("Tools").subnodes.assert("ProcessFlow");

for(int i = 1; i <= pfs.subnodes.length; i++) {
	treenode pF = pfs.subnodes;
	for(int j = 2; j <= pF.subnodes.length; j++) {
		treenode activity = pF.subnodes;
		if(isclasstype(activity, "ProcessFlow::Join") || isclasstype(activity, "ProcessFlow::Synchronize")) {
			treenode partitionID = getvarnode(activity, "partitionID");
			if(getsdtvalue(partitionID, "stringValue") == "splitID") {
				partitionID.subnodes.clear();
				partitionID.value = 0;
			}
		}
	}
}



Matthew Gillespie
FlexSim Software Developer

0 Likes