org.activiti.engine.impl.bpmn.behavior.WebServiceActivityBehavior Java Examples

The following examples show how to use org.activiti.engine.impl.bpmn.behavior.WebServiceActivityBehavior. 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: SendTaskParseHandler.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
protected void executeParse(BpmnParse bpmnParse, SendTask sendTask) {

    if (StringUtils.isNotEmpty(sendTask.getType())) {
      
      if (sendTask.getType().equalsIgnoreCase("mail")) {
        sendTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createMailActivityBehavior(sendTask));
      } else if (sendTask.getType().equalsIgnoreCase("mule")) {
        sendTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createMuleActivityBehavior(sendTask));
      } else if (sendTask.getType().equalsIgnoreCase("camel")) {
        sendTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createCamelActivityBehavior(sendTask));
      } else if (sendTask.getType().equalsIgnoreCase("dmn")) {
        sendTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createDmnActivityBehavior(sendTask));
      }

    } else if (ImplementationType.IMPLEMENTATION_TYPE_WEBSERVICE.equalsIgnoreCase(sendTask.getImplementationType()) && StringUtils.isNotEmpty(sendTask.getOperationRef())) {

      WebServiceActivityBehavior webServiceActivityBehavior = bpmnParse.getActivityBehaviorFactory().createWebServiceActivityBehavior(sendTask);
      sendTask.setBehavior(webServiceActivityBehavior);
       
    } else {
      logger.warn("One of the attributes 'type' or 'operation' is mandatory on sendTask " + sendTask.getId());
    }
  }
 
Example #2
Source File: SendTaskParseHandler.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@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 #3
Source File: MessageImplicitDataOutputAssociation.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
@Override
public void evaluate(DelegateExecution execution) {
  MessageInstance message = (MessageInstance) execution.getVariable(WebServiceActivityBehavior.CURRENT_MESSAGE);
  if (message.getStructureInstance() instanceof FieldBaseStructureInstance) {
    FieldBaseStructureInstance structure = (FieldBaseStructureInstance) message.getStructureInstance();
    execution.setVariable(this.getTarget(), structure.getFieldValue(this.getSource()));
  }
}
 
Example #4
Source File: MessageImplicitDataInputAssociation.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
@Override
public void evaluate(DelegateExecution execution) {
  if (StringUtils.isNotEmpty(this.source)) {
    Object value = execution.getVariable(this.source);
    MessageInstance message = (MessageInstance) execution.getVariable(WebServiceActivityBehavior.CURRENT_MESSAGE);
    if (message.getStructureInstance() instanceof FieldBaseStructureInstance) {
      FieldBaseStructureInstance structure = (FieldBaseStructureInstance) message.getStructureInstance();
      structure.setFieldValue(this.target, value);
    }
  }
}
 
Example #5
Source File: TestActivityBehaviorFactory.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
public WebServiceActivityBehavior createWebServiceActivityBehavior(ServiceTask serviceTask, BpmnModel bpmnModel) {
    return wrappedActivityBehaviorFactory.createWebServiceActivityBehavior(serviceTask, bpmnModel);
}
 
Example #6
Source File: ActivityBehaviorFactoryDelegate.java    From openwebflow with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WebServiceActivityBehavior createWebServiceActivityBehavior(ServiceTask serviceTask)
{
	return _source.createWebServiceActivityBehavior(serviceTask);
}
 
Example #7
Source File: ActivityBehaviorFactoryDelegate.java    From openwebflow with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WebServiceActivityBehavior createWebServiceActivityBehavior(SendTask sendTask)
{
	return _source.createWebServiceActivityBehavior(sendTask);
}
 
Example #8
Source File: ServiceTaskParseHandler.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@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 #9
Source File: DefaultActivityBehaviorFactory.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
public WebServiceActivityBehavior createWebServiceActivityBehavior(SendTask sendTask, BpmnModel bpmnModel) {
    return new WebServiceActivityBehavior(bpmnModel);
}
 
Example #10
Source File: DefaultActivityBehaviorFactory.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
public WebServiceActivityBehavior createWebServiceActivityBehavior(ServiceTask serviceTask, BpmnModel bpmnModel) {
    return new WebServiceActivityBehavior(bpmnModel);
}
 
Example #11
Source File: TestActivityBehaviorFactory.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
@Override
public WebServiceActivityBehavior createWebServiceActivityBehavior(SendTask sendTask, BpmnModel bpmnModel) {
    return wrappedActivityBehaviorFactory.createWebServiceActivityBehavior(sendTask, bpmnModel);
}
 
Example #12
Source File: DefaultActivityBehaviorFactory.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public WebServiceActivityBehavior createWebServiceActivityBehavior(ServiceTask serviceTask) {
  return new WebServiceActivityBehavior();
}
 
Example #13
Source File: TestActivityBehaviorFactory.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
@Override
public WebServiceActivityBehavior createWebServiceActivityBehavior(SendTask sendTask) {
  return wrappedActivityBehaviorFactory.createWebServiceActivityBehavior(sendTask);
}
 
Example #14
Source File: TestActivityBehaviorFactory.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
@Override
public WebServiceActivityBehavior createWebServiceActivityBehavior(ServiceTask serviceTask) {
  return wrappedActivityBehaviorFactory.createWebServiceActivityBehavior(serviceTask);
}
 
Example #15
Source File: DefaultActivityBehaviorFactory.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public WebServiceActivityBehavior createWebServiceActivityBehavior(SendTask sendTask) {
  return new WebServiceActivityBehavior();
}
 
Example #16
Source File: ServiceTaskParseHandler.java    From activiti6-boot2 with Apache License 2.0 2 votes vote down vote up
protected void executeParse(BpmnParse bpmnParse, ServiceTask serviceTask) {

    // Email, Mule and Shell service tasks
    if (StringUtils.isNotEmpty(serviceTask.getType())) {

      if (serviceTask.getType().equalsIgnoreCase("mail")) {
        serviceTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createMailActivityBehavior(serviceTask));

      } else if (serviceTask.getType().equalsIgnoreCase("mule")) {
        serviceTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createMuleActivityBehavior(serviceTask));

      } else if (serviceTask.getType().equalsIgnoreCase("camel")) {
        serviceTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createCamelActivityBehavior(serviceTask));

      } else if (serviceTask.getType().equalsIgnoreCase("shell")) {
        serviceTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createShellActivityBehavior(serviceTask));
        
      } else if (serviceTask.getType().equalsIgnoreCase("dmn")) {
        serviceTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createDmnActivityBehavior(serviceTask));

      } else {
        logger.warn("Invalid service task type: '" + serviceTask.getType() + "' " + " for service task " + serviceTask.getId());
      }

      // activiti:class
    } else if (ImplementationType.IMPLEMENTATION_TYPE_CLASS.equalsIgnoreCase(serviceTask.getImplementationType())) {

      serviceTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createClassDelegateServiceTask(serviceTask));

      // activiti:delegateExpression
    } else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) {

      serviceTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createServiceTaskDelegateExpressionActivityBehavior(serviceTask));

      // activiti:expression
    } else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) {

      serviceTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createServiceTaskExpressionActivityBehavior(serviceTask));

      // Webservice
    } else if (ImplementationType.IMPLEMENTATION_TYPE_WEBSERVICE.equalsIgnoreCase(serviceTask.getImplementationType()) && StringUtils.isNotEmpty(serviceTask.getOperationRef())) {

      WebServiceActivityBehavior webServiceActivityBehavior = bpmnParse.getActivityBehaviorFactory().createWebServiceActivityBehavior(serviceTask);
      serviceTask.setBehavior(webServiceActivityBehavior);
      
    } else {
      logger.warn("One of the attributes 'class', 'delegateExpression', 'type', 'operation', or 'expression' is mandatory on serviceTask " + serviceTask.getId());
    }

  }
 
Example #17
Source File: ActivityBehaviorFactory.java    From flowable-engine with Apache License 2.0 votes vote down vote up
public abstract WebServiceActivityBehavior createWebServiceActivityBehavior(ServiceTask serviceTask, BpmnModel bpmnModel); 
Example #18
Source File: ActivityBehaviorFactory.java    From flowable-engine with Apache License 2.0 votes vote down vote up
public abstract WebServiceActivityBehavior createWebServiceActivityBehavior(SendTask sendTask, BpmnModel bpmnModel); 
Example #19
Source File: ActivityBehaviorFactory.java    From activiti6-boot2 with Apache License 2.0 votes vote down vote up
public abstract WebServiceActivityBehavior createWebServiceActivityBehavior(SendTask sendTask); 
Example #20
Source File: ActivityBehaviorFactory.java    From activiti6-boot2 with Apache License 2.0 votes vote down vote up
public abstract WebServiceActivityBehavior createWebServiceActivityBehavior(ServiceTask serviceTask);