public abstract class PlanItem extends Object
A typed plan item. It is the combination of a PlanItem
(CMMN model) and its associated TPlanItemDefinition
.
<p>
<p>Do not rename this class. The name is part of public API. Moving the class to a different package, however, is possible.</p>
public void handlePlanItemTransition(PlanItemTransition planItemTransition, TransitionData transitionData, EventSources eventSources, EngineListeners engineListeners, PersistenceListeners persistenceListeners)
Handle the given planItemTransition
.
planItemTransition
- the plan item transition to handle.transitionData
- the transition dataeventSources
- the event sourcesengineListeners
- the engine listener implementation that is used to pass the
transition on to client code once any internal state change has been performed.public PlanItemData getNewPlanItemData()
Ceate and return a new PlanItemData
instance representing the
current state of this object (for the purpose to save and later restore it).
public String getParentInstanceId()
public Map<String,Sentry> getArmedEntrySentries(TransitionData transitionData, EvaluationListeners evaluationListeners)
public Map<String,Sentry> getDeferredEntrySentries()
public Map<String,Sentry> getArmedExitSentries(TransitionData transitionData, EvaluationListeners evaluationListeners)
public Map<String,Sentry> getDeferredExitSentries()
public boolean isArmed(TransitionData transitionData, EvaluationListeners evaluationListeners)
true
if this plan item is armed. For a plan item with entry sentries this means that
the plan item is in state AVAILABLE and one or more of the plan item’s entry sentry (or sentries) are armed
(See getArmedEntrySentries(TransitionData, EvaluationListeners)
). For an event listener, armed means
that invoking the OCCUR transition on the event listener has an effect, i.e. it triggers a transition on
one or more connected plan items.public boolean isOfSameHierarchy(PlanItem sentryOwner, boolean isExitSentry)
<p>Test if the passed plan item lives in the same run-time stage hierarchy as this plan item.</p> <p> <p>The test is done by comparing stage hierarchy paths. Both paths are calculated and then compared to each other. The comparison succeeds if the run-time paths match from the case plan model down to the level of the two plan item’s common static model stage path.</p>
sentryOwner
- the plan item owning the sentryisExitSentry
- whether the sentry is an exit sentry (false → entry sentry)public boolean isTriggeredExitSentry(String id)
public boolean isManualActivation(TransitionData transitionData, EvaluationListeners evaluationListeners)
Note: Referring to figure 5.12 in the spec, a missing manual activation rule should evaluate to 'true' (i.e. manual activation). Thus a missing manual activation simbol in the model for a plan item (resulting in no manual activation expression) leads to a manual activation value of 'true'. This semantic is different from both, the repetition rule handling and the required rule handling. In order to treat them all the same, the code here treats a missing manual activation rule as false, i.e. automatic activation.
transitionData
- optional evaluation contextevaluationListeners
- the evaluation listenerstrue
if there is a manual activation rule for the plan item and
if so it evaluates to true
. Return false
otherwise.public boolean isRepetition(TransitionData transitionData, EvaluationListeners evaluationListeners)
transitionData
- optional evaluation contextevaluationListeners
- the evaluation listenerstrue
if there is a repdtition rule for the plan item and if so it
evaluates to true
. Return false
otherwise.public boolean isRequired(TransitionData transitionData, EvaluationListeners evaluationListeners)
transitionData
- optional evaluation contextevaluationListeners
- the evaluation listenerstrue
if there is a required rule for the plan item and if so it
evaluates to true
. Return false
otherwise.public Boolean isCompletionNeutral()
Get the value of the completionNeutral property on the plan item definition. A missing property means false
.
public boolean isBlocking()
public boolean isNonBlockingComplete()
true`If this is a non-blocking plan item which is in state COMPLETED
(the state it automatically gets as a result of starting it. Return `false
otherwise.public boolean isTerminal()
public boolean isSemiTerminal()
public boolean isPreActivation()
true
if the plan item has never been activated state (available,
enabled, disabled, expired). false
otherwise.public boolean isPending()
Either AVAILABLE or ENABLED - The state of being not yet triggered.
public int getAvailableCount()
public int getAvailableCountInStage()
public int getAvailableChildrenCount()
public int getActiveCount()
public int getActiveCountInStage()
public int getActiveChildrenCount()
public int getTriggeredCount()
public int getTriggeredCountInStage()
public int getTriggeredChildrenCount()
public int getCompletedCount()
public int getCompletedCountInStage()
public int getCompletedChildrenCount()
public int getTerminatedCount()
public int getTerminatedCountInStage()
public int getTerminatedChildrenCount()
public int getEnabledCount()
public int getEnabledCountInStage()
public int getEnabledChildrenCount()
public int getDisabledCount()
public int getDisabledCountInStage()
public int getDisabledChildrenCount()
public int getInstanceCount()
public int getInstanceCountInStage()
public int getChildInstanceCount()
public int getIndexInStage()
public boolean isWaitingOnChildren(TransitionData transitionData, EvaluationListeners evaluationListeners)
true
if this stage plan item is waiting on its children in order to complete.
Return `false> otherwise or when called on a non stage plan item.public boolean isWaitingOnChildren(boolean stageAutoComplete, TransitionData transitionData, EvaluationListeners evaluationListeners)
true
if this stage plan item is waiting on its children in order to complete (under the scenario that the stage’s
auto-complete property has the value as passed in the method parameter).
Return `false> otherwise or when called on a non stage plan item.public final String getId()
id
property of this plan item’s PlannableItem
. This is the model Id.public final String getInstanceId()
instanceId
property of this plan item. This is the model Id appended by '~' and an integer instance suffix.public final int getInstanceIntId()
getInstanceId()
.public PlanItemAction createPlanItemAction(TransitionData transitionData, EvaluationListeners evaluationListeners)
<p>Create an action object for the current state of this plan item. For example, a user event listener in state Available should return an action triggering the 'occur' transition.</p> <p>These actions won’t be immediately executed. They are used to render appropriate GUI elements triggering the action based on the user clicking the action button.</p>
transitionData
- optional evaluation context.evaluationListeners
- the call-backs used to evaluate run-time action name expressions.null
.public boolean isActionHidden(TransitionData transitionData, EvaluationListeners evaluationListeners)
Implements https://jira.edorasware.com/browse/CLD-8130
public PlannableItem getPlannableItem()
public String getName()
name
property of this plan item’s PlannableItem
.public String getName(Locale locale)
locale
- the required localename
property of this plan item’s PlannableItem
.public String getName(TransitionData transitionData, EvaluationListeners evaluationListeners)
public String getActionName()
public String getActionName(TransitionData transitionData, EvaluationListeners evaluationListeners)
public String getDescription()
description
property of this plan item’s PlannableItem
.public String getActionDescription()
public String getActivationTime()
The Java timestamp of the moment the plan item transitioned to ACTIVE. May be null
if not
yet activated or if not applicable to the plan item type (e.g. event listeners).
public final PlanItemState getState()
public PlanItemTransition getLastPlanItemTransition()
public void setState(PlanItemState state)
state
- the statepublic TPlanItemDefinition getTPlanItemDefinition()
public CasePlanModel getCasePlanModel()
Get the casePlanModel
from the parent. Climbs up the parent chain
to the root (casePlanModel
) and returns the root.
public String getClientRef()
Default implementation returning null
.
public String getClientId()
public void setClientId(String clientId)
clientId
- the client idpublic String getExtensionType()
public Stage getParent()
public Map<String,String> getCustomState()
null
.public String getCustomState(String key)
Retrieve a custom state value for the passed key.
public void setCustomState(String key, String value)
Store a value under the given key in the plan item’s custom state map.
public void setCustomState(String key, String value, boolean overwrite)
Store a value under the given key in the plan item’s custom state map. The caller may choose not to overwrite an already existing entry for the passed key.
public void applyVisitor(PlannableItemVisitor visitor, TransitionData transitionData)
Apply a plannable item visitor to this plan item. There are implementations of this method for all plan items which may contain a planning table (currently only stages; human tasks may follow in the future).
visitor
- the plannable item visitor.transitionData
- optional evaluation context.public String getPlanItemTypeShort()
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.