Package org.drools.bpmn2

Examples of org.drools.bpmn2.SimpleBPMNProcessTest$TestWorkItemHandler


    }
   
    public void testMessageIntermediateThrow() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-IntermediateThrowEventMessage.xml");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler());
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("x", "MyValue");
        ProcessInstance processInstance = ksession.startProcess("MessageIntermediateEvent", params);
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
    }
View Full Code Here


//    }

    public void testServiceTask() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-ServiceProcess.xml");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new ServiceTaskHandler());
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("s", "john");
        WorkflowProcessInstance processInstance = (WorkflowProcessInstance)
            ksession.startProcess("ServiceProcess", params);
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
View Full Code Here

    super("http://bpmndi.org");
   
    addHandler("processDiagram", new ProcessDiagramHandler());
    addHandler("eventShape", new EventShapeHandler());
        addHandler("gatewayShape", new GatewayShapeHandler());
        addHandler("activityShape", new ActivityShapeHandler());
        addHandler("sequenceFlowConnector", new SequenceFlowConnectorHandler());
  }
View Full Code Here

 
  public BPMNDISemanticModule() {
    super("http://bpmndi.org");
   
    addHandler("processDiagram", new ProcessDiagramHandler());
    addHandler("eventShape", new EventShapeHandler());
        addHandler("gatewayShape", new GatewayShapeHandler());
        addHandler("activityShape", new ActivityShapeHandler());
        addHandler("sequenceFlowConnector", new SequenceFlowConnectorHandler());
  }
View Full Code Here

  public BPMNDISemanticModule() {
    super("http://bpmndi.org");
   
    addHandler("processDiagram", new ProcessDiagramHandler());
    addHandler("eventShape", new EventShapeHandler());
        addHandler("gatewayShape", new GatewayShapeHandler());
        addHandler("activityShape", new ActivityShapeHandler());
        addHandler("sequenceFlowConnector", new SequenceFlowConnectorHandler());
  }
View Full Code Here

public class BPMNDISemanticModule extends DefaultSemanticModule {
 
  public BPMNDISemanticModule() {
    super("http://bpmndi.org");
   
    addHandler("processDiagram", new ProcessDiagramHandler());
    addHandler("eventShape", new EventShapeHandler());
        addHandler("gatewayShape", new GatewayShapeHandler());
        addHandler("activityShape", new ActivityShapeHandler());
        addHandler("sequenceFlowConnector", new SequenceFlowConnectorHandler());
  }
View Full Code Here

        NodeInfo nodeInfo = new NodeInfo(id, eventRef);
        nodeInfo.setX(new Float(x).intValue());
        nodeInfo.setY(new Float(y).intValue());
        nodeInfo.setWidth(new Float(width).intValue());
        nodeInfo.setHeight(new Float(height).intValue());
        ProcessInfo processInfo = (ProcessInfo) parser.getParent();
        processInfo.addNodeInfo(nodeInfo);
        return nodeInfo;
    }
View Full Code Here

        ConnectionInfo info = new ConnectionInfo(sequenceFlowRef);
        final String sourceRef = attrs.getValue("sourceRef");
        final String targetRef = attrs.getValue("targetRef");
        info.setSourceRef(sourceRef);
        info.setTargetRef(targetRef);
        ProcessInfo processInfo = (ProcessInfo) parser.getParent();
        processInfo.addConnectionInfo(info);
        return info;
    }
View Full Code Here

   
    addHandler("processDiagram", new ProcessDiagramHandler());
    addHandler("eventShape", new EventShapeHandler());
        addHandler("gatewayShape", new GatewayShapeHandler());
        addHandler("activityShape", new ActivityShapeHandler());
        addHandler("sequenceFlowConnector", new SequenceFlowConnectorHandler());
  }
View Full Code Here

                    "Could not find node " + nodeInfo.getNodeRef());
            }
        }
        for (ConnectionInfo connectionInfo: processInfo.getConnectionInfos()) {
            if (connectionInfo.getBendpoints() != null) {
                NodeInfo sourceNodeInfo = processInfo.getNodeInfo(connectionInfo.getSourceRef());
                if (sourceNodeInfo == null) {
                    throw new IllegalArgumentException(
                        "Could not find sourceRef for connection info: " + connectionInfo.getSourceRef());
                }
                NodeInfo targetNodeInfo = processInfo.getNodeInfo(connectionInfo.getTargetRef());
                if (targetNodeInfo == null) {
                    throw new IllegalArgumentException(
                        "Could not find sourceRef for connection info: " + connectionInfo.getTargetRef());
                }
                Node sourceNode = null;
                for (Node node: process.getNodes()) {
                    String id = (String) XmlBPMNProcessDumper.getUniqueNodeId(node);
                    if (sourceNodeInfo.getNodeRef().equals(id)) {
                        sourceNode = node;
                        break;
                    }
                }
                if (sourceNode == null) {
                    throw new IllegalArgumentException(
                        "Could not find node for nodeRef: " + sourceNodeInfo.getNodeRef());
                }
                boolean found = false;
                for (List<Connection> outgoingConnections: sourceNode.getOutgoingConnections().values()) {
                    for (Connection connection: outgoingConnections) {
                        if (targetNodeInfo.getNodeRef().equals(XmlBPMNProcessDumper.getUniqueNodeId(connection.getTo()))) {
                            ((ConnectionImpl) connection).setMetaData(
                                "bendpoints", connectionInfo.getBendpoints());
                            found = true;
                            break;
                        }
                    }
                    if (found) {
                        break;
                    }
                }
                if (!found) {
                    throw new IllegalArgumentException(
                        "Could not find connection from  " + sourceNodeInfo.getNodeRef() +
                        " to " + targetNodeInfo.getNodeRef());
                }
            }
        }
        return processInfo;
    }
View Full Code Here

TOP

Related Classes of org.drools.bpmn2.SimpleBPMNProcessTest$TestWorkItemHandler

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.