Message 1 of 34
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
[ FlexSim 16.1.0 ]
Solved! Go to Solution.
[ FlexSim 16.1.0 ]
Solved! Go to Solution.
Currently you cannot listen to Activity events from objects outside of the Process Flow. However, the Process Flow object has a message trigger that could be listened to. At the point in which you want to trigger an event, add a Custom Code with a Send Message pick option and send it to the Process Flow object (use processFlow in the To field).
Then set up a Back Order Reevaluation Event on your list. Use the Global Event option and listen to the Process Flow's OnMessage.
Hint: Use the sampler for the Event Focus field and sample the Process Flow object in the Toolbox.
Thanks, but I mean a list from the process flow. Is there a way?
The List has a Back Order Reevaluation Event that is Puller based and one that is Value based. These allow you to point to either the puller/value object or to access a label on one of these objects and listen to events on the referenced object.
In the attached example model backorderreevaluationpf.fsm, I've created two really simple situations where the time() is a field on the list call theTime. The Pull From List tries to pull a value where theTime > 3. In example one I have the list listens to the Puller's OnEntering event and release the Puller using a Max Wait Timer. In the second example, a child token was created prior to the Pull From List and the list listens to the child token's OnEntering event. Note that this will cause the Back Orders to be reevaluating EVERY time the puller or child token enters another activity.
Here's how I set up the Back Order Reevaluation Event:
Thanks @Matt Long but it still is not exactly what I need because I need to reevaluate the backorders when the label of a fixed resource (or the fixed resources on a group) changes it's value and that value changes when a token exists a custom code activity. The tokens that pass through that custom code activity are independent of the puller or the value. What I can I do in this case?
I just took a look at the code behind the list and it appears to just be an over site that you can't listen to activity's events from the list back order reevaluation. This will be fixed in the 16.1.1 release in the next couple of weeks.
Since what you're actually trying to listen to is a label value changing on a FR object, you should listen to the label itself. This can be accomplished through the Puller Event or Value Event.
The Assign Labels has an option for Add Tracked Variable. Use this to set a Tracked Variable label on your FR object and be sure to have a reference to that object on your Puller/Value (however you set up your event). You can then listen to the OnChange of that label:
Be sure to use the label() command so you're returning the label node and not the value stored on the label.
@Matt LongTo confirm. I need to replace my normal label with this tracked variable label? or I just need to have both of them?
Also, how can I create a gif similar to the one you send me? Sometimes it is easier to explain something with it.
We use Snagit 13. You record a video of the screen and then in the Snagit Editor (which pops up automatically once you stop recording) allows you to edit the video and then convert it to a gif file.
@Matt Long thanks! I'll try that. I know that maybe this is not the space for it. But could you help me with another question I post yesterday? I don't know if it is easier to explain with a online meeting in order for me to show you the problem...
@Matt Long this creates the tracked variable label or edit it? If it creates it, how I change it's value?
Use the standard getlabel() and setlabel() commands. You won't need to change any of your model beyond creating it. It will behave just like a regular number label with the added bonus of being able to listen to events on it and you can change the way it stores data using the properties in the pick option (for example, if you want to store the history of values and when they changed).
I implement the tracked variable label and I used it on the backorders reevaluation events and I get this error:
time: 20698.326569 exception: Exception caught in adding value-based backorder listeners on list MODEL:/Tools/ProcessFlow/ProcessFlow/OrdenesAlistadasDisponiblesParaEscogerTunelPT1>stats/instances/ProcessFlow/list: Invalid event focus object for list value /Tools/ProcessFlow/ProcessFlow>stats/instances/ProcessFlow/tokens/Vehiculo T3~2. Continuing throw... time: 20698.326569 exception: Exception caught in start() of activity "Pull from lista OrdenesAlistadasDisponiblesParaEscoger" in "ProcessFlow". Continuing throw... time: 20698.326569 exception: Exception caught in evaluation of /Tools/ProcessFlow/ProcessFlow/SeDescargoPallet>stats/instances/ProcessFlow/onEntry
Well it says Invalid event focus object. Verify that getlabel(getlabel(value, "puestoZonaCargue"), "asignado") is valid.
hmm I have the same code on the field and there it works fine. Also how can I checked it?because when I try to use breakpoint on the event focus in order to see what's wrong, it doesn't stops there... can you give me any idea?
If this list is defined in Process Flow you'll need to use the debug() command not a breakpoint. The list you're editing is not the list that is used by the Process Flow. Rather it copies the list into the instance.
Right, apologies, the command should be label(getlabel(value, "puestoZonaCargue"), "asignado") so it returns the node, not the value on the node. I updated the answer.