Package org.activiti.engine.impl.bpmn.webservice

Examples of org.activiti.engine.impl.bpmn.webservice.MessageDefinition


    }
  }

  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);

    }
  }
View Full Code Here


      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);
View Full Code Here

    return results;
  }
 
  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;
  }
View Full Code Here

    return results;
  }
 
  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;
  }
View Full Code Here

    for (Element messageElement : rootElement.elements("message")) {
      String id = messageElement.attribute("id");
      String itemRef = this.resolveName(messageElement.attribute("itemRef"));
      String name = messageElement.attribute("name");
     
      MessageDefinition messageDefinition = new MessageDefinition(this.targetNamespace + ":" + id, name);
     
      if(itemRef != null) {
        if(!this.itemDefinitions.containsKey(itemRef)) {
            addError(itemRef + " does not exist", messageElement);         
        } else {
            ItemDefinition itemDefinition = this.itemDefinitions.get(itemRef);
            messageDefinition.setItemDefinition(itemDefinition);
        }
      }
      this.messages.put(messageDefinition.getId(), messageDefinition);
     
    }
  }
View Full Code Here

    if (!this.messages.containsKey(inMessageRef)) {
      addError(inMessageRef + " does not exist", inMessageRefElement);
      return null;
    } else {
      MessageDefinition inMessage = this.messages.get(inMessageRef);
      String id = operationElement.attribute("id");
      String name = operationElement.attribute("name");
      String implementationRef = this.resolveName(operationElement.attribute("implementationRef"));
      Operation operation = new Operation(this.targetNamespace + ":" + id, name, bpmnInterface, inMessage);
      operation.setImplementation(this.operationImplementations.get(implementationRef));

      Element outMessageRefElement = operationElement.element("outMessageRef");
      if (outMessageRefElement != null) {
        String outMessageRef = this.resolveName(outMessageRefElement.getText());
        if (this.messages.containsKey(outMessageRef)) {
          MessageDefinition outMessage = this.messages.get(outMessageRef);
          operation.setOutMessage(outMessage);
        }
      }

      operations.put(operation.getId(), operation);
View Full Code Here

  protected EventSubscriptionDeclaration parseMessageEventDefinition(Element messageEventDefinition) {
    String messageRef = messageEventDefinition.attribute("messageRef");
    if(messageRef == null) {
      addError("attribute 'messageRef' is required", messageEventDefinition);
    }
    MessageDefinition messageDefinition = messages.get(resolveName(messageRef));
    if(messageDefinition == null) {
      addError("Invalid 'messageRef': no message with id '"+messageRef+"' found.", messageEventDefinition);
    }
   
    return new EventSubscriptionDeclaration(messageDefinition.getName(), "message");
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.bpmn.webservice.MessageDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.