question

Kari Payton avatar image
0 Likes"
Kari Payton asked Matthew Gillespie edited

FlexScript Exception FlexSim 17.1

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. 
FlexSim 17.1.0
exception
· 4
5 |100000

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

Sam Stubbs avatar image Sam Stubbs ♦ commented ·

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 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

You can run this model without any errors in 17.0?

0 Likes 0 ·
Kari Payton avatar image Kari Payton Matthew Gillespie ♦♦ commented ·

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 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Kari Payton commented ·

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[i];
	for(int j = 2; j <= pF.subnodes.length; j++) {
		treenode activity = pF.subnodes[j];
		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;
			}
		}
	}
}

0 Likes 0 ·

1 Answer

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered

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")
5 |100000

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