Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Event


      String xmlString = ConfigUtil.toXmlDump(config.getConfig("process"));
      processDefinition = ProcessDefinition.parseXmlString(xmlString);
     
      if (engine.isTrace()) {
        log().setTrace(true);
        Event enterEvent = new Event(Event.EVENTTYPE_NODE_ENTER);
        enterEvent.addAction(new Action() {
            public void execute(ExecutionContext executionContext) throws Exception {
              log().t("enter",executionContext.getNode().getName());
            }
        });
        processDefinition.addEvent(enterEvent);
        Event leaveEvent = new Event(Event.EVENTTYPE_NODE_LEAVE);
        leaveEvent.addAction(new Action() {
            public void execute(ExecutionContext executionContext) throws Exception {
              log().t("leave",executionContext.getNode().getName());
            }
        });
        processDefinition.addEvent(leaveEvent);
View Full Code Here


    String notificationsText = taskElement.attributeValue("notify");
    if (notificationsText != null
        && ("true".equalsIgnoreCase(notificationsText) || "on".equalsIgnoreCase(notificationsText) || "yes".equalsIgnoreCase(notificationsText)))
    {
      String notificationEvent = Event.EVENTTYPE_TASK_ASSIGN;
      Event event = task.getEvent(notificationEvent);
      if (event == null)
      {
        event = new Event(notificationEvent);
        task.addEvent(event);
      }
      Delegation delegation = createMailDelegation(notificationEvent, null, null, null, null);
      Action action = new Action(delegation);
      action.setProcessDefinition(processDefinition);
      action.setName(task.getName());
      event.addAction(action);
    }

    // task controller
    Element taskControllerElement = taskElement.element("controller");
    if (taskControllerElement != null)
View Full Code Here

    {
      Element eventElement = (Element)iter.next();
      String eventType = eventElement.attributeValue("type");
      if (!graphElement.hasEvent(eventType))
      {
        graphElement.addEvent(new Event(eventType));
      }
      readActions(eventElement, graphElement, eventType);
    }
  }
View Full Code Here

    }
  }

  protected void addAction(GraphElement graphElement, String eventType, Action action)
  {
    Event event = graphElement.getEvent(eventType);
    if (event == null)
    {
      event = new Event(eventType);
      graphElement.addEvent(event);
    }
    event.addAction(action);
  }
View Full Code Here

      "</process-definition>"
    );
   
    processDefinition = saveAndReload(processDefinition);
    Task task = processDefinition.getTaskMgmtDefinition().getTask("wash car");
    Event event = task.getEvent("task-create");
    assertNotNull(event);
    assertSame(task, event.getGraphElement());
  }
View Full Code Here

      "  </node>" +
      "</process-definition>");

    processDefinition = saveAndReload(processDefinition);

    Event event = processDefinition.getNode("n").getEvent("node-enter");
    Action action = processDefinition.getAction("a");
    assertSame(event, action.getEvent());
  }
View Full Code Here

      "  </event>" +
      "</process-definition>"
    );
  
    Event event = processDefinition.getEvent("process-start");
    assertEquals(3, event.getActions().size());
    assertEquals("one", ((Action)event.getActions().get(0)).getActionDelegation().getClassName());
    assertEquals("two", ((Action)event.getActions().get(1)).getActionDelegation().getClassName());
    assertEquals("three", ((Action)event.getActions().get(2)).getActionDelegation().getClassName());
   
  }
View Full Code Here

      "  </state>\n" +
      "</process-definition>"
    );
   
    Node node = processDefinition.getNode("a");
    Event event = node.getEvent("node-enter");
    Action action = (Action) event.getActions().iterator().next();
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertEquals("org.foo.Burps", instantiatableDelegate.getClassName());
    assertEquals("constructor", instantiatableDelegate.getConfigType());
    assertTrue(instantiatableDelegate.getConfiguration().indexOf("this text should be passed in the constructor")!=-1 );
  }
View Full Code Here

    );
   
    Node node = processDefinition.getNode("a");
    assertEquals( 1, node.getLeavingTransitionsMap().size() );
    Transition transition = node.getDefaultLeavingTransition();
    Event event = transition.getEvent(Event.EVENTTYPE_TRANSITION);
    Action action = (Action) event.getActions().iterator().next();
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertEquals("org.foo.Burps", instantiatableDelegate.getClassName());
  }
View Full Code Here

    fail("XML did not pass validation as expected:\n" + je.toString());
  }
   
    Node node = processDefinition.getNode("a");
    Transition transition = node.getDefaultLeavingTransition();
    Event event = transition.getEvent(Event.EVENTTYPE_TRANSITION);
    Action transitionAction = (Action) event.getActions().iterator().next();
   
    Action processAction = processDefinition.getAction("scratch");
    assertEquals("scratch", processAction.getName());
    assertSame(processAction, transitionAction.getReferencedAction());
   
View Full Code Here

TOP

Related Classes of org.jbpm.graph.def.Event

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.