Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Event


    * @param type one of: "process-validations", "update-model-values",
    *                     "invoke-application", "render-response"
    */
   public void processEvents(String type)
   {
      Event event = getNode().getEvent(type);
      if (event!=null)
      {
         for ( Action action: (List<Action>) event.getActions() )
         {
            try
            {
               action.execute( ExecutionContext.currentExecutionContext() );
            }
View Full Code Here


  public boolean hasEvents() {
    return (events != null) && (events.size() > 0);
  }

  public Event getEvent(String eventType) {
    Event event = null;
    if (events != null) {
      event = (Event) events.get(eventType);
    }
    return event;
  }
View Full Code Here

    events.put(event.getEventType(), event);
    return event;
  }

  public Event removeEvent(Event event) {
    Event removedEvent = null;
    if (event == null) {
      throw new IllegalArgumentException(
        "can't remove a null event from a graph element");
    }
    if (event.getEventType() == null) {
View Full Code Here

    public boolean hasEvents() {
        return (events != null) && (events.size() > 0);
    }

    public Event getEvent(String eventType) {
        Event event = null;
        if (events != null) {
            event = (Event) events.get(eventType);
        }
        return event;
    }
View Full Code Here

        events.put(event.getEventType(), event);
        return event;
    }

    public Event removeEvent(Event event) {
        Event removedEvent = null;
        if (event == null) {
            throw new IllegalArgumentException(
                "can't remove a null event from a graph element");
        }
        if (event.getEventType() == null) {
View Full Code Here

        if (actorId == null) {
            actorId = assignTask(task, nodeInstance);
        }
        workItem.setParameter("ActorId", actorId);
    }
    Event event = task.getEvent(Event.EVENTTYPE_TASK_CREATE);
        if (event != null) {
            // TODO this doesn't take event handlers of task itself
            // into account
          JpdlExecutionContext context = nodeInstance.new JpdlExecutionContext();
          context.setTask(task);
          nodeInstance.executeActions(event.getActions(), context);
        }
    return workItem;
  }
View Full Code Here

        }
    }
  }
 
  private static String assignTask(Task task, JpdlNodeInstance nodeInstance) {
      Event event = task.getEvent(Event.EVENTTYPE_TASK_ASSIGN);
        if (event != null) {
          JpdlExecutionContext context = nodeInstance.new JpdlExecutionContext();
          context.setTask(task);
            nodeInstance.executeActions(event.getActions(), context);
        }
      if (task.getActorIdExpression() != null) {
            return resolveActor(task.getActorIdExpression(), nodeInstance);
      } else if (task.getSwimlane().getActorIdExpression() != null) {
          return resolveActor(task.getSwimlane().getActorIdExpression(), nodeInstance);
View Full Code Here

                        swimlaneContextInstance.setActorId(swimlaneName,
                              (String) workItem.getResult("ActorId"));
                    }
                }
            }
                  Event event = task.getEvent(Event.EVENTTYPE_TASK_END);
                  if (event != null) {
                    JpdlExecutionContext context = new JpdlExecutionContext();
                    context.setTask(task);
                      executeActions(event.getActions(), context);
                  }
                break;
        }
        }
            if (!hasBlockingWorkItems()) {
View Full Code Here

        + "' is not a leaving transition of node '" + this + "'");
    }
    removeEventListeners();
    fireEvent(Event.EVENTTYPE_NODE_LEAVE);
        ((NodeInstanceContainer) getNodeInstanceContainer()).removeNodeInstance(this);
        Event event = connection.getEvent(Event.EVENTTYPE_TRANSITION);
        if (event != null) {
            List<Action> actions = event.getActions();
            if (actions != null) {
                for (Action action: actions) {
                    try {
                        action.execute(new JpdlExecutionContext());
                    } catch (Exception exception) {
View Full Code Here

    public void fireEvent(String eventType) {
        fireEvent(eventType, new JpdlExecutionContext());
    }

  public void fireEvent(String eventType, ExecutionContext executionContext) {
    Event event = getJpdlNode().getEvent(eventType);
    if (event != null) {
        executeActions(event.getActions(), executionContext);
    }
    // TODO runtime actions?
  }
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.