paed01 / bpmn-engine

BPMN 2.0 execution engine. Open source javascript workflow engine.
MIT License
884 stars 167 forks source link

Invoking Task after restore #93

Closed ralphhanna closed 4 years ago

ralphhanna commented 4 years ago

Hi,

I have a requirement to invoke Task signal knowing only the taskId or the executionId but not from inside an event, therefore, I don't have an api?

More specifically, I am providing a persistence layer, so I restore instances of definitions from a state.

User Tasks worked fine, since you kindly raise the 'wait' event on restore, but timer-tasks and event-based-tasks remain in 'enter' mode.

Thanks very much

paed01 commented 4 years ago

Hi,

Is it possible for you to pass me a sample diagram so that I can add a test for your specific purpose? Or, better yet, submit a PR with a feature test with your specific needs, eg this example. The test doesn't necessarily have to pass, but it will be easier to discuss.

You can also explore the broker property on the executing/resumed instance. The broker receives all messages (events) sent by the activities.

Regarding timer, the TimerEventDefinition emits activity.timer event when resumed.

ralphhanna commented 4 years ago

Thanks for the quick response and great work.

yes, activity.timer solved the problem, now the question is how can it access to the eventDefinition from the taskAPI

Thanks in advance

paed01 commented 4 years ago

Is it the actual properties of the eventDefinition you are after? because they should be presented in the event callback (the activity.timer message).

ralphhanna commented 4 years ago

Thanks very much for you excellent and quick response, much appreciated