Class ParallelFlow
- java.lang.Object
-
- com.redhat.parodos.workflows.workflow.ParallelFlow
-
public class ParallelFlow extends Object
A parallel flow executes a set of work units in parallel. AParallelFlowrequires aExecutorServiceto execute work units in parallel using multiple threads. It is the responsibility of the caller to manage the lifecycle of the executor service. The status of a parallel flow execution is defined as:org.jeasy.flows.work.WorkStatus#COMPLETED: If all work units have successfully completedorg.jeasy.flows.work.WorkStatus#FAILED: If one of the work units has failed
- Author:
- Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParallelFlow.Builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParallelFlowReportexecute(WorkContext workContext)Execute the unit of work and return its report.StringgetName()The name of the unit of work.WorkFlowPropertiesMetadatagetProperties()voidsetProperties(WorkFlowPropertiesMetadata properties)
-
-
-
Method Detail
-
execute
public ParallelFlowReport execute(WorkContext workContext)
Execute the unit of work and return its report. Implementations are required to catch any checked or unchecked exceptions and return aWorkReportinstance with a status ofWorkStatus.FAILEDand a reference to the exception.- Parameters:
workContext- context in which this unit of work is being executed- Returns:
- the execution report
-
getName
public String getName()
Description copied from interface:WorkThe name of the unit of work. The name must be unique within a workflow definition.
-
getProperties
public WorkFlowPropertiesMetadata getProperties()
- Specified by:
getPropertiesin interfaceWorkFlow
-
setProperties
public void setProperties(WorkFlowPropertiesMetadata properties)
- Specified by:
setPropertiesin interfaceWorkFlow
-
-