0 Replies Latest reply on Jun 28, 2018 12:14 AM by Hiroyuki Inaba

    Why  stackoverflow occurs?

    Hiroyuki Inaba Newbie

      BPMN2:

       

      S - <O> - Script Task - <X> - E

             +<=-----------------+

       

      Script Task:

       

      ProcessInstance p = kcontext.getProcessInstance();

      Long c = (Long) ((RuleFlowProcessInstance)p).getVariable("counter");

      System.out.println(c + " - Hello jBPM 7.7.0 !");

      ((RuleFlowProcessInstance)p).setVariable("counter", new Long(c + 1));

       

      X: Exclusive Gateway - Condition to go to E

       

      ProcessInstance p = kcontext.getProcessInstance();

      Long c = (Long) ((RuleFlowProcessInstance)p).getVariable("counter");

      return (c > 300);

       

      System.out:

       

      1 - Hello jBPM 7.7.0 !

      2 - Hello jBPM 7.7.0 !

           :

      272 - Hello jBPM 7.7.0 !

      273 - Hello jBPM 7.7.0 !

      Exception in thread "main" java.lang.StackOverflowError

      at java.nio.CharBuffer.wrap(CharBuffer.java:373)

      at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:265)

      at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)

      at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207)

      at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:129)

      at java.io.PrintStream.write(PrintStream.java:526)

      at java.io.PrintStream.print(PrintStream.java:669)

      at java.io.PrintStream.println(PrintStream.java:806)

      at com.sample.Process_com$u46$sample$u46$HelloL1214852879.action0(Process_com$u46$sample$u46$HelloL1214852879.java:17)

      at com.sample.Process_com$u46$sample$u46$HelloL1214852879Action0Invoker.execute(Process_com$u46$sample$u46$HelloL1214852879Action0Invoker.java:14)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.executeAction(NodeInstanceImpl.java:213)

      at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:47)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:186)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:380)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:339)

      at org.jbpm.workflow.instance.node.JoinInstance.triggerCompleted(JoinInstance.java:268)

      at org.jbpm.workflow.instance.node.JoinInstance.internalTrigger(JoinInstance.java:132)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:186)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:380)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:395)

      at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitInstance.java:116)

      at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:62)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:186)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:380)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:339)

      at org.jbpm.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:60)

      at org.jbpm.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:56)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:186)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:380)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:339)

      at org.jbpm.workflow.instance.node.JoinInstance.triggerCompleted(JoinInstance.java:268)

      at org.jbpm.workflow.instance.node.JoinInstance.internalTrigger(JoinInstance.java:132)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:186)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:380)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:395)

      at org.jbpm.workflow.instance.node.SplitInstance.executeStrategy(SplitInstance.java:116)

      at org.jbpm.workflow.instance.node.SplitInstance.internalTrigger(SplitInstance.java:62)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:186)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:380)

      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:339)

      :

      (stacktrace of the same pattern are continuous)

       

      jBPM: 7.7.0

      Java SE 8 (32 bit)