Java Code Examples for org.activiti.engine.impl.pvm.process.ActivityImpl#setAsync()
The following examples show how to use
org.activiti.engine.impl.pvm.process.ActivityImpl#setAsync() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IntermediateThrowEventParseHandler.java From flowable-engine with Apache License 2.0 | 6 votes |
@Override protected void executeParse(BpmnParse bpmnParse, ThrowEvent intermediateEvent) { ActivityImpl nestedActivityImpl = createActivityOnCurrentScope(bpmnParse, intermediateEvent, BpmnXMLConstants.ELEMENT_EVENT_THROW); EventDefinition eventDefinition = null; if (!intermediateEvent.getEventDefinitions().isEmpty()) { eventDefinition = intermediateEvent.getEventDefinitions().get(0); } nestedActivityImpl.setAsync(intermediateEvent.isAsynchronous()); nestedActivityImpl.setExclusive(!intermediateEvent.isNotExclusive()); if (eventDefinition instanceof SignalEventDefinition) { bpmnParse.getBpmnParserHandlers().parseElement(bpmnParse, eventDefinition); } else if (eventDefinition instanceof org.flowable.bpmn.model.CompensateEventDefinition) { bpmnParse.getBpmnParserHandlers().parseElement(bpmnParse, eventDefinition); } else if (eventDefinition == null) { nestedActivityImpl.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateThrowNoneEventActivityBehavior(intermediateEvent)); } else { LOGGER.warn("Unsupported intermediate throw event type for throw event {}", intermediateEvent.getId()); } }
Example 2
Source File: InclusiveGatewayParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, InclusiveGateway gateway) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, gateway, BpmnXMLConstants.ELEMENT_GATEWAY_INCLUSIVE); activity.setAsync(gateway.isAsynchronous()); activity.setExclusive(!gateway.isNotExclusive()); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createInclusiveGatewayActivityBehavior(gateway)); }
Example 3
Source File: SendTaskParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, SendTask sendTask) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, sendTask, BpmnXMLConstants.ELEMENT_TASK_SEND); activity.setAsync(sendTask.isAsynchronous()); activity.setExclusive(!sendTask.isNotExclusive()); if (StringUtils.isNotEmpty(sendTask.getType())) { if (sendTask.getType().equalsIgnoreCase("mail")) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createMailActivityBehavior(sendTask)); } else if (sendTask.getType().equalsIgnoreCase("mule")) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createMuleActivityBehavior(sendTask, bpmnParse.getBpmnModel())); } else if (sendTask.getType().equalsIgnoreCase("camel")) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCamelActivityBehavior(sendTask, bpmnParse.getBpmnModel())); } // for web service } else if (ImplementationType.IMPLEMENTATION_TYPE_WEBSERVICE.equalsIgnoreCase(sendTask.getImplementationType()) && StringUtils.isNotEmpty(sendTask.getOperationRef())) { WebServiceActivityBehavior webServiceActivityBehavior = bpmnParse.getActivityBehaviorFactory().createWebServiceActivityBehavior(sendTask, bpmnParse.getBpmnModel()); activity.setActivityBehavior(webServiceActivityBehavior); } else { LOGGER.warn("One of the attributes 'type' or 'operation' is mandatory on sendTask {}", sendTask.getId()); } }
Example 4
Source File: EventBasedGatewayParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, EventGateway gateway) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, gateway, BpmnXMLConstants.ELEMENT_GATEWAY_EVENT); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createEventBasedGatewayActivityBehavior(gateway)); activity.setAsync(gateway.isAsynchronous()); activity.setExclusive(!gateway.isNotExclusive()); activity.setScope(true); }
Example 5
Source File: ReceiveTaskParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, ReceiveTask receiveTask) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, receiveTask, BpmnXMLConstants.ELEMENT_TASK_RECEIVE); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createReceiveTaskActivityBehavior(receiveTask)); activity.setAsync(receiveTask.isAsynchronous()); activity.setExclusive(!receiveTask.isNotExclusive()); }
Example 6
Source File: SubProcessParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, SubProcess subProcess) { ActivityImpl activity = createActivityOnScope(bpmnParse, subProcess, BpmnXMLConstants.ELEMENT_SUBPROCESS, bpmnParse.getCurrentScope()); activity.setAsync(subProcess.isAsynchronous()); activity.setExclusive(!subProcess.isNotExclusive()); boolean triggeredByEvent = false; if (subProcess instanceof EventSubProcess) { triggeredByEvent = true; } activity.setProperty("triggeredByEvent", triggeredByEvent); // event subprocesses are not scopes activity.setScope(!triggeredByEvent); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createSubprocActivityBehavior(subProcess)); bpmnParse.setCurrentScope(activity); bpmnParse.setCurrentSubProcess(subProcess); bpmnParse.processFlowElements(subProcess.getFlowElements()); processArtifacts(bpmnParse, subProcess.getArtifacts(), activity); // no data objects for event subprocesses if (!(subProcess instanceof EventSubProcess)) { // parse out any data objects from the template in order to set up the necessary process variables Map<String, Object> variables = processDataObjects(bpmnParse, subProcess.getDataObjects(), activity); activity.setVariables(variables); } bpmnParse.removeCurrentScope(); bpmnParse.removeCurrentSubProcess(); }
Example 7
Source File: TaskParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, Task task) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, task, BpmnXMLConstants.ELEMENT_TASK); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createTaskActivityBehavior(task)); activity.setAsync(task.isAsynchronous()); activity.setExclusive(!task.isNotExclusive()); }
Example 8
Source File: CallActivityParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, CallActivity callActivity) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, callActivity, BpmnXMLConstants.ELEMENT_CALL_ACTIVITY); activity.setScope(true); activity.setAsync(callActivity.isAsynchronous()); activity.setExclusive(!callActivity.isNotExclusive()); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCallActivityBehavior(callActivity)); }
Example 9
Source File: ParallelGatewayParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, ParallelGateway gateway) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, gateway, BpmnXMLConstants.ELEMENT_GATEWAY_PARALLEL); activity.setAsync(gateway.isAsynchronous()); activity.setExclusive(!gateway.isNotExclusive()); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createParallelGatewayActivityBehavior(gateway)); }
Example 10
Source File: BusinessRuleParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, BusinessRuleTask businessRuleTask) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, businessRuleTask, BpmnXMLConstants.ELEMENT_TASK_BUSINESSRULE); activity.setAsync(businessRuleTask.isAsynchronous()); activity.setExclusive(!businessRuleTask.isNotExclusive()); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createBusinessRuleTaskActivityBehavior(businessRuleTask)); }
Example 11
Source File: ExclusiveGatewayParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, ExclusiveGateway gateway) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, gateway, BpmnXMLConstants.ELEMENT_GATEWAY_EXCLUSIVE); activity.setAsync(gateway.isAsynchronous()); activity.setExclusive(!gateway.isNotExclusive()); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createExclusiveGatewayActivityBehavior(gateway)); }
Example 12
Source File: ManualTaskParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, ManualTask manualTask) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, manualTask, BpmnXMLConstants.ELEMENT_TASK_MANUAL); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createManualTaskActivityBehavior(manualTask)); activity.setAsync(manualTask.isAsynchronous()); activity.setExclusive(!manualTask.isNotExclusive()); }
Example 13
Source File: UserTaskParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, UserTask userTask) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, userTask, BpmnXMLConstants.ELEMENT_TASK_USER); activity.setAsync(userTask.isAsynchronous()); activity.setExclusive(!userTask.isNotExclusive()); TaskDefinition taskDefinition = parseTaskDefinition(bpmnParse, userTask, userTask.getId(), (ProcessDefinitionEntity) bpmnParse.getCurrentScope().getProcessDefinition()); activity.setProperty(PROPERTY_TASK_DEFINITION, taskDefinition); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createUserTaskActivityBehavior(userTask, taskDefinition)); }
Example 14
Source File: CustomUserTaskBpmnParseHandler.java From activiti-in-action-codes with Apache License 2.0 | 4 votes |
protected void executeParse(BpmnParse bpmnParse, UserTask userTask) { super.executeParse(bpmnParse, userTask); ActivityImpl activity = findActivity(bpmnParse, userTask.getId()); activity.setAsync(true); }
Example 15
Source File: CustomServiceTaskBpmnParseHandler.java From activiti-in-action-codes with Apache License 2.0 | 4 votes |
protected void executeParse(BpmnParse bpmnParse, ServiceTask serviceTask) { super.executeParse(bpmnParse, serviceTask); ActivityImpl activity = findActivity(bpmnParse, serviceTask.getId()); activity.setAsync(true); }
Example 16
Source File: EndEventParseHandler.java From flowable-engine with Apache License 2.0 | 4 votes |
@Override protected void executeParse(BpmnParse bpmnParse, EndEvent endEvent) { ActivityImpl endEventActivity = createActivityOnCurrentScope(bpmnParse, endEvent, BpmnXMLConstants.ELEMENT_EVENT_END); EventDefinition eventDefinition = null; if (!endEvent.getEventDefinitions().isEmpty()) { eventDefinition = endEvent.getEventDefinitions().get(0); } // Error end event if (eventDefinition instanceof org.flowable.bpmn.model.ErrorEventDefinition) { org.flowable.bpmn.model.ErrorEventDefinition errorDefinition = (org.flowable.bpmn.model.ErrorEventDefinition) eventDefinition; if (bpmnParse.getBpmnModel().containsErrorRef(errorDefinition.getErrorCode())) { String errorCode = bpmnParse.getBpmnModel().getErrors().get(errorDefinition.getErrorCode()); if (StringUtils.isEmpty(errorCode)) { LOGGER.warn("errorCode is required for an error event {}", endEvent.getId()); } endEventActivity.setProperty("type", "errorEndEvent"); errorDefinition.setErrorCode(errorCode); } endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createErrorEndEventActivityBehavior(endEvent, errorDefinition)); // Cancel end event } else if (eventDefinition instanceof CancelEventDefinition) { ScopeImpl scope = bpmnParse.getCurrentScope(); if (scope.getProperty("type") == null || !scope.getProperty("type").equals("transaction")) { LOGGER.warn("end event with cancelEventDefinition only supported inside transaction subprocess (id={})", endEvent.getId()); } else { endEventActivity.setProperty("type", "cancelEndEvent"); endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCancelEndEventActivityBehavior(endEvent)); } // Terminate end event } else if (eventDefinition instanceof TerminateEventDefinition) { endEventActivity.setAsync(endEvent.isAsynchronous()); endEventActivity.setExclusive(!endEvent.isNotExclusive()); endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createTerminateEndEventActivityBehavior(endEvent)); // None end event } else if (eventDefinition == null) { endEventActivity.setAsync(endEvent.isAsynchronous()); endEventActivity.setExclusive(!endEvent.isNotExclusive()); endEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createNoneEndEventActivityBehavior(endEvent)); } }
Example 17
Source File: TransactionParseHandler.java From flowable-engine with Apache License 2.0 | 4 votes |
@Override protected void executeParse(BpmnParse bpmnParse, Transaction transaction) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, transaction, BpmnXMLConstants.ELEMENT_TRANSACTION); activity.setAsync(transaction.isAsynchronous()); activity.setExclusive(!transaction.isNotExclusive()); activity.setScope(true); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createTransactionActivityBehavior(transaction)); bpmnParse.setCurrentScope(activity); bpmnParse.processFlowElements(transaction.getFlowElements()); processArtifacts(bpmnParse, transaction.getArtifacts(), activity); bpmnParse.removeCurrentScope(); }
Example 18
Source File: ServiceTaskParseHandler.java From flowable-engine with Apache License 2.0 | 4 votes |
@Override protected void executeParse(BpmnParse bpmnParse, ServiceTask serviceTask) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, serviceTask, BpmnXMLConstants.ELEMENT_TASK_SERVICE); activity.setAsync(serviceTask.isAsynchronous()); activity.setFailedJobRetryTimeCycleValue(serviceTask.getFailedJobRetryTimeCycleValue()); activity.setExclusive(!serviceTask.isNotExclusive()); // Email, Mule and Shell service tasks if (StringUtils.isNotEmpty(serviceTask.getType())) { if (serviceTask.getType().equalsIgnoreCase("mail")) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createMailActivityBehavior(serviceTask)); } else if (serviceTask.getType().equalsIgnoreCase("mule")) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createMuleActivityBehavior(serviceTask, bpmnParse.getBpmnModel())); } else if (serviceTask.getType().equalsIgnoreCase("camel")) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCamelActivityBehavior(serviceTask, bpmnParse.getBpmnModel())); } else if (serviceTask.getType().equalsIgnoreCase("shell")) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createShellActivityBehavior(serviceTask)); } else { LOGGER.warn("Invalid service task type: '{}' for service task {}", serviceTask.getType(), serviceTask.getId()); } // activiti:class } else if (ImplementationType.IMPLEMENTATION_TYPE_CLASS.equalsIgnoreCase(serviceTask.getImplementationType())) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createClassDelegateServiceTask(serviceTask)); // activiti:delegateExpression } else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createServiceTaskDelegateExpressionActivityBehavior(serviceTask)); // activiti:expression } else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) { activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createServiceTaskExpressionActivityBehavior(serviceTask)); // Webservice } else if (ImplementationType.IMPLEMENTATION_TYPE_WEBSERVICE.equalsIgnoreCase(serviceTask.getImplementationType()) && StringUtils.isNotEmpty(serviceTask.getOperationRef())) { WebServiceActivityBehavior webServiceActivityBehavior = bpmnParse.getActivityBehaviorFactory().createWebServiceActivityBehavior(serviceTask, bpmnParse.getBpmnModel()); activity.setActivityBehavior(webServiceActivityBehavior); } else { LOGGER.warn("One of the attributes 'class', 'delegateExpression', 'type', 'operation', or 'expression' is mandatory on serviceTask {}", serviceTask.getId()); } }
Example 19
Source File: IntermediateCatchEventParseHandler.java From flowable-engine with Apache License 2.0 | 4 votes |
@Override protected void executeParse(BpmnParse bpmnParse, IntermediateCatchEvent event) { ActivityImpl nestedActivity = null; EventDefinition eventDefinition = null; if (!event.getEventDefinitions().isEmpty()) { eventDefinition = event.getEventDefinitions().get(0); } if (eventDefinition == null) { nestedActivity = createActivityOnCurrentScope(bpmnParse, event, BpmnXMLConstants.ELEMENT_EVENT_CATCH); nestedActivity.setAsync(event.isAsynchronous()); nestedActivity.setExclusive(!event.isNotExclusive()); } else { ScopeImpl scope = bpmnParse.getCurrentScope(); String eventBasedGatewayId = getPrecedingEventBasedGateway(bpmnParse, event); if (eventBasedGatewayId != null) { ActivityImpl gatewayActivity = scope.findActivity(eventBasedGatewayId); nestedActivity = createActivityOnScope(bpmnParse, event, BpmnXMLConstants.ELEMENT_EVENT_CATCH, gatewayActivity); } else { nestedActivity = createActivityOnScope(bpmnParse, event, BpmnXMLConstants.ELEMENT_EVENT_CATCH, scope); } nestedActivity.setAsync(event.isAsynchronous()); nestedActivity.setExclusive(!event.isNotExclusive()); // Catch event behavior is the same for all types nestedActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateCatchEventActivityBehavior(event)); if (eventDefinition instanceof TimerEventDefinition || eventDefinition instanceof SignalEventDefinition || eventDefinition instanceof MessageEventDefinition) { bpmnParse.getBpmnParserHandlers().parseElement(bpmnParse, eventDefinition); } else { LOGGER.warn("Unsupported intermediate catch event type for event {}", event.getId()); } } }
Example 20
Source File: ScriptTaskParseHandler.java From flowable-engine with Apache License 2.0 | 3 votes |
@Override protected void executeParse(BpmnParse bpmnParse, ScriptTask scriptTask) { if (StringUtils.isEmpty(scriptTask.getScript())) { LOGGER.warn("No script provided for scriptTask {}", scriptTask.getId()); } ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, scriptTask, BpmnXMLConstants.ELEMENT_TASK_SCRIPT); activity.setAsync(scriptTask.isAsynchronous()); activity.setExclusive(!scriptTask.isNotExclusive()); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createScriptTaskActivityBehavior(scriptTask)); }