3 Replies Latest reply on Aug 3, 2007 1:16 PM by Edward Staub

    commit failure

    Tom Baeyens Master

      i get a commit failure

      svn: Commit failed (details follow):
       svn: Commit failed (details follow):
      svn: PUT request failed on '/repos/jbpm/!svn/wrk/6ba24c2c-1401-0010-ae8e-cddc9bab6208/tempranillo/pvm/trunk/test/java/org/jbpm/pvm/SequenceTest.java'
      svn: PUT of '/repos/jbpm/!svn/wrk/6ba24c2c-1401-0010-ae8e-cddc9bab6208/tempranillo/pvm/trunk/test/java/org/jbpm/pvm/SequenceTest.java': 423 Locked (https://svn.jboss.org)
      


      does anyone know how this came about ? can anyone resolve it ?

      i wanted to commit the rest so probably the SequenceTest gives some compilation problems now.

      in case it is necessary for anyone, i'll paste the code of that file in here:

      package org.jbpm.pvm;
      
      import java.util.List;
      
      import org.jbpm.JbpmTestCase;
      
      public class SequenceTest extends JbpmTestCase {
      
       public static class Sequence implements NodeBehaviour {
       private static final long serialVersionUID = 1L;
       public NodeResult execute(ExecutionController execution) throws Exception {
       // get the current sequence node
       Node node = execution.getNode();
      
       // get the list of nested nodes in the sequence
       List<Node> nesteNodes = node.getNodes();
       // if this sequence has nested nodes
       if ( (nesteNodes!=null)
       && (! nesteNodes.isEmpty())
       ) {
       // take the first one
       Node firstNestedNode = nesteNodes.get(0);
       // indicate that firstNestedNode needs to be executed and then
       // this node should be signalled with signal value "1".
       // In this implementation, the signal value is used to encode
       // the index of the next nested node to be executed.
       String signal = "1";
       return new NodeResult(firstNestedNode, signal);
       }
       return NodeResult.COMPLETED;
       }
      
       public NodeResult signal(ExecutionController execution, String signal) throws Exception {
       Node node = execution.getNode();
       List<Node> nestedNodes = node.getNodes();
      
       Integer index = new Integer(signal);
       // if the index is equal to the size of the list of nested nodes
       if (nestedNodes.size()==index) {
       // we're done and the sequence is completed
       return NodeResult.COMPLETED;
       }
      
       // else just execute the next node and increment the signal to be
       // given next time to this node.
       Node nextNode = nestedNodes.get(index);
       return new NodeResult(nextNode, Integer.toString(index+1));
       }
       }
      
       public static class WaitState implements NodeBehaviour {
       private static final long serialVersionUID = 1L;
       public NodeResult execute(ExecutionController execution) throws Exception {
       return NodeResult.WAITING;
       }
       public NodeResult signal(ExecutionController execution, String signal) throws Exception {
       return NodeResult.COMPLETED;
       }
       }
      
       public static class AutomaticActivity implements NodeBehaviour {
       private static final long serialVersionUID = 1L;
       public NodeResult execute(ExecutionController execution) throws Exception {
       return NodeResult.COMPLETED;
       }
       public NodeResult signal(ExecutionController execution, String signal) throws Exception {
       throw new UnsupportedOperationException("automatic activity can't get external signal");
       }
       }
      
       public void testThreeNodesInARow() {
       Process process = Process.build()
       .initial()
       .behaviour(new Sequence())
       .nodes()
       .node("a")
       .behaviour(new WaitState())
       .node("b")
       .behaviour(new WaitState())
       .node("c")
       .behaviour(new WaitState())
       .endNodes()
       .process();
      
       Execution execution = process.newExecution();
      
       assertEquals(process.getInitial().getNodesMap().get("a"), execution.getNode());
       execution.signal();
       assertEquals(process.getInitial().getNodesMap().get("b"), execution.getNode());
       execution.signal();
       assertEquals(process.getInitial().getNodesMap().get("c"), execution.getNode());
       }
      }