Mozart.ProcessEngine (Mozart v0.9.1)

A ProcessEngine is dynamically spawned for the purpose of executing a process model defined by defprocess function call.

Summary

Functions

Used to complete any "complete-able" open tasks. Task execution frequently spawns new open tasks. Execute will continue to called recursively as long as there are "complete-able" open tasks.

Gets the open tasks of the given process engine. Useful for debugging.

Returns the state of the process. Useful for debugging.

Use this function to create a ProcessEngine instance initialized with the name of the process model to be executed and any initialization data. The engine will start executing tasks when the execute/1 function is called.

Functions

Link to this function

create_next_tasks(state, next_task_name)

Used to complete any "complete-able" open tasks. Task execution frequently spawns new open tasks. Execute will continue to called recursively as long as there are "complete-able" open tasks.

Link to this function

execute_process(state)

Link to this function

get_completed_tasks(ppid)

Link to this function

get_open_tasks(ppid)

Gets the open tasks of the given process engine. Useful for debugging.

Link to this function

get_process_from_state(state)

Link to this function

get_state(ppid)

Returns the state of the process. Useful for debugging.

Link to this function

get_task_instance(task_uid, state)

Link to this function

process_next_task_list(state, list, parent_name)

Link to this function

start_process(process, data, business_key \\ nil)

Use this function to create a ProcessEngine instance initialized with the name of the process model to be executed and any initialization data. The engine will start executing tasks when the execute/1 function is called.

Arguments are a process model name, initial process data, an optional business_key, and a parent process pid if there is a parent. If a process key is not specified, one will be assigned.

Returns a tuple of the form:

{:ok, ppid, uid, business_key}

where:

  • ppid is the Elixir pid for the spawned GenServer.
  • uid is a uniquie identifier for a process execution.
  • business_key is a unique identifier for a hierarchial process execution.

Sample invocation:

{:ok, ppid, uid, business_key} = ProcessEngine.start_process("a process model name", )
Link to this function

update_completed_task_state(state, task, next_task)

Link to this function

update_for_completed_task(state, task)