AnsweredAssumed Answered

ErrorBoundryEvent Usage Question

Question asked by richard1 on Apr 20, 2011
Latest reply on Apr 20, 2011 by jbarrez
Hello All,
  We are trying to understand how the ErrorBoundryEvent works. We have created a workflow that contains a SubProcess that has an ErrorBoundryEvent attached to it. In the SubProcess we have a ScriptTask that throws an error. The error thrown from the script never makes it to the BoundryEvent. We get this error 'org.activiti.engine.ActivitiException: problem evaluating script: javax.script.ScriptException: java.lang.Exception: The Error'. This error is valid because or ScriptTask is throwing it, but what is not happening is the BoundryEvent catching it. Below is our process, what are we not understanding? We are trying to have a path for any general errors that may be thrown in anywhere in our sub proccess.


  <process id="helloworld" name="helloworld">
    <startEvent id="startevent3" name="Start"></startEvent>
    <endEvent id="endevent4" name="End"></endEvent>
    <subProcess id="subprocess2" name="Sub Process">
      <startEvent id="subprocess2startevent4" name="Start"></startEvent>
      <endEvent id="subprocess2endevent5" name="End"></endEvent>
      <scriptTask id="subprocess2scripttask3" name="Script Task" scriptFormat="groovy">
        <script><![CDATA[throw new Exception('The Error');]]></script>
      </scriptTask>
      <sequenceFlow id="subprocess2flow8" name="" sourceRef="subprocess2startevent4" targetRef="subprocess2scripttask3"></sequenceFlow>
      <sequenceFlow id="subprocess2flow9" name="" sourceRef="subprocess2scripttask3" targetRef="subprocess2endevent5"></sequenceFlow>
    </subProcess>
    <sequenceFlow id="flow10" name="" sourceRef="startevent3" targetRef="subprocess2"></sequenceFlow>
    <sequenceFlow id="flow11" name="" sourceRef="subprocess2" targetRef="endevent4"></sequenceFlow>
    <boundaryEvent id="boundaryerror3" name="CrappHappening" attachedToRef="subprocess2">
      <errorEventDefinition></errorEventDefinition>
    </boundaryEvent>
    <scriptTask id="scripttask4" name="Script Task" scriptFormat="groovy">
      <script><![CDATA[println('We Have Error Happening");]]></script>
    </scriptTask>
    <endEvent id="endevent6" name="End"></endEvent>
    <sequenceFlow id="flow14" name="" sourceRef="scripttask4" targetRef="endevent6"></sequenceFlow>
    <sequenceFlow id="flow15" name="" sourceRef="boundaryerror3" targetRef="scripttask4"></sequenceFlow>
  </process>
Thanks,
Richard

Outcomes