use of org.camunda.bpm.engine.impl.core.model.Properties in project camunda-bpm-platform by camunda.
the class BpmnParse method parseScopeStartEvent.
protected void parseScopeStartEvent(ActivityImpl startEventActivity, Element startEventElement, Element parentElement, ActivityImpl scopeActivity) {
Properties scopeProperties = scopeActivity.getProperties();
// set this as the scope's initial
if (!scopeProperties.contains(BpmnProperties.INITIAL_ACTIVITY)) {
scopeProperties.set(BpmnProperties.INITIAL_ACTIVITY, startEventActivity);
} else {
addError("multiple start events not supported for subprocess", startEventElement);
}
Element errorEventDefinition = startEventElement.element(ERROR_EVENT_DEFINITION);
Element messageEventDefinition = startEventElement.element(MESSAGE_EVENT_DEFINITION);
Element signalEventDefinition = startEventElement.element(SIGNAL_EVENT_DEFINITION);
Element timerEventDefinition = startEventElement.element(TIMER_EVENT_DEFINITION);
Element compensateEventDefinition = startEventElement.element(COMPENSATE_EVENT_DEFINITION);
Element escalationEventDefinitionElement = startEventElement.element(ESCALATION_EVENT_DEFINITION);
Element conditionalEventDefinitionElement = startEventElement.element(CONDITIONAL_EVENT_DEFINITION);
if (scopeActivity.isTriggeredByEvent()) {
// event subprocess
EventSubProcessStartEventActivityBehavior behavior = new EventSubProcessStartEventActivityBehavior();
// parse isInterrupting
String isInterruptingAttr = startEventElement.attribute(INTERRUPTING);
boolean isInterrupting = isInterruptingAttr.equalsIgnoreCase(TRUE);
if (isInterrupting) {
scopeActivity.setActivityStartBehavior(ActivityStartBehavior.INTERRUPT_EVENT_SCOPE);
} else {
scopeActivity.setActivityStartBehavior(ActivityStartBehavior.CONCURRENT_IN_FLOW_SCOPE);
}
// the event scope of the start event is the flow scope of the event subprocess
startEventActivity.setEventScope(scopeActivity.getFlowScope());
if (errorEventDefinition != null) {
if (!isInterrupting) {
addError("error start event of event subprocess must be interrupting", startEventElement);
}
parseErrorStartEventDefinition(errorEventDefinition, startEventActivity);
} else if (messageEventDefinition != null) {
startEventActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.START_EVENT_MESSAGE);
EventSubscriptionDeclaration messageStartEventSubscriptionDeclaration = parseMessageEventDefinition(messageEventDefinition);
parseEventDefinitionForSubprocess(messageStartEventSubscriptionDeclaration, startEventActivity, messageEventDefinition);
} else if (signalEventDefinition != null) {
startEventActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.START_EVENT_SIGNAL);
EventSubscriptionDeclaration eventSubscriptionDeclaration = parseSignalEventDefinition(signalEventDefinition, false);
parseEventDefinitionForSubprocess(eventSubscriptionDeclaration, startEventActivity, signalEventDefinition);
} else if (timerEventDefinition != null) {
parseTimerStartEventDefinitionForEventSubprocess(timerEventDefinition, startEventActivity, isInterrupting);
} else if (compensateEventDefinition != null) {
parseCompensationEventSubprocess(startEventActivity, startEventElement, scopeActivity, compensateEventDefinition);
} else if (escalationEventDefinitionElement != null) {
startEventActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.START_EVENT_ESCALATION);
EscalationEventDefinition escalationEventDefinition = createEscalationEventDefinitionForEscalationHandler(escalationEventDefinitionElement, scopeActivity, isInterrupting);
addEscalationEventDefinition(startEventActivity.getEventScope(), escalationEventDefinition, escalationEventDefinitionElement);
} else if (conditionalEventDefinitionElement != null) {
final ConditionalEventDefinition conditionalEventDef = parseConditionalStartEventForEventSubprocess(conditionalEventDefinitionElement, startEventActivity, isInterrupting);
behavior = new EventSubProcessStartConditionalEventActivityBehavior(conditionalEventDef);
} else {
addError("start event of event subprocess must be of type 'error', 'message', 'timer', 'signal', 'compensation' or 'escalation'", startEventElement);
}
startEventActivity.setActivityBehavior(behavior);
} else {
// "regular" subprocess
Element conditionalEventDefinition = startEventElement.element(CONDITIONAL_EVENT_DEFINITION);
if (conditionalEventDefinition != null) {
addError("conditionalEventDefinition is not allowed on start event within a subprocess", conditionalEventDefinition);
}
if (timerEventDefinition != null) {
addError("timerEventDefinition is not allowed on start event within a subprocess", timerEventDefinition);
}
if (escalationEventDefinitionElement != null) {
addError("escalationEventDefinition is not allowed on start event within a subprocess", escalationEventDefinitionElement);
}
if (compensateEventDefinition != null) {
addError("compensateEventDefinition is not allowed on start event within a subprocess", compensateEventDefinition);
}
if (errorEventDefinition != null) {
addError("errorEventDefinition only allowed on start event if subprocess is an event subprocess", errorEventDefinition);
}
if (messageEventDefinition != null) {
addError("messageEventDefinition only allowed on start event if subprocess is an event subprocess", messageEventDefinition);
}
if (signalEventDefinition != null) {
addError("signalEventDefintion only allowed on start event if subprocess is an event subprocess", messageEventDefinition);
}
startEventActivity.setActivityBehavior(new NoneStartEventActivityBehavior());
}
}
use of org.camunda.bpm.engine.impl.core.model.Properties in project camunda-bpm-platform by camunda.
the class CompensationInstanceHandler method getMigrationInstruction.
protected MigrationInstruction getMigrationInstruction(MigratingInstanceParseContext parseContext, ActivityImpl activity) {
if (activity.isCompensationHandler()) {
Properties compensationHandlerProperties = activity.getProperties();
ActivityImpl eventTrigger = compensationHandlerProperties.get(BpmnProperties.COMPENSATION_BOUNDARY_EVENT);
if (eventTrigger == null) {
eventTrigger = compensationHandlerProperties.get(BpmnProperties.INITIAL_ACTIVITY);
}
return parseContext.findSingleMigrationInstruction(eventTrigger.getActivityId());
} else {
return parseContext.findSingleMigrationInstruction(activity.getActivityId());
}
}
use of org.camunda.bpm.engine.impl.core.model.Properties in project camunda-bpm-platform by camunda.
the class AbstractDefinitionDeployer method deploy.
public void deploy(DeploymentEntity deployment) {
LOG.debugProcessingDeployment(deployment.getName());
Properties properties = new Properties();
List<DefinitionEntity> definitions = parseDefinitionResources(deployment, properties);
ensureNoDuplicateDefinitionKeys(definitions);
postProcessDefinitions(deployment, definitions, properties);
}
Aggregations