use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class PlanItemDefinitionActivityBehavior method repeat.
// repetition ///////////////////////////////////////////////////////////////
public void repeat(CmmnActivityExecution execution, String standardEvent) {
CmmnActivity activity = execution.getActivity();
boolean repeat = false;
if (activity.getEntryCriteria().isEmpty()) {
List<String> events = activity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
if (events != null && events.contains(standardEvent)) {
repeat = evaluateRepetitionRule(execution);
}
} else {
if (ENABLE.equals(standardEvent) || START.equals(standardEvent) || OCCUR.equals(standardEvent)) {
repeat = evaluateRepetitionRule(execution);
}
}
if (repeat) {
CmmnActivityExecution parent = execution.getParent();
// instantiate a new instance of given activity
List<CmmnExecution> children = parent.createChildExecutions(Arrays.asList(activity));
// start the lifecycle of the new instance
parent.triggerChildExecutionsLifecycle(children);
}
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class PlanItemDefinitionActivityBehavior method evaluateRequiredRule.
// rules (required and repetition rule) /////////////////////////////////////////
protected void evaluateRequiredRule(CmmnActivityExecution execution) {
CmmnActivity activity = execution.getActivity();
Object requiredRule = activity.getProperty(PROPERTY_REQUIRED_RULE);
if (requiredRule != null) {
CaseControlRule rule = (CaseControlRule) requiredRule;
boolean required = rule.evaluate(execution);
execution.setRequired(required);
}
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class StageOrTaskActivityBehavior method evaluateManualActivationRule.
// manual activation rule //////////////////////////////////////////////
protected boolean evaluateManualActivationRule(CmmnActivityExecution execution) {
boolean manualActivation = false;
CmmnActivity activity = execution.getActivity();
Object manualActivationRule = activity.getProperty(PROPERTY_MANUAL_ACTIVATION_RULE);
if (manualActivationRule != null) {
CaseControlRule rule = (CaseControlRule) manualActivationRule;
manualActivation = rule.evaluate(execution);
}
return manualActivation;
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class StageActivityBehavior method evaluateAutoComplete.
protected boolean evaluateAutoComplete(CmmnActivityExecution execution) {
CmmnActivity activity = getActivity(execution);
Object autoCompleteProperty = activity.getProperty(PROPERTY_AUTO_COMPLETE);
if (autoCompleteProperty != null) {
String message = "Property autoComplete expression returns non-Boolean: " + autoCompleteProperty + " (" + autoCompleteProperty.getClass().getName() + ")";
ensureInstanceOf(message, "autoComplete", autoCompleteProperty, Boolean.class);
return (Boolean) autoCompleteProperty;
}
return false;
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class StageActivityBehavior method performStart.
// start /////////////////////////////////////////////////////////////////////
protected void performStart(CmmnActivityExecution execution) {
CmmnActivity activity = execution.getActivity();
List<CmmnActivity> childActivities = activity.getActivities();
if (childActivities != null && !childActivities.isEmpty()) {
List<CmmnExecution> children = execution.createChildExecutions(childActivities);
execution.createSentryParts();
execution.triggerChildExecutionsLifecycle(children);
if (execution.isActive()) {
execution.fireIfOnlySentryParts();
// then the stage will be completed.
if (execution.isActive()) {
checkAndCompleteCaseExecution(execution);
}
}
} else {
execution.complete();
}
}
Aggregations