Package org.jbpm.instantiation

Examples of org.jbpm.instantiation.Delegation


  public void testWriteProcessDefinitionAction() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Event event = new Event("node-enter");
    processDefinition.addEvent(event);
    event.addAction(new Action(new Delegation("one")));
    event.addAction(new Action(new Delegation("two")));
    event.addAction(new Action(new Delegation("three")));
   
    Element eventElement = toXmlAndParse( processDefinition, "/process-definition/event" );
   
    List actionElements = eventElement.elements("action");
View Full Code Here


    assertEquals("bean", processDefinition.getAction("burps").getActionDelegation().getConfigType() );
  }

  public void testWriteActionConfigType() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Delegation actionDelegate = new Delegation("one");
    actionDelegate.setConfigType("bean");
    Action action = new Action(actionDelegate);
    action.setName("a");
    processDefinition.addAction(action);
    Element actionElement = toXmlAndParse( processDefinition, "/process-definition/action" );
    assertEquals("bean", actionElement.attributeValue("config-type"));
View Full Code Here

      "  </action>" +
      "</process-definition>"
    );
 
    Action action = processDefinition.getAction("burps");
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertTrue(instantiatableDelegate.getConfiguration().indexOf("<id>63</id>")!=-1);
    assertTrue(instantiatableDelegate.getConfiguration().indexOf("<greeting>aloha</greeting>")!=-1 );
  }
View Full Code Here

    assertTrue(instantiatableDelegate.getConfiguration().indexOf("<greeting>aloha</greeting>")!=-1 );
  }

  public void testWriteActionXmlConfiguration() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Delegation actionDelegate = new Delegation("one");
    actionDelegate.setConfiguration("<id>63</id><greeting>aloha</greeting>");
    Action action = new Action(actionDelegate);
    action.setName("a");
    processDefinition.addAction(action);
    Element actionElement = toXmlAndParse( processDefinition, "/process-definition/action" );
    assertEquals("63", actionElement.elementTextTrim("id"));
View Full Code Here

      "  </action>" +
      "</process-definition>"
    );
 
    Action action = processDefinition.getAction("burps");
    Delegation instantiatableDelegate = action.getActionDelegation();
    assertTrue(instantiatableDelegate.getConfiguration().indexOf("a piece of configuration text")!=-1);
  }
View Full Code Here

    assertTrue(instantiatableDelegate.getConfiguration().indexOf("a piece of configuration text")!=-1);
  }

  public void testWriteActionTextConfiguration() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Delegation actionDelegate = new Delegation("one");
    actionDelegate.setConfiguration("a piece of configuration text");
    actionDelegate.setConfigType("constructor");
    Action action = new Action(actionDelegate);
    action.setName("a");
    processDefinition.addAction(action);
    Element actionElement = toXmlAndParse( processDefinition, "/process-definition/action" );
    assertEquals("a piece of configuration text", actionElement.getTextTrim());
View Full Code Here

    assertFalse(action.acceptsPropagatedEvents());
  }

  public void testWriteActionAcceptPropagatedEventsDefault() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Delegation actionDelegate = new Delegation("one");
    Action action = new Action(actionDelegate);
    action.setName("a");
    processDefinition.addAction(action);
    Element actionElement = toXmlAndParse( processDefinition, "/process-definition/action" );
    assertNull(actionElement.attribute("accept-propagated-events"));
View Full Code Here

    assertNull(actionElement.attribute("accept-propagated-events"));
  }

  public void testWriteActionAcceptPropagatedEventsTrue() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Delegation actionDelegate = new Delegation("one");
    Action action = new Action(actionDelegate);
    action.setName("a");
    action.setPropagationAllowed(true);
    processDefinition.addAction(action);
    Element actionElement = toXmlAndParse( processDefinition, "/process-definition/action" );
View Full Code Here

    assertNull(actionElement.attribute("accept-propagated-events"));
  }

  public void testWriteActionAcceptPropagatedEventsFalse() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Delegation actionDelegate = new Delegation("one");
    Action action = new Action(actionDelegate);
    action.setName("a");
    action.setPropagationAllowed(false);
    processDefinition.addAction(action);
    Element actionElement = toXmlAndParse( processDefinition, "/process-definition/action" );
View Full Code Here

  }

  public void testWriteNodeActionName() throws Exception {
    ProcessDefinition processDefinition = new ProcessDefinition();
    Node node = processDefinition.addNode( new Node() );
    Delegation instantiatableDelegate = new Delegation();
    instantiatableDelegate.setClassName("com.foo.Fighting");
    node.setAction(new Action(instantiatableDelegate));
   
    Element actionElement = AbstractXmlTestCase.toXmlAndParse( processDefinition, "/process-definition/node/action" );
    assertNotNull(actionElement);
    assertEquals("action", actionElement.getName());
View Full Code Here

TOP

Related Classes of org.jbpm.instantiation.Delegation

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.