You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QUESTION: Why if we create & run the instance CreateAndRunInstance simple_task.bpmn
technically the process finished but if after CreateAndRunInstance() finishes then I dump the instance state it is in state ACTIVE when it looks like it should to has COMPLETED state.
// create a new named engine
bpmnEngine := bpmn_engine.New("a name")
// basic example loading a BPMN from file,
//process, err := bpmnEngine.LoadFromFile("simple_task.bpmn")
process, err := bpmnEngine.LoadFromFile("simple_user_task.bpmn")
if err != nil {
panic("file \"simple_task.bpmn\" can't be read.")
}
// register a handler for a service task by defined task type
bpmnEngine.NewTaskHandler().Id("hello-world").Handler(printContextHandler)
bpmnEngine.NewTaskHandler().Assignee("assignee").Handler(userTaskHandler())
// setup some variables
variables := map[string]interface{}{}
variables["foo"] = "bar"
// and execute the process
instance, err := bpmnEngine.CreateAndRunInstance(process.ProcessKey, variables)
if err != nil {
return
}
println("InstanceKey: " + strconv.FormatInt(instance.GetInstanceKey(), 10))
println("State: " + string(instance.GetState()))
The text was updated successfully, but these errors were encountered:
eriknyk
changed the title
QUESTION: Why if we create & run the instance simple_task.bpmn technically the process finished but
QUESTION: Process not in COMPLETED state?
Jun 2, 2023
Hi @eriknyk
Indeed, as @jinjaghost mentioned, is important that the task handler sends the "complete" signal.
Else, a task is considered un-finished == still active.
QUESTION: Why if we create & run the instance
CreateAndRunInstance
simple_task.bpmntechnically the process finished but if after
CreateAndRunInstance()
finishes then I dump the instance state it is in stateACTIVE
when it looks like it should to hasCOMPLETED
state.Output:
The text was updated successfully, but these errors were encountered: