@Override protected void executeParse(BpmnParse bpmnParse, StartEvent element) { bpmnParse.getCurrentActivity().addExecutionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, START_EVENT_END_HANDLER); }
protected void executeParse(BpmnParse bpmnParse, StartEvent element) { bpmnParse.getCurrentActivity().addExecutionListener(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_END, START_EVENT_END_HANDLER); }
@Override protected void executeParse(BpmnParse bpmnParse, UserTask element) { TaskDefinition taskDefinition = (TaskDefinition) bpmnParse.getCurrentActivity().getProperty(UserTaskParseHandler.PROPERTY_TASK_DEFINITION); taskDefinition.addTaskListener(TaskListener.EVENTNAME_ASSIGNMENT, USER_TASK_ASSIGNMENT_HANDLER); taskDefinition.addTaskListener(TaskListener.EVENTNAME_CREATE, USER_TASK_ID_HANDLER); }
protected void executeParse(BpmnParse bpmnParse, UserTask element) { TaskDefinition taskDefinition = (TaskDefinition) bpmnParse.getCurrentActivity().getProperty(UserTaskParseHandler.PROPERTY_TASK_DEFINITION); taskDefinition.addTaskListener(TaskListener.EVENTNAME_ASSIGNMENT, USER_TASK_ASSIGNMENT_HANDLER); taskDefinition.addTaskListener(TaskListener.EVENTNAME_CREATE, USER_TASK_ID_HANDLER); }
@Override protected void executeParse(BpmnParse bpmnParse, CancelEventDefinition cancelEventDefinition) { if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) { ActivityImpl activity = bpmnParse.getCurrentActivity(); activity.setProperty("type", "cancelBoundaryCatch"); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCancelBoundaryEventActivityBehavior(cancelEventDefinition)); } }
protected void executeParse(BpmnParse bpmnParse, CancelEventDefinition cancelEventDefinition) { BpmnModel bpmnModel = bpmnParse.getBpmnModel(); if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) { ActivityImpl activity = bpmnParse.getCurrentActivity(); activity.setProperty("type", "cancelBoundaryCatch"); ActivityImpl parent = (ActivityImpl) activity.getParent(); if (!parent.getProperty("type").equals("transaction")) { bpmnModel.addProblem("boundary event with cancelEventDefinition only supported on transaction subprocesses.", cancelEventDefinition); } for (ActivityImpl child : parent.getActivities()) { if (child.getProperty("type").equals("cancelBoundaryCatch") && child != activity) { bpmnModel.addProblem("multiple boundary events with cancelEventDefinition not supported on same transaction subprocess.", cancelEventDefinition); } } activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCancelBoundaryEventActivityBehavior(cancelEventDefinition)); } }
@Override protected void executeParse(BpmnParse bpmnParse, CompensateEventDefinition eventDefinition) { ScopeImpl scope = bpmnParse.getCurrentScope(); if (StringUtils.isNotEmpty(eventDefinition.getActivityRef())) { if (scope.findActivity(eventDefinition.getActivityRef()) == null) { LOGGER.warn("Invalid attribute value for 'activityRef': no activity with id '{}' in current scope {}", eventDefinition.getActivityRef(), scope.getId()); } } org.activiti.engine.impl.bpmn.parser.CompensateEventDefinition compensateEventDefinition = new org.activiti.engine.impl.bpmn.parser.CompensateEventDefinition(); compensateEventDefinition.setActivityRef(eventDefinition.getActivityRef()); compensateEventDefinition.setWaitForCompletion(eventDefinition.isWaitForCompletion()); ActivityImpl activity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof ThrowEvent) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateThrowCompensationEventActivityBehavior((ThrowEvent) bpmnParse.getCurrentFlowElement(), compensateEventDefinition)); } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) { BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement(); boolean interrupting = boundaryEvent.isCancelActivity(); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryEventActivityBehavior(boundaryEvent, interrupting, activity)); activity.setProperty("type", "compensationBoundaryCatch"); } else { // What to do? } }
ActivityImpl activity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof StartEvent) {
@Override protected void executeParse(BpmnParse bpmnParse, ErrorEventDefinition eventDefinition) { ErrorEventDefinition modelErrorEvent = eventDefinition; if (bpmnParse.getBpmnModel().containsErrorRef(modelErrorEvent.getErrorCode())) { String errorCode = bpmnParse.getBpmnModel().getErrors().get(modelErrorEvent.getErrorCode()); modelErrorEvent.setErrorCode(errorCode); } ScopeImpl scope = bpmnParse.getCurrentScope(); ActivityImpl activity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof StartEvent) { if (scope.getProperty(PROPERTYNAME_INITIAL) == null) { scope.setProperty(PROPERTYNAME_INITIAL, activity); // the scope of the event subscription is the parent of the event // subprocess (subscription must be created when parent is initialized) ScopeImpl catchingScope = ((ActivityImpl) scope).getParent(); createErrorStartEventDefinition(modelErrorEvent, activity, catchingScope); } } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) { BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement(); boolean interrupting = true; // non-interrupting not yet supported activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryEventActivityBehavior(boundaryEvent, interrupting, activity)); ActivityImpl parentActivity = scope.findActivity(boundaryEvent.getAttachedToRefId()); createBoundaryErrorEventDefinition(modelErrorEvent, interrupting, parentActivity, activity); } }
compensateEventDefinition.setWaitForCompletion(eventDefinition.isWaitForCompletion()); ActivityImpl activity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof ThrowEvent) {
@Override protected void executeParse(BpmnParse bpmnParse, TimerEventDefinition timerEventDefinition) { ActivityImpl timerActivity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof StartEvent) {
protected void executeParse(BpmnParse bpmnParse, TimerEventDefinition timerEventDefinition) { ActivityImpl timerActivity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof StartEvent) {
ActivityImpl activity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof StartEvent && bpmnParse.getCurrentSubProcess() != null) {
ActivityImpl activity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof StartEvent) {
ActivityImpl activity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof StartEvent && bpmnParse.getCurrentSubProcess() != null) {
ActivityImpl activity = bpmnParse.getCurrentActivity(); if (bpmnParse.getCurrentFlowElement() instanceof StartEvent) {