workflow-core icon indicating copy to clipboard operation
workflow-core copied to clipboard

How to execute to next step, and how to query the workflow statues

Open Tim1104 opened this issue 7 years ago • 7 comments

if a workflow has many step. when start the workflow ,then ofter some time. i want to let it go to next step. for example, a task workflow have open, doing, review ,done steps. when opened as start workflow. then how to execute the next step.

Tim1104 avatar Sep 28 '19 03:09 Tim1104

https://workflow-core.readthedocs.io/en/latest/external-events/

danielgerlag avatar Sep 28 '19 20:09 danielgerlag

@danielgerlag Thanks for your reply, but i still have a question. I did use the Events, but how did the process know worked on which instance. I mean when start the workflow and created many instances, i think should use the instance ID to trigger the waiting event, is it right?

Tim1104 avatar Sep 29 '19 01:09 Tim1104

When you publish an event with a particular key, it will trigger any workflows that are waiting for that key... so if you use the workflow instance ID as the key, it will be unique to that workflow.

danielgerlag avatar Sep 29 '19 03:09 danielgerlag

Oooh,Clean. that it means ,I need to store the instance id to my data. then i use the key to trigger the event. can event to do some business logic, just have a cancel condition?

Tim1104 avatar Sep 29 '19 04:09 Tim1104

I think the biggest mistake in the design of this workflow is not taking into account that there are multiple instances of the workflow initiated by the host. Unable to locate workflow instances is the biggest drawback of the system.

shao200 avatar Feb 07 '20 03:02 shao200

@shao200 I'm not sure which library you are using, but workflow core returns a GUID when you start a workflow that you can use to track it... you can also specify your own reference string.

danielgerlag avatar Feb 07 '20 04:02 danielgerlag

Is there a good solution? I also need to solve this problem

oicevar1 avatar Dec 10 '20 07:12 oicevar1