View Source wfnet_srv (wfnet v0.1.0)

This is tha main workflow engine/controller.

Currently it can only handle one workflow at a time, within a single node.

Summary

Functions

tell the server to load a new workflow from a file
tell the server to load a new workflow
start the current workflow
Starts the server
handle task done
return the current server status.

Types

-type task() :: {task_type(), task_id(), task_succ(), task_data()}.
-type task_data() :: term().
-type task_id() :: integer().
-type task_pred() :: task_id() | [task_id()] | [].
-type task_rec() :: #task_rec{}.
-type task_state() :: inactive | done | waiting | running.
-type task_succ() :: task_id() | [task_id()] | [].
-type task_type() :: wfenter | wftask | wfands | wfandj | wfxors | wfxorj | wfexit.

Functions

-spec load_file(file:name_all()) -> ok | {error, term()}.
tell the server to load a new workflow from a file
-spec load_wf(file:name_all()) -> ok | {error, term()}.
tell the server to load a new workflow
-spec run_wf() -> ok | {error, term()}.
start the current workflow
-spec start_link() ->
              {ok, Pid :: pid()} |
              {error, Error :: {already_started, pid()}} |
              {error, Error :: term()} |
              ignore.
Starts the server
-spec task_done(integer(), term()) -> ok | {error, term()}.
handle task done
-spec wf_info() -> term().
return the current server status.