protected void verifyImplementation(Process process, ServiceTask serviceTask, List<ValidationError> errors) { if (!ImplementationType.IMPLEMENTATION_TYPE_CLASS.equalsIgnoreCase(serviceTask.getImplementationType()) && !ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType()) && !ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType()) && !ImplementationType.IMPLEMENTATION_TYPE_WEBSERVICE.equalsIgnoreCase(serviceTask.getImplementationType()) && StringUtils.isEmpty(serviceTask.getType()) && StringUtils.isEmpty(serviceTask.getImplementation())) { addError(errors, Problems.SERVICE_TASK_MISSING_IMPLEMENTATION, process, serviceTask, "One of the attributes 'implementation', 'class', 'delegateExpression', 'type', 'operation', or 'expression' is mandatory on serviceTask."); } }
private String getServiceTaskImplementation(DelegateExecution execution) { return ((ServiceTask) execution.getCurrentFlowElement()).getImplementation(); }
@Override public ClassDelegate createClassDelegateServiceTask(ServiceTask serviceTask) { if (allServiceTasksNoOp || noOpServiceTaskIds.contains(serviceTask.getId()) || noOpServiceTaskClassNames.contains(serviceTask.getImplementation())) { return createNoOpServiceTask(serviceTask); } else if (serviceTask.getImplementation() != null && mockedClassDelegatesMapping.containsKey(serviceTask.getImplementation())) { return new ClassDelegate(mockedClassDelegatesMapping.get(serviceTask.getImplementation()), createFieldDeclarations(serviceTask.getFieldExtensions())); } return wrappedActivityBehaviorFactory.createClassDelegateServiceTask(serviceTask); }
@Override protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception { ServiceTask serviceTask = (ServiceTask) element; if (ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(serviceTask.getImplementationType())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_CLASS, serviceTask.getImplementation(), xtw); } else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equals(serviceTask.getImplementationType())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_EXPRESSION, serviceTask.getImplementation(), xtw); } else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equals(serviceTask.getImplementationType())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_DELEGATEEXPRESSION, serviceTask.getImplementation(), xtw); } if (StringUtils.isNotEmpty(serviceTask.getResultVariableName())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_RESULTVARIABLE, serviceTask.getResultVariableName(), xtw); } if (StringUtils.isNotEmpty(serviceTask.getType())) { writeQualifiedAttribute(ATTRIBUTE_TYPE, serviceTask.getType(), xtw); } if (StringUtils.isNotEmpty(serviceTask.getExtensionId())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_EXTENSIONID, serviceTask.getExtensionId(), xtw); } if (StringUtils.isNotEmpty(serviceTask.getSkipExpression())) { writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_SKIP_EXPRESSION, serviceTask.getSkipExpression(), xtw); } }
public ServiceTaskDelegateExpressionActivityBehavior createServiceTaskDelegateExpressionActivityBehavior(ServiceTask serviceTask) { Expression delegateExpression = expressionManager.createExpression(serviceTask.getImplementation()); return createServiceTaskBehavior(serviceTask, delegateExpression); }
propertiesNode.put(PROPERTY_SERVICETASK_CLASS, serviceTask.getImplementation()); } else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equals(serviceTask.getImplementationType())) { propertiesNode.put(PROPERTY_SERVICETASK_EXPRESSION, serviceTask.getImplementation()); } else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equals(serviceTask.getImplementationType())) { propertiesNode.put(PROPERTY_SERVICETASK_DELEGATE_EXPRESSION, serviceTask.getImplementation());
private ClassDelegate createNoOpServiceTask(ServiceTask serviceTask) { List<FieldDeclaration> fieldDeclarations = new ArrayList<FieldDeclaration>(); fieldDeclarations.add(new FieldDeclaration("name", Expression.class.getName(), new FixedValue(serviceTask.getImplementation()))); return new ClassDelegate(NoOpServiceTask.class, fieldDeclarations); }
public ServiceTaskExpressionActivityBehavior createServiceTaskExpressionActivityBehavior(ServiceTask serviceTask) { Expression expression = expressionManager.createExpression(serviceTask.getImplementation()); return new ServiceTaskExpressionActivityBehavior(serviceTask.getId(), expression, getSkipExpressionFromServiceTask(serviceTask), serviceTask.getResultVariableName()); }
public ClassDelegate createClassDelegateServiceTask(ServiceTask serviceTask) { return classDelegateFactory.create(serviceTask.getId(), serviceTask.getImplementation(), createFieldDeclarations(serviceTask.getFieldExtensions()), getSkipExpressionFromServiceTask(serviceTask), serviceTask.getMapExceptions()); }
IntegrationContext context; String implementation = ((ServiceTask) execution.getCurrentFlowElement()).getImplementation(); List<VariableDefinition> outBoundVariableDefinitions = null; if(connectorActionDefinitionFinder != null) {
private IntegrationContextImpl buildFromExecution(DelegateExecution execution, ActionDefinition actionDefinition) { IntegrationContextImpl integrationContext = new IntegrationContextImpl(); integrationContext.setProcessInstanceId(execution.getProcessInstanceId()); integrationContext.setProcessDefinitionId(execution.getProcessDefinitionId()); integrationContext.setActivityElementId(execution.getCurrentActivityId()); integrationContext.setBusinessKey(execution.getProcessInstanceBusinessKey()); if(ExecutionEntity.class.isInstance(execution)) { ExecutionEntity processInstance = ExecutionEntity.class.cast(execution) .getProcessInstance(); if(processInstance != null) { integrationContext.setProcessDefinitionKey(processInstance.getProcessDefinitionKey()); integrationContext.setProcessDefinitionVersion(processInstance.getProcessDefinitionVersion()); integrationContext.setParentProcessInstanceId(processInstance.getParentProcessInstanceId()); } } String implementation = ((ServiceTask) execution.getCurrentFlowElement()).getImplementation(); integrationContext.setConnectorType(implementation); integrationContext.setInBoundVariables(buildInBoundVariables( actionDefinition, execution)); return integrationContext; }
@Override public ClassDelegate createClassDelegateServiceTask(ServiceTask serviceTask) { if (allServiceTasksNoOp || noOpServiceTaskIds.contains(serviceTask.getId()) || noOpServiceTaskClassNames.contains(serviceTask.getImplementation())) { return createNoOpServiceTask(serviceTask); } else if (serviceTask.getImplementation() != null && mockedClassDelegatesMapping.containsKey(serviceTask.getImplementation())) { return new ClassDelegate(mockedClassDelegatesMapping.get(serviceTask.getImplementation()), createFieldDeclarations(serviceTask.getFieldExtensions())); } return wrappedActivityBehaviorFactory.createClassDelegateServiceTask(serviceTask); }
private ClassDelegate createNoOpServiceTask(ServiceTask serviceTask) { List<FieldDeclaration> fieldDeclarations = new ArrayList<FieldDeclaration>(); fieldDeclarations.add(new FieldDeclaration("name", Expression.class.getName(), new FixedValue(serviceTask.getImplementation()))); return new ClassDelegate(NoOpServiceTask.class, fieldDeclarations); }
protected void addServiceTask(ServiceTask serviceTask) { Node serviceTaskNode = createNode(serviceTask); serviceTaskNode.setProperty("type", Constants.TYPE_SERVICE_TASK); serviceTaskNode.setProperty("class", serviceTask.getImplementation()); }
public ServiceTaskExpressionActivityBehavior createServiceTaskExpressionActivityBehavior(ServiceTask serviceTask) { Expression expression = expressionManager.createExpression(serviceTask.getImplementation()); return new ServiceTaskExpressionActivityBehavior(expression, serviceTask.getResultVariableName()); }
public ServiceTaskDelegateExpressionActivityBehavior createServiceTaskDelegateExpressionActivityBehavior(ServiceTask serviceTask) { Expression delegateExpression = expressionManager.createExpression(serviceTask.getImplementation()); return new ServiceTaskDelegateExpressionActivityBehavior(delegateExpression, createFieldDeclarations(serviceTask.getFieldExtensions())); }
public ServiceTaskExpressionActivityBehavior createServiceTaskExpressionActivityBehavior(ServiceTask serviceTask) { Expression expression = expressionManager.createExpression(serviceTask.getImplementation()); return new ServiceTaskExpressionActivityBehavior(serviceTask.getId(), expression, getSkipExpressionFromServiceTask(serviceTask), serviceTask.getResultVariableName()); }
public ClassDelegate createClassDelegateServiceTask(ServiceTask serviceTask) { return classDelegateFactory.create(serviceTask.getId(), serviceTask.getImplementation(), createFieldDeclarations(serviceTask.getFieldExtensions()), getSkipExpressionFromServiceTask(serviceTask), serviceTask.getMapExceptions()); }
public ServiceTaskDelegateExpressionActivityBehavior createServiceTaskDelegateExpressionActivityBehavior(ServiceTask serviceTask) { Expression delegateExpression = expressionManager.createExpression(serviceTask.getImplementation()); return new ServiceTaskDelegateExpressionActivityBehavior(serviceTask.getId(), delegateExpression, getSkipExpressionFromServiceTask(serviceTask), createFieldDeclarations(serviceTask.getFieldExtensions())); }
private IntegrationContextImpl buildFromExecution(DelegateExecution execution) { IntegrationContextImpl integrationContext = new IntegrationContextImpl(); integrationContext.setProcessInstanceId(execution.getProcessInstanceId()); integrationContext.setProcessDefinitionId(execution.getProcessDefinitionId()); integrationContext.setActivityElementId(execution.getCurrentActivityId()); integrationContext.setConnectorType(((ServiceTask) execution.getCurrentFlowElement()).getImplementation()); integrationContext.setInBoundVariables(execution.getVariables()); return integrationContext; } }