Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Action


  protected void onTearDown() throws Exception {
    super.onTearDown();
  }

  public void testRetrievalFromSpringContext() throws Exception {
    Action action = processDefinition.getAction("myAction");
    ActionHandler delegate = (ActionHandler) action.getActionDelegation().getInstance();

    // create the context and pass it on to the action
    ProcessInstance instance = processDefinition.createProcessInstance();
    // we have to use transient variables or otherwise HB will get in the way
    instance.getContextInstance().setTransientVariable(DummyActionHandler.TEST_LABEL,
View Full Code Here


    assertTrue(springSession.isOpen());
    log.debug("end testJbpmCloseSession");
  }

  public void testJbpmHandler() throws Exception {
    Action action = processDefinition.getAction("myAction");
    ActionHandler delegate = (ActionHandler) action.getActionDelegation().getInstance();

    // create the context and pass it on to the action
    ProcessInstance instance = processDefinition.createProcessInstance();
    // we have to use transient variables or otherwise HB will get in the way
    instance.getContextInstance().setTransientVariable(DummyActionHandler.TEST_LABEL,
View Full Code Here

      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

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

      name = generateTimerName();

    CreateTimerAction createTimerAction = instantiateCreateTimerAction();
    createTimerAction.read(timerElement, this);
    createTimerAction.setTimerName(name);
    Action action = null;
    if ("timer".equals(timerElement.getName()))
    {
      action = readSingleAction(timerElement);
    }
    else
    {
      Delegation delegation = createMailDelegation("task-reminder", null, null, null, null);
      action = new Action(delegation);
    }
    createTimerAction.setTimerAction(action);
    addAction(task, Event.EVENTTYPE_TASK_CREATE, createTimerAction);

    // read the cancel-event types
View Full Code Here

    {
      Element actionElement = (Element)nodeElementIter.next();
      String actionName = actionElement.getName();
      if (ActionTypes.hasActionName(actionName))
      {
        Action action = createAction(actionElement);
        if ((graphElement != null) && (eventType != null))
        {
          // add the action to the event
          addAction(graphElement, eventType, action);
        }
View Full Code Here

    event.addAction(action);
  }

  public Action readSingleAction(Element nodeElement)
  {
    Action action = null;
    // search for the first action element in the node
    Iterator<?> iter = nodeElement.elementIterator();
    while (iter.hasNext() && (action == null))
    {
      Element candidate = (Element)iter.next();
View Full Code Here

  }

  public Action createAction(Element actionElement)
  {
    // create a new instance of the action
    Action action = null;
    String actionName = actionElement.getName();
    Class<? extends Action> actionType = ActionTypes.getActionType(actionName);
    try
    {
      action = actionType.newInstance();
View Full Code Here

    while (iter.hasNext())
    {
      Element childElement = (Element)iter.next();
      if (ActionTypes.hasActionName(childElement.getName()))
      {
        Action action = createAction(childElement);
        exceptionHandler.addAction(action);
      }
    }
  }
View Full Code Here

  public void resolveActionReferences()
  {
    for (Object[] unresolvedActionReference : unresolvedActionReferences)
    {
      Element actionElement = (Element)unresolvedActionReference[0];
      Action action = (Action)unresolvedActionReference[1];
      String referencedActionName = actionElement.attributeValue("ref-name");
      Action referencedAction = processDefinition.getAction(referencedActionName);
      if (referencedAction == null)
      {
        addWarning("couldn't resolve action reference in " + actionElement.asXML());
      }
      action.setReferencedAction(referencedAction);
View Full Code Here

TOP

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

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.