Overview question: What's the order of methods that are called in a core object?
Say I want to execute some code at just after a machine receives an entity, but before any internal machine processing has taken place? Similarly, how would I run some code after the machine has completed and just before hand-off to another object?
Is there a quick function rundown or diagram that easily shows what happens (and at what times) within each machine so I know where best to attach custom code to operate on entities passing through the system?
Here's a high level of how I'd see it working:
Your high level diagram is good. I attach a more complex event diagram. It is difficult to make this fully generic, since we may have interruptions or resources that may become unavailable etc. The method for all CoreObjects to edit if you want to do something just after an Entity is received is getEntity. So if you have say a CustomMachine that inherits the from Machine you can do something like:
getEntity(self): activeEntity = Machine.getEntity(self) (do stuff right after the entity is obtained) return activeEntity
note that the method has to return the Entity. Similarly for the end of operation you can extend endOperationActions(). If you want to perform something when the Entity leaves there is removeEntity() that also returns the Entity.
Status changed to closedToggle commit list