Class ActivityChecker
java.lang.Object
org.chenile.workflow.service.activities.ActivityChecker
Given that there are a bunch of activities that can be accomplished in a State and that
all these activities are tracked by the state entity, this strategy checks if all these
activities are completed. In the state machine, activities are modelled as events. They
are annotated with a metadata called activity whose value is set to MANDATORY or OPTIONAL.
An event with no activity metadata is not an activity by definition.
All mandatory activities need to be completed. Optional activities will not be checked for completion.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanareAllActivitiesComplete(ActivityEnabledStateEntity stateEntity) booleanareAllActivitiesComplete(ActivityEnabledStateEntity stateEntity, State whichState) private ActivityTypegetActivityType(Map<String, String> metadata) booleanisActivity(Transition transition) booleanisActivity(ActivityEnabledStateEntity stateEntity, String eventId) private booleanisActivityComplete(String eventId, ActivityEnabledStateEntity stateEntity) booleanisCompletionChecker(Transition transition) booleanisCompletionChecker(ActivityEnabledStateEntity stateEntity, String eventId) booleanisMandatoryActivity(Transition transition) booleanisMandatoryActivity(ActivityEnabledStateEntity stateEntity, String eventId) booleanisOptionalActivity(Transition transition) booleanisOptionalActivity(ActivityEnabledStateEntity stateEntity, String eventId)
-
Field Details
-
ACTIVITY_DATA_NAME
- See Also:
-
stmFlowStore
-
-
Constructor Details
-
ActivityChecker
-
-
Method Details
-
areAllActivitiesComplete
- Parameters:
stateEntity- the activity enabled state entity.- Returns:
- false if we find even a single MANDATORY activity (in the current state) that has not been marked SUCCESSFUL.
-
areAllActivitiesComplete
- Parameters:
stateEntity- the activity enabled state entity.whichState- the state against which all activities will be tracked.- Returns:
- false if we find even a single MANDATORY activity that has not been marked SUCCESSFUL.
-
isActivityComplete
- Parameters:
eventId- the event ID to check if it is completestateEntity- the activity enabled state entity to check.- Returns:
- true if we found at least one activity that matches the event ID and is marked successful
-
getActivityType
-
isMandatoryActivity
-
isMandatoryActivity
-
isCompletionChecker
-
isCompletionChecker
-
isOptionalActivity
-
isOptionalActivity
-
isActivity
-
isActivity
-