Package org.jbpm.graph.action

Examples of org.jbpm.graph.action.Script


  public void read(Element forkElement, JpdlXmlReader jpdlReader) {
    Element scriptElement = forkElement.element("script");
    if (scriptElement!=null) {
      log.warn("KNOWN LIMITATION: the script in a fork is not persisted.  script in fork might be removed in later versions of jPDL");
      script = new Script();
      script.read(scriptElement, jpdlReader);
    }
  }
View Full Code Here


                   "b --> syncmerge",
                   "c --> syncmerge",
                   "syncmerge --> end"});
   
    // create the script
    Script script = new Script();
    script.addVariableAccess(new VariableAccess("transitionNames","write",null));
    script.setExpression(
      "transitionNames = new ArrayList();" +
      "if ( scenario == 1 ) {" +
      "  transitionNames.add( \"to b\" );" +
      "} else if ( scenario == 2 ) {" +
      "  transitionNames.add( \"to c\" );" +
View Full Code Here

      "    e = m * Math.pow(c,2);" +
      "  </script>" +
      "</process-definition>"
    );
   
    Script script = (Script) processDefinition.getAction("s");
    assertEquals("e = m * Math.pow(c,2);", script.getExpression() );
  }
View Full Code Here

      "  </node>" +
      "</process-definition>"
    );
   
    Node node = processDefinition.getNode("a");
    Script script = (Script) node.getAction();
   
    assertEquals( 3, script.getVariableAccesses().size() );
    assertEquals("e = m * Math.pow(c,2);", script.getExpression() );
  }
View Full Code Here

      "  </script>" +
      "</process-definition>");
   
    processDefinition = saveAndReload(processDefinition);
   
    Script script = (Script) processDefinition.getAction("s");
    assertNotNull(script);
    assertEquals(4, script.getVariableAccesses().size() );
    assertEquals("e = m * Math.pow(c,2);", script.getExpression() );
  }
View Full Code Here

  public void read(Element forkElement, JpdlXmlReader jpdlReader) {
    Element scriptElement = forkElement.element("script");
    if (scriptElement!=null) {
      log.warn("KNOWN LIMITATION: the script in a fork is not persisted.  script in fork might be removed in later versions of jPDL");
      script = new Script();
      script.read(scriptElement, jpdlReader);
    }
  }
View Full Code Here

  public void read(Element forkElement, JpdlXmlReader jpdlReader) {
    Element scriptElement = forkElement.element("script");
    if (scriptElement!=null) {
      log.warn("KNOWN LIMITATION: the script in a fork is not persisted.  script in fork might be removed in later versions of jPDL");
      script = new Script();
      script.read(scriptElement, jpdlReader);
    }
  }
View Full Code Here

        return (Fork) getNode();
    }

    public void execute(NodeInstance from, String type) {
        Collection<String> transitionNames = null;
        Script script = getFork().getScript();
        if (script == null) {
            transitionNames = getNode().getOutgoingConnections().keySet();
        } else {
            Map<String, Object> outputMap = null;
            try {
                outputMap = script.eval(new JpdlExecutionContext());
            } catch (Exception e) {
                this.raiseException(e);
            }
            if (outputMap.size() == 1) {
                Object result = outputMap.values().iterator().next();
View Full Code Here

TOP

Related Classes of org.jbpm.graph.action.Script

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.