Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Action


  public void saveJob(Job job) {
    session.saveOrUpdate(job);
    if (job instanceof Timer) {
      Timer timer = (Timer) job;
      Action action = timer.getAction();
      if ( (action!=null)
           && (! session.contains(action))
         ) {
        log.debug("cascading timer save to timer action");
        session.save(action);
View Full Code Here


            } else if (node instanceof org.drools.jpdl.core.node.JpdlNode) {
                generatedConnections += suggestSplitNode(node);
                generatedConnections += suggestJoinNode(node);
                System.out.println("<actionNode id=\"" + node.getId() + "\" name=\"" + node.getName() + "\">");
                System.out.println("    <action type=\"expression\" dialect=\"java\" >");
                Action action = ((org.drools.jpdl.core.node.JpdlNode) node).getAction();
                if (action != null) {
                    Delegation delegation = action.getActionDelegation();
                    if (delegation != null) {
                        // System.out.println("Introspect = "+delegation.getClassName());
                        // System.out.println("replaced"+delegation.getClassName().replace(".","/"));
                        // Resource resource = ResourceFactory.newInputStreamResource(EpdlWriter.class.getResourceAsStream(delegation.getClassName().replace(".","/")));
                        // System.out.println(""+resource);
View Full Code Here

    fireEvent(Event.EVENTTYPE_NODE_ENTER);
    execute(from, type);
  }
 
  public void execute(NodeInstance from, String type) {
      Action action = getAction();
        if (action != null) {
            try {
                action.execute(new JpdlExecutionContext());
            } catch (Exception exception) {
                raiseException(exception);
            }
        } else {
            leave();
View Full Code Here

    }
   
    public void signalEvent(String type, Object event) {
      if ("timerTriggered".equals(type)) {
        TimerInstance timer = (TimerInstance) event;
            Action action = timerActions.get(timer.getId());
            if (action != null) {
                executeAction(action, new JpdlExecutionContext());
            }
      }
    }
View Full Code Here

    String actors = element.attributeValue("actors");
    String to = element.attributeValue("to");
    String subject = jpdlReader.getProperty("subject", element);
    String text = jpdlReader.getProperty("text", element);
    Delegation delegation = jpdlReader.createMailDelegation(template, actors, to, subject, text);
    this.action = new Action(delegation);
  }
View Full Code Here

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

    if (name==null) name = "timer-for-task-"+task.getId();
   
    CreateTimerAction createTimerAction = new CreateTimerAction();
    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

    Iterator nodeElementIter = eventElement.elementIterator();
    while (nodeElementIter.hasNext()) {
      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();
      if (ActionTypes.hasActionName(candidate.getName())) {
View Full Code Here

    return action;
  }

  public Action createAction(Element actionElement) {
    // create a new instance of the action
    Action action = null;
    String actionName = actionElement.getName();
    Class actionType = ActionTypes.getActionType(actionName);
    try {
      action = (Action) actionType.newInstance();
    } catch (Exception e) {
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.