Class WorkflowEngineImpl
- java.lang.Object
-
- io.tesler.engine.workflow.services.WorkflowEngineImpl
-
- All Implemented Interfaces:
WorkflowEngine
@Service public class WorkflowEngineImpl extends Object implements WorkflowEngine
-
-
Constructor Summary
Constructors Constructor Description WorkflowEngineImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkRequiredFieldsForTransition(WorkflowTransition transition)
Checks whether the required fields must be filled in to complete the specified transition..void
forceInvokeAutoTransition(WorkflowableTask task, WorkflowTransition transition)
Performing an automatic transition for a given task without checking its capability.TransitionResult
forceInvokeAutoTransitionIgnorePostFunctions(WorkflowTransition transition, WorkflowableTask task)
Performing an automatic transition for a specified task without executing post functions and checking its capability.void
forceInvokeAutoTransitionToHiddenStep(WorkflowableTask task)
Performing an automatic transition for a specified task to a step with the HIDDEN status, if it exists in the transition model.org.springframework.data.jpa.domain.Specification<User>
getAssigneeRecommendationSpecification(WorkflowableTask task)
Returns a specification for searching for recommended performers for a specified task.List<String>
getDisableFields(WorkflowableTask task)
Returns a list of fields that are not editable for a specified task.List<WorkflowTransition>
getTransitions(WorkflowableTask task)
Returns available transitions for the specified task.TransitionResult
invokeAutoTransition(WorkflowableTask task, WorkflowTransition transition)
Performing an automatic transition for the specified task.TransitionResult
invokeTransition(BcDescription bcDescription, WorkflowableTask task, WorkflowTransition transition, List<String> preInvokeParameters)
Performing a user-initiated transition for a specific taskboolean
isChildBcDisabled(BcIdentifier bcIdentifier, WorkflowableTask task)
Checks whether editing of child business components of a specified task is blocked.void
setCustomStep(WorkflowableTask task, WorkflowStep step)
Sets the specified task to the specified step of the corresponding transition model.void
setInitialStep(WorkflowableTask task)
Sets the specified task to the initial step of the corresponding transition model.
-
-
-
Method Detail
-
setInitialStep
public void setInitialStep(WorkflowableTask task)
Description copied from interface:WorkflowEngine
Sets the specified task to the initial step of the corresponding transition model. and typeWorkflowableTask.getTaskType()
of task.- Specified by:
setInitialStep
in interfaceWorkflowEngine
- Parameters:
task
- workflow task
-
setCustomStep
public void setCustomStep(WorkflowableTask task, WorkflowStep step)
Description copied from interface:WorkflowEngine
Sets the specified task to the specified step of the corresponding transition model.- Specified by:
setCustomStep
in interfaceWorkflowEngine
- Parameters:
task
- taskstep
- step of the transition model
-
getTransitions
public List<WorkflowTransition> getTransitions(WorkflowableTask task)
Description copied from interface:WorkflowEngine
Returns available transitions for the specified task.- Specified by:
getTransitions
in interfaceWorkflowEngine
- Parameters:
task
- tasj- Returns:
- list of available transitions
-
invokeTransition
public TransitionResult invokeTransition(BcDescription bcDescription, WorkflowableTask task, WorkflowTransition transition, List<String> preInvokeParameters)
Description copied from interface:WorkflowEngine
Performing a user-initiated transition for a specific task- Specified by:
invokeTransition
in interfaceWorkflowEngine
- Parameters:
bcDescription
- description of the business component of a tasktask
- tasktransition
- transitionpreInvokeParameters
- the user's confirmation of the transition- Returns:
- result of the transition
-
invokeAutoTransition
public TransitionResult invokeAutoTransition(WorkflowableTask task, WorkflowTransition transition)
Description copied from interface:WorkflowEngine
Performing an automatic transition for the specified task.- Specified by:
invokeAutoTransition
in interfaceWorkflowEngine
- Parameters:
task
- tasktransition
- transition- Returns:
- result of the transition
-
forceInvokeAutoTransitionIgnorePostFunctions
public TransitionResult forceInvokeAutoTransitionIgnorePostFunctions(WorkflowTransition transition, WorkflowableTask task)
Description copied from interface:WorkflowEngine
Performing an automatic transition for a specified task without executing post functions and checking its capability.- Specified by:
forceInvokeAutoTransitionIgnorePostFunctions
in interfaceWorkflowEngine
- Parameters:
transition
- transition to be performedtask
- task- Returns:
- result of the transition
-
forceInvokeAutoTransition
public void forceInvokeAutoTransition(WorkflowableTask task, WorkflowTransition transition)
Description copied from interface:WorkflowEngine
Performing an automatic transition for a given task without checking its capability.- Specified by:
forceInvokeAutoTransition
in interfaceWorkflowEngine
- Parameters:
task
- tasktransition
- transition
-
forceInvokeAutoTransitionToHiddenStep
public void forceInvokeAutoTransitionToHiddenStep(WorkflowableTask task)
Description copied from interface:WorkflowEngine
Performing an automatic transition for a specified task to a step with the HIDDEN status, if it exists in the transition model.- Specified by:
forceInvokeAutoTransitionToHiddenStep
in interfaceWorkflowEngine
- Parameters:
task
- task
-
isChildBcDisabled
public boolean isChildBcDisabled(BcIdentifier bcIdentifier, WorkflowableTask task)
Description copied from interface:WorkflowEngine
Checks whether editing of child business components of a specified task is blocked.- Specified by:
isChildBcDisabled
in interfaceWorkflowEngine
- Parameters:
bcIdentifier
- identifier of business component which is mapped to a tasktask
- task- Returns:
- whether editing of child business components is blocked
-
getDisableFields
public List<String> getDisableFields(WorkflowableTask task)
Description copied from interface:WorkflowEngine
Returns a list of fields that are not editable for a specified task.- Specified by:
getDisableFields
in interfaceWorkflowEngine
- Parameters:
task
- task- Returns:
- list of fields that can't be edited
-
getAssigneeRecommendationSpecification
public org.springframework.data.jpa.domain.Specification<User> getAssigneeRecommendationSpecification(WorkflowableTask task)
Description copied from interface:WorkflowEngine
Returns a specification for searching for recommended performers for a specified task.- Specified by:
getAssigneeRecommendationSpecification
in interfaceWorkflowEngine
- Parameters:
task
- task- Returns:
- specification for searching for recommended performers
-
checkRequiredFieldsForTransition
public boolean checkRequiredFieldsForTransition(WorkflowTransition transition)
Description copied from interface:WorkflowEngine
Checks whether the required fields must be filled in to complete the specified transition..- Specified by:
checkRequiredFieldsForTransition
in interfaceWorkflowEngine
- Parameters:
transition
- transition- Returns:
- whether it is necessary to check filling of mandatory fields
-
-