public void addHandlers(List<BpmnParseHandler> bpmnParseHandlers) { for (BpmnParseHandler bpmnParseHandler : bpmnParseHandlers) { addHandler(bpmnParseHandler); } }
/** * Constructor to be called by the {@link BpmnParser}. */ public BpmnParse(BpmnParser parser) { this.activityBehaviorFactory = parser.getActivityBehaviorFactory(); this.listenerFactory = parser.getListenerFactory(); this.bpmnParserHandlers = parser.getBpmnParserHandlers(); }
public BpmnParse createBpmnParse(BpmnParser bpmnParser) { return new BpmnParse(bpmnParser); } }
protected void executeParse(BpmnParse bpmnParse, ErrorEventDefinition eventDefinition) { if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) { BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement(); boundaryEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryEventActivityBehavior(boundaryEvent, true)); } } }
public BpmnParse sourceResource(String resource, ClassLoader classLoader) { if (name == null) { name(resource); } setStreamSource(new ResourceStreamSource(resource, classLoader)); return this; }
protected void executeParse(BpmnParse bpmnParse, CancelEventDefinition cancelEventDefinition) { if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) { BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement(); boundaryEvent.setBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryCancelEventActivityBehavior(cancelEventDefinition)); } } }
@Override protected void executeParse(BpmnParse bpmnParse, BusinessRuleTask businessRuleTask) { businessRuleTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createBusinessRuleTaskActivityBehavior(businessRuleTask)); }
@Override protected void executeParse(BpmnParse bpmnParse, UserTask userTask) { userTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createUserTaskActivityBehavior(userTask)); }
protected void executeParse(BpmnParse bpmnParse, ManualTask manualTask) { manualTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createManualTaskActivityBehavior(manualTask)); } }
protected void createCamelActivityBehavior(BpmnParse bpmnParse, ServiceTask serviceTask) { serviceTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createCamelActivityBehavior(serviceTask)); }
protected void executeParse(BpmnParse bpmnParse, InclusiveGateway gateway) { gateway.setBehavior(bpmnParse.getActivityBehaviorFactory().createInclusiveGatewayActivityBehavior(gateway)); }
protected void executeParse(BpmnParse bpmnParse, BoundaryEvent boundaryEvent) { if (boundaryEvent.getAttachedToRef() == null) { logger.warn("Invalid reference in boundary event. Make sure that the referenced activity " + "is defined in the same scope as the boundary event " + boundaryEvent.getId()); return; } EventDefinition eventDefinition = null; if (boundaryEvent.getEventDefinitions().size() > 0) { eventDefinition = boundaryEvent.getEventDefinitions().get(0); } if (eventDefinition instanceof TimerEventDefinition || eventDefinition instanceof ErrorEventDefinition || eventDefinition instanceof SignalEventDefinition || eventDefinition instanceof CancelEventDefinition || eventDefinition instanceof MessageEventDefinition || eventDefinition instanceof CompensateEventDefinition) { bpmnParse.getBpmnParserHandlers().parseElement(bpmnParse, eventDefinition); } else { // Should already be picked up by process validator on deploy, so this is just to be sure logger.warn("Unsupported boundary event type for boundary event " + boundaryEvent.getId()); } }
public BpmnParse sourceResource(String resource) { return sourceResource(resource, null); }
public int compare(ErrorEventDefinition o1, ErrorEventDefinition o2) { return o2.getPrecedence().compareTo(o1.getPrecedence()); } };
public BpmnModel getBpmnModelForProcessDefinition(ProcessDefinitionEntity processDefinition) { BpmnParse parse = getBpmnParseForProcessDefinition(processDefinition); return (parse == null ? null : parse.getBpmnModel()); }
public BpmnParse sourceUrl(String url) { try { return sourceUrl(new URL(url)); } catch (MalformedURLException e) { throw new ActivitiIllegalArgumentException("malformed url: " + url, e); } }
protected void executeParse(BpmnParse bpmnParse, SequenceFlow sequenceFlow) { org.activiti.bpmn.model.Process process = bpmnParse.getCurrentProcess(); sequenceFlow.setSourceFlowElement(process.getFlowElement(sequenceFlow.getSourceRef(), true)); sequenceFlow.setTargetFlowElement(process.getFlowElement(sequenceFlow.getTargetRef(), true)); }
public BpmnParse sourceString(String string) { if (name == null) { name("string"); } setStreamSource(new StringStreamSource(string)); return this; }
public BpmnParse sourceInputStream(InputStream inputStream) { if (name == null) { name("inputStream"); } setStreamSource(new InputStreamSource(inputStream)); return this; }
public BpmnParse sourceUrl(URL url) { if (name == null) { name(url.toString()); } setStreamSource(new UrlStreamSource(url)); return this; }