Skip to content

defining workflow engine

Mahmoud Ben Hassine edited this page Mar 12, 2020 · 2 revisions

The WorkFlowEngine API

The WorkFlowEngine interface represents a workflow engine :

public interface WorkFlowEngine {

    WorkReport run(WorkFlow workFlow, WorkContext workContext);

}

Easy Flows provides an implementation of this interface that you can get using the WorkFlowEngineBuilder :

WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();

You can then execute a WorkFlow by invoking the run method :

WorkFlow workFlow = ... // create work flow
WorkContext workContext = new WorkContext(); // create initial work context (can be used to pass parameters)
WorkReport workReport = workFlowEngine.run(workflow, workContext);

At the end of execution, a WorkReport is returned.

Clone this wiki locally