use of org.activiti.engine.impl.bpmn.webservice.Operation in project Activiti by Activiti.
the class BpmnParse method createOperations.
protected void createOperations() {
for (Interface interfaceObject : bpmnModel.getInterfaces()) {
BpmnInterface bpmnInterface = new BpmnInterface(interfaceObject.getId(), interfaceObject.getName());
bpmnInterface.setImplementation(this.interfaceImplementations.get(interfaceObject.getImplementationRef()));
for (org.activiti.bpmn.model.Operation operationObject : interfaceObject.getOperations()) {
if (this.messages.containsKey(operationObject.getInMessageRef())) {
MessageDefinition inMessage = this.messages.get(operationObject.getInMessageRef());
Operation operation = new Operation(operationObject.getId(), operationObject.getName(), bpmnInterface, inMessage);
operation.setImplementation(this.operationImplementations.get(operationObject.getImplementationRef()));
if (StringUtils.isNotEmpty(operationObject.getOutMessageRef())) {
if (this.messages.containsKey(operationObject.getOutMessageRef())) {
MessageDefinition outMessage = this.messages.get(operationObject.getOutMessageRef());
operation.setOutMessage(outMessage);
}
}
operations.put(operation.getId(), operation);
}
}
}
}
use of org.activiti.engine.impl.bpmn.webservice.Operation in project Activiti by Activiti.
the class SendTaskParseHandler method executeParse.
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())) {
if (!bpmnParse.getOperations().containsKey(sendTask.getOperationRef())) {
logger.warn(sendTask.getOperationRef() + " does not exist for sendTask " + sendTask.getId());
} else {
WebServiceActivityBehavior webServiceActivityBehavior = bpmnParse.getActivityBehaviorFactory().createWebServiceActivityBehavior(sendTask);
Operation operation = bpmnParse.getOperations().get(sendTask.getOperationRef());
webServiceActivityBehavior.setOperation(operation);
if (sendTask.getIoSpecification() != null) {
IOSpecification ioSpecification = createIOSpecification(bpmnParse, sendTask.getIoSpecification());
webServiceActivityBehavior.setIoSpecification(ioSpecification);
}
for (DataAssociation dataAssociationElement : sendTask.getDataInputAssociations()) {
AbstractDataAssociation dataAssociation = createDataInputAssociation(bpmnParse, dataAssociationElement);
webServiceActivityBehavior.addDataInputAssociation(dataAssociation);
}
for (DataAssociation dataAssociationElement : sendTask.getDataOutputAssociations()) {
AbstractDataAssociation dataAssociation = createDataOutputAssociation(bpmnParse, dataAssociationElement);
webServiceActivityBehavior.addDataOutputAssociation(dataAssociation);
}
activity.setActivityBehavior(webServiceActivityBehavior);
}
} else {
logger.warn("One of the attributes 'type' or 'operation' is mandatory on sendTask " + sendTask.getId());
}
}
Aggregations