question

SudheerReddy avatar image
0 Likes"
SudheerReddy asked Jordan Johnson commented

Trying to use statistics collector but facing few errors.

I am using statistics collector and trying to capture the events model time and token label at two different places(i.e. at create token activity and Staging activity) as marked in the below image. For Create token I am able to get the results but for staging I am not able to get. Please help me to identify the problem.

In system console I am getting the exception message as shown in below image. What is the meaning of that message.

I am attaching the model for reference.

Thank you

modelfsm.fsm

FlexSim 19.1.2
statistics collector
doubt1.jpg (198.6 KiB)
modelfsm.fsm (243.0 KiB)
· 2
5 |100000

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

SudheerReddy avatar image SudheerReddy commented ·
0 Likes 0 ·
SudheerReddy avatar image SudheerReddy commented ·

@jordan.johnson I have updated the code as you said. And on staging I changed to On Entry in statistics collector. I am not able collect the statistics. I am attaching the model for reference.

22787-modelfsm.fsm

0 Likes 0 ·
22787-modelfsm.fsm (37.8 KiB)

1 Answer

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Jordan Johnson commented

The system console error is a minor UI issue, that has no effect other than causing annoyance. It has been fixed on the 2019 Update 2 version.

Your other issue comes from this line of code in the CreateToken custom code activity:

Token newToken = Token.create(NULL, getactivity("PF", "Staging"), 1);

The last parameter indicates that the token should be released immediately. This means the created token executes the Staging custom code block before the original token assigns the label. If you change the last parameter to a 0, then you can fix your issue.

· 1
5 |100000

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

Jordan Johnson avatar image Jordan Johnson ♦♦ commented ·

It looks like you also need to use a start activity. I forgot to mention that in my original answer.

model-fixed.fsm

0 Likes 0 ·
model-fixed.fsm (35.4 KiB)