Package io.tesler.engine.workflow.dao
Class WorkflowDaoImpl
- java.lang.Object
-
- io.tesler.engine.workflow.dao.WorkflowDaoImpl
-
- All Implemented Interfaces:
WorkflowDao
@Service public class WorkflowDaoImpl extends Object implements WorkflowDao
-
-
Constructor Summary
Constructors Constructor Description WorkflowDaoImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createDefaultPostFunctions(WorkflowTransitionConditionGroup transitionConditionGroup)
Creates default post-functions for the specified group of transition conditions.PendingTransition
createPendingTransition(WorkflowTransition transition, User sessionUser, LOV sessionUserRole)
WorkflowTask
createWorkflowTask(WorkflowStep step)
void
deletePostFunction(WorkflowPostFunction postFunction)
Deletes the specified post-function with all child entities.void
deleteTransitionConditionGroup(WorkflowTransitionConditionGroup transitionConditionGroup)
Deletes the specified transition condition group with all child entities.WorkflowTransition
getActiveWorkflowTransitionByName(String name)
Returns a transition from the active version of the transition model by its unique name.List<WorkflowAssigneeRecommendation>
getAssigneeRecommendations(WorkflowStepConditionGroup condGroup)
<C extends WorkflowCondition>
List<C>getConditions(Class<C> conditionClass, WorkflowStepConditionGroup conditionGroup)
<C extends WorkflowCondition>
List<C>getConditions(Class<C> conditionClass, WorkflowStepField stepField)
<C extends WorkflowCondition>
List<C>getConditions(Class<C> conditionClass, WorkflowTaskChildBcAvailability childBcAvailability)
<C extends WorkflowCondition>
List<C>getConditions(Class<C> conditionClass, WorkflowTransitionConditionGroup conditionGroup)
WorkflowStep
getCurrentStep(WorkflowableTask task)
Returns the current step for the specified activity.WorkflowStep
getHiddenStep(WorkflowVersion version)
Returns a step with the HIDDEN status for the specified version of the transition model.WorkflowStep
getInitialStep(LOV taskType)
Returns the initial step for the transition model corresponding to the specified project and task type.WorkflowTransitionHistory
getLastTransitionHistory(WorkflowTask task)
Returns the last transition history record for the specified task.WorkflowTransitionHistory
getLastTransitionHistoryByDestinationStep(WorkflowTask task, WorkflowStep destinationStep)
Returns the last transition history record for the specified task corresponding to the transition at the specified step.WorkflowTransition
getLastWorkflowTransitionByName(String name)
Returns a transition from the latest version of the transition model by its unique name.BigDecimal
getMaxVersion(Workflow workflow)
Returns the maximum version number for the specified transition model.BigDecimal
getNextVersion(Workflow workflow, boolean majorVersion)
Returns the next version number for the specified transition model.<P extends WorkflowPostFunction>
List<P>getPostFunctions(Class<P> postFunctionClass, WorkflowTransitionConditionGroup conditionGroup)
WorkflowStep
getStepByName(WorkflowVersion version, String name)
Returns the step of the specified version of the transition model by its unique name.List<WorkflowStepConditionGroup>
getStepConditionGroups(WorkflowStep step)
List<WorkflowStepField>
getStepFields(WorkflowStep sourceStep)
List<LOV>
getTaskTypesNotInWf()
Returns a list of TASK_TYPE types that do not have transition models created in the specified project.WorkflowTransition
getTransition(LOV taskType, LOV sourceStepTaskStatus, LOV destinationStepTaskStatus)
Returns the transition of the active transition model corresponding to the specified task type between steps with the specified statuses.WorkflowTransition
getTransition(Long transitionId)
WorkflowTransition
getTransitionBetweenSteps(WorkflowStep sourceStep, WorkflowStep destinationStep)
WorkflowTransition
getTransitionByName(WorkflowVersion version, String name)
Returns the transition of the specified version of the transition model by its unique name.List<WorkflowTransitionConditionGroup>
getTransitionConditionGroups(WorkflowTransition transition, LOV condGroupCd)
List<WorkflowTransition>
getTransitions(WorkflowStep sourceStep)
List<WorkflowTransition>
getTransitionsByName(Workflow workflow, String name)
Returns all transitions of the specified transition model whose unique names are equal to the specified one.<V extends WorkflowTransitionValidation>
List<V>getValidations(Class<V> transitionValidationClass, WorkflowTransitionConditionGroup conditionGroup)
WorkflowStep
getWorkflowStep(WorkflowTask workflowTask)
Get workflow step, assigned on workflow taskList<WorkflowTaskChildBcAvailability>
getWorkflowTaskChildBcAvailabilities(WorkflowStep workflowStep)
WorkflowVersion
getWorkflowVersion(WorkflowableTask task)
Returns the version of the transition model for the specified activity.boolean
isInitialStep(WorkflowStep workflowStep)
* Checks whether the specified step is the initial step for its transition model.WorkflowTransitionHistory
saveTransitionHistory(WorkflowableTask task, WorkflowTransition transition, User currentUser, User previousAssignee)
void
setWorkflowStep(WorkflowTask workflowTask, WorkflowStep workflowStep)
Sets workflow step to workflow task
-
-
-
Method Detail
-
getCurrentStep
public WorkflowStep getCurrentStep(WorkflowableTask task)
Description copied from interface:WorkflowDao
Returns the current step for the specified activity.- Specified by:
getCurrentStep
in interfaceWorkflowDao
- Parameters:
task
- task- Returns:
- current step of task
-
getHiddenStep
public WorkflowStep getHiddenStep(WorkflowVersion version)
Description copied from interface:WorkflowDao
Returns a step with the HIDDEN status for the specified version of the transition model.- Specified by:
getHiddenStep
in interfaceWorkflowDao
- Parameters:
version
- version of the transition model- Returns:
- step with the HIDDEN status
-
getInitialStep
public WorkflowStep getInitialStep(LOV taskType)
Description copied from interface:WorkflowDao
Returns the initial step for the transition model corresponding to the specified project and task type.- Specified by:
getInitialStep
in interfaceWorkflowDao
- Parameters:
taskType
- task type- Returns:
- initial step of the transition model
-
isInitialStep
public boolean isInitialStep(WorkflowStep workflowStep)
Description copied from interface:WorkflowDao
* Checks whether the specified step is the initial step for its transition model.- Specified by:
isInitialStep
in interfaceWorkflowDao
- Parameters:
workflowStep
- step- Returns:
- whether the specified step is the initial one
-
getStepByName
public WorkflowStep getStepByName(WorkflowVersion version, String name)
Description copied from interface:WorkflowDao
Returns the step of the specified version of the transition model by its unique name.- Specified by:
getStepByName
in interfaceWorkflowDao
- Parameters:
version
- version of the transition modelname
- the unique name of the step- Returns:
- step of the specified version of the transition model
-
getTransitionsByName
public List<WorkflowTransition> getTransitionsByName(Workflow workflow, String name)
Description copied from interface:WorkflowDao
Returns all transitions of the specified transition model whose unique names are equal to the specified one.- Specified by:
getTransitionsByName
in interfaceWorkflowDao
- Parameters:
workflow
- transition modelname
- unique transition name- Returns:
- list of transitions for the specified transition model
-
getTransitionByName
public WorkflowTransition getTransitionByName(WorkflowVersion version, String name)
Description copied from interface:WorkflowDao
Returns the transition of the specified version of the transition model by its unique name.- Specified by:
getTransitionByName
in interfaceWorkflowDao
- Parameters:
version
- version of the transition modelname
- unique transition name- Returns:
- transition of the specified version of the transition model
-
getLastWorkflowTransitionByName
public WorkflowTransition getLastWorkflowTransitionByName(String name)
Description copied from interface:WorkflowDao
Returns a transition from the latest version of the transition model by its unique name.- Specified by:
getLastWorkflowTransitionByName
in interfaceWorkflowDao
- Parameters:
name
- unique transition name- Returns:
- transition of the latest version of the transition model
-
getActiveWorkflowTransitionByName
public WorkflowTransition getActiveWorkflowTransitionByName(String name)
Description copied from interface:WorkflowDao
Returns a transition from the active version of the transition model by its unique name.- Specified by:
getActiveWorkflowTransitionByName
in interfaceWorkflowDao
- Parameters:
name
- unique name of the transition- Returns:
- transition of the active version of the transition model
-
getTransition
public WorkflowTransition getTransition(LOV taskType, LOV sourceStepTaskStatus, LOV destinationStepTaskStatus)
Description copied from interface:WorkflowDao
Returns the transition of the active transition model corresponding to the specified task type between steps with the specified statuses.- Specified by:
getTransition
in interfaceWorkflowDao
- Parameters:
taskType
- type of tasksourceStepTaskStatus
- initial step statusdestinationStepTaskStatus
- the status of the final step- Returns:
- transition of the transition model
-
getLastTransitionHistoryByDestinationStep
public WorkflowTransitionHistory getLastTransitionHistoryByDestinationStep(WorkflowTask task, WorkflowStep destinationStep)
Description copied from interface:WorkflowDao
Returns the last transition history record for the specified task corresponding to the transition at the specified step.- Specified by:
getLastTransitionHistoryByDestinationStep
in interfaceWorkflowDao
- Parameters:
task
- taskdestinationStep
- destination step of the transition- Returns:
- the last transition history record
-
getLastTransitionHistory
public WorkflowTransitionHistory getLastTransitionHistory(WorkflowTask task)
Description copied from interface:WorkflowDao
Returns the last transition history record for the specified task.- Specified by:
getLastTransitionHistory
in interfaceWorkflowDao
- Parameters:
task
- task- Returns:
- the last entry in the transition history
-
createDefaultPostFunctions
public void createDefaultPostFunctions(WorkflowTransitionConditionGroup transitionConditionGroup)
Description copied from interface:WorkflowDao
Creates default post-functions for the specified group of transition conditions.- Specified by:
createDefaultPostFunctions
in interfaceWorkflowDao
- Parameters:
transitionConditionGroup
- transition condition group
-
deletePostFunction
public void deletePostFunction(WorkflowPostFunction postFunction)
Description copied from interface:WorkflowDao
Deletes the specified post-function with all child entities.- Specified by:
deletePostFunction
in interfaceWorkflowDao
- Parameters:
postFunction
- post function
-
deleteTransitionConditionGroup
public void deleteTransitionConditionGroup(WorkflowTransitionConditionGroup transitionConditionGroup)
Description copied from interface:WorkflowDao
Deletes the specified transition condition group with all child entities.- Specified by:
deleteTransitionConditionGroup
in interfaceWorkflowDao
- Parameters:
transitionConditionGroup
- transition condition group
-
getWorkflowVersion
public WorkflowVersion getWorkflowVersion(WorkflowableTask task)
Description copied from interface:WorkflowDao
Returns the version of the transition model for the specified activity.- Specified by:
getWorkflowVersion
in interfaceWorkflowDao
- Parameters:
task
- activity- Returns:
- version of the transition model for the specified activity
-
getTaskTypesNotInWf
public List<LOV> getTaskTypesNotInWf()
Description copied from interface:WorkflowDao
Returns a list of TASK_TYPE types that do not have transition models created in the specified project.- Specified by:
getTaskTypesNotInWf
in interfaceWorkflowDao
- Returns:
- list of TASK_TYPE types for which transition models were not created in the specified project
-
getMaxVersion
public BigDecimal getMaxVersion(Workflow workflow)
Description copied from interface:WorkflowDao
Returns the maximum version number for the specified transition model.- Specified by:
getMaxVersion
in interfaceWorkflowDao
- Parameters:
workflow
- transition model- Returns:
- maximum version number for the specified transition model
-
getNextVersion
public BigDecimal getNextVersion(Workflow workflow, boolean majorVersion)
Description copied from interface:WorkflowDao
Returns the next version number for the specified transition model.- Specified by:
getNextVersion
in interfaceWorkflowDao
- Parameters:
workflow
- transition modelmajorVersion
- should there be a next major version- Returns:
- the next version number for the specified transition model
-
getWorkflowStep
public WorkflowStep getWorkflowStep(WorkflowTask workflowTask)
Description copied from interface:WorkflowDao
Get workflow step, assigned on workflow task- Specified by:
getWorkflowStep
in interfaceWorkflowDao
- Returns:
- workflow step
-
setWorkflowStep
public void setWorkflowStep(WorkflowTask workflowTask, WorkflowStep workflowStep)
Description copied from interface:WorkflowDao
Sets workflow step to workflow task- Specified by:
setWorkflowStep
in interfaceWorkflowDao
-
createPendingTransition
public PendingTransition createPendingTransition(WorkflowTransition transition, User sessionUser, LOV sessionUserRole)
-
createWorkflowTask
public WorkflowTask createWorkflowTask(WorkflowStep step)
-
getStepConditionGroups
public List<WorkflowStepConditionGroup> getStepConditionGroups(WorkflowStep step)
-
getAssigneeRecommendations
public List<WorkflowAssigneeRecommendation> getAssigneeRecommendations(WorkflowStepConditionGroup condGroup)
-
getTransitionConditionGroups
public List<WorkflowTransitionConditionGroup> getTransitionConditionGroups(WorkflowTransition transition, LOV condGroupCd)
-
getValidations
public <V extends WorkflowTransitionValidation> List<V> getValidations(Class<V> transitionValidationClass, WorkflowTransitionConditionGroup conditionGroup)
-
getPostFunctions
public <P extends WorkflowPostFunction> List<P> getPostFunctions(Class<P> postFunctionClass, WorkflowTransitionConditionGroup conditionGroup)
-
getTransition
public WorkflowTransition getTransition(Long transitionId)
-
getStepFields
public List<WorkflowStepField> getStepFields(WorkflowStep sourceStep)
-
getTransitions
public List<WorkflowTransition> getTransitions(WorkflowStep sourceStep)
- Specified by:
getTransitions
in interfaceWorkflowDao
- Parameters:
sourceStep
- source step- Returns:
- list of transitions for current step
-
getWorkflowTaskChildBcAvailabilities
public List<WorkflowTaskChildBcAvailability> getWorkflowTaskChildBcAvailabilities(WorkflowStep workflowStep)
-
getTransitionBetweenSteps
public WorkflowTransition getTransitionBetweenSteps(WorkflowStep sourceStep, WorkflowStep destinationStep)
- Specified by:
getTransitionBetweenSteps
in interfaceWorkflowDao
- Parameters:
sourceStep
- source stepdestinationStep
- destination step- Returns:
- transition with specified source and destination step
-
saveTransitionHistory
public WorkflowTransitionHistory saveTransitionHistory(WorkflowableTask task, WorkflowTransition transition, User currentUser, User previousAssignee)
-
getConditions
public <C extends WorkflowCondition> List<C> getConditions(Class<C> conditionClass, WorkflowTransitionConditionGroup conditionGroup)
- Specified by:
getConditions
in interfaceWorkflowDao
- Parameters:
conditionClass
- class of entity related to WF_COND table specified in WorkflowSettingsconditionGroup
- condition group of conditions- Returns:
- list of conditions for a given WorkflowTransitionConditionGroup from workflow cache
-
getConditions
public <C extends WorkflowCondition> List<C> getConditions(Class<C> conditionClass, WorkflowStepConditionGroup conditionGroup)
-
getConditions
public <C extends WorkflowCondition> List<C> getConditions(Class<C> conditionClass, WorkflowStepField stepField)
-
getConditions
public <C extends WorkflowCondition> List<C> getConditions(Class<C> conditionClass, WorkflowTaskChildBcAvailability childBcAvailability)
-
-