Search in sources :

Example 1 with MessageDefinition

use of org.activiti.engine.impl.bpmn.webservice.MessageDefinition in project Activiti by Activiti.

the class BpmnParse method createMessages.

public void createMessages() {
    for (Message messageElement : bpmnModel.getMessages()) {
        MessageDefinition messageDefinition = new MessageDefinition(messageElement.getId(), name);
        if (StringUtils.isNotEmpty(messageElement.getItemRef())) {
            if (this.itemDefinitions.containsKey(messageElement.getItemRef())) {
                ItemDefinition itemDefinition = this.itemDefinitions.get(messageElement.getItemRef());
                messageDefinition.setItemDefinition(itemDefinition);
            }
        }
        this.messages.put(messageDefinition.getId(), messageDefinition);
    }
}
Also used : MessageDefinition(org.activiti.engine.impl.bpmn.webservice.MessageDefinition) Message(org.activiti.bpmn.model.Message) ItemDefinition(org.activiti.engine.impl.bpmn.data.ItemDefinition)

Example 2 with MessageDefinition

use of org.activiti.engine.impl.bpmn.webservice.MessageDefinition 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);
            }
        }
    }
}
Also used : MessageDefinition(org.activiti.engine.impl.bpmn.webservice.MessageDefinition) Operation(org.activiti.engine.impl.bpmn.webservice.Operation) BpmnInterface(org.activiti.engine.impl.bpmn.webservice.BpmnInterface) Interface(org.activiti.bpmn.model.Interface) BpmnInterface(org.activiti.engine.impl.bpmn.webservice.BpmnInterface)

Example 3 with MessageDefinition

use of org.activiti.engine.impl.bpmn.webservice.MessageDefinition in project Activiti by Activiti.

the class WSOperation method createResponseMessage.

private MessageInstance createResponseMessage(Object[] results, Operation operation) {
    MessageInstance message = null;
    MessageDefinition outMessage = operation.getOutMessage();
    if (outMessage != null) {
        message = outMessage.createInstance();
        message.getStructureInstance().loadFrom(results);
    }
    return message;
}
Also used : MessageInstance(org.activiti.engine.impl.bpmn.webservice.MessageInstance) MessageDefinition(org.activiti.engine.impl.bpmn.webservice.MessageDefinition)

Aggregations

MessageDefinition (org.activiti.engine.impl.bpmn.webservice.MessageDefinition)3 Interface (org.activiti.bpmn.model.Interface)1 Message (org.activiti.bpmn.model.Message)1 ItemDefinition (org.activiti.engine.impl.bpmn.data.ItemDefinition)1 BpmnInterface (org.activiti.engine.impl.bpmn.webservice.BpmnInterface)1 MessageInstance (org.activiti.engine.impl.bpmn.webservice.MessageInstance)1 Operation (org.activiti.engine.impl.bpmn.webservice.Operation)1