Assign Labels throwing error

Assign Labels throwing error

sudheer_r
Not applicable
8 Views
3 Replies
Message 1 of 4

Assign Labels throwing error

sudheer_r
Not applicable

[ FlexSim 19.1.2 ]

assignlabels.fsm

23088-doubt1.jpg

As shown in below image I am pulling 3 items from the list and trying to assign label to the token.pulled( token.pulled is array as shown in above image). How to assign a label called Time to the token.pulled in process flow only.

Am attaching my model for your reference.

Thanks

23086-doubt2.jpg

0 Likes
Accepted solutions (1)
9 Views
3 Replies
Replies (3)
Message 2 of 4

regan_blackett
Autodesk
Autodesk
Accepted solution

I tried to run your attached model but it just runs forever without any pullers leaving the Pull activity. It looks like nothing is getting pushed to the list to me. Also the Assign labels activity doesn't look like your images here.

So based on the images, I'm guessing you are trying to add the Time label to all the elements of the 'pulled' array once the puller gets all three boxes?? The errors are probably because you are saying to assign the label to token.pulled; which works fine if you only pulled one thing. By having an array in token.pulled, Assign Labels needs to know which thing like token.pulled[1] or token.pulled[2]. Specifying the array doesn't work.

You would need something like a Subflow that says for each member of the array, create a child token that references a single member of the array, and assign the label to that array member.

Message 3 of 4

sudheer_r
Not applicable

@Regan Blackett

23087-assignlabels.fsm

Above is the updated model. Which I am supposed to upload.

Thanks for the answer.

But running the Subflow is the only option or do we have alternate ways to achieve the same

0 Likes
Message 4 of 4

regan_blackett
Autodesk
Autodesk

I can think of two other ways to do the same thing. If the number of pulled elements never varies, do 3 separate Assign Labels activities in succession, and say their assign-to's are token.pulled[1], token.pulled[2], token.pulled[3]. You could also use a Custom Code activity and write a for() loop like this:

for(int i = 1; i <= token.pulled.length; i++){
	token.pulled.Time = Model.time;
}

The Subflow is the same idea as the for loop but with the logic exposed as activities rather than hidden in code, and both allow for the number of pulled members to be variable.

0 Likes