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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
areAllActivitiesComplete
(ActivityEnabledStateEntity stateEntity) boolean
areAllActivitiesComplete
(ActivityEnabledStateEntity stateEntity, State whichState) private ActivityType
getActivityType
(Map<String, String> metadata) boolean
isActivity
(ActivityEnabledStateEntity stateEntity, String eventId) private boolean
isActivityComplete
(String eventId, ActivityEnabledStateEntity stateEntity) boolean
isMandatoryActivity
(ActivityEnabledStateEntity stateEntity, String eventId) boolean
isOptionalActivity
(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
-
isOptionalActivity
-
isActivity
-