Mozart.ProcessEngine (Mozart v0.9.4)
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
create_next_tasks(state, next_task_name)
delete_open_task_from_execution_frame(task, state)
execute(ppid)
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.
execute_process(state)
get_completed_tasks(ppid)
get_open_tasks(ppid)
Gets the open tasks of the given process engine. Useful for debugging.
get_process_from_state(state)
get_state(ppid)
Returns the state of the process. Useful for debugging.
get_task_instance(task_uid, state)
process_next_task_list(state, list, parent_name)
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", )