Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Event


   
    // now create a reference to it from event node-enter on state 'a'
    State state = (State) processDefinition.addNode( new State() );
    Action refAction = new Action();
    refAction.setReferencedAction(action);
    state.addEvent(new Event(Event.EVENTTYPE_NODE_ENTER)).addAction(refAction);
   
    AbstractXmlTestCase.toXmlAndParse( processDefinition, "/process-definition/state[1]/event[1]/action[1]" );
  }
View Full Code Here


 
  static List sequence = new ArrayList();
  public static class SequenceRecorder implements ActionHandler {
    private static final long serialVersionUID = 1L;
    public void execute(ExecutionContext executionContext) throws Exception {
      Event event = executionContext.getEvent();
      sequence.add(event.getGraphElement().getName()+" "+event.getEventType());
    }
View Full Code Here

    Iterator iter = parentElement.elementIterator("event");
    while (iter.hasNext()) {
      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

      "  <event type='process-start' />" +
      "  <action name='gotocheetahs' class='com.secret.LetsDoItSneeky'/>" +
      "</process-definition>" );
    graphSession.saveProcessDefinition(processDefinition);
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Event event = processInstance.getProcessDefinition().getEvent("process-start");
    Action action = processInstance.getProcessDefinition().getAction("gotocheetahs");
    processInstance.addRuntimeAction(new RuntimeAction(event, action));

    processInstance = saveAndReload(processInstance);

    RuntimeAction runtimeAction = (RuntimeAction) processInstance.getRuntimeActions().get(0);
    event = processInstance.getProcessDefinition().getEvent("process-start");
    assertEquals(event.getGraphElement(), runtimeAction.getGraphElement());
    assertEquals(event.getEventType(), runtimeAction.getEventType());
  }
View Full Code Here

      "  <event type='process-start' />" +
      "  <action name='gotocheetahs' class='com.secret.LetsDoItSneeky'/>" +
      "</process-definition>" );
    graphSession.saveProcessDefinition(processDefinition);
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Event event = processInstance.getProcessDefinition().getEvent("process-start");
    Action action = processInstance.getProcessDefinition().getAction("gotocheetahs");
    processInstance.addRuntimeAction(new RuntimeAction(event, action));

    processInstance = saveAndReload(processInstance);
View Full Code Here

    // no action was added on enter of node a yet...
    assertEquals(0,count);

    // add the runtime action on entrance of node a
    Action plusplusAction = processDefinition.getAction("plusplus");
    Event enterB = new Event(Event.EVENTTYPE_NODE_ENTER);
    processDefinition.getNode("a").addEvent(enterB);
    RuntimeAction runtimeAction = new RuntimeAction(enterB,plusplusAction);
    processInstance.addRuntimeAction(runtimeAction);

    // loop back to node a, firing event node-enter for the second time
View Full Code Here

             ||  "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);
      event.addAction(action);
    }

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

    Iterator iter = parentElement.elementIterator("event");
    while (iter.hasNext()) {
      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

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.