1 Reply Latest reply on Aug 14, 2006 5:21 AM by Tom Baeyens

    debugger api

    Tom Baeyens Master

       

      "Alex" wrote:
      Providing a debugger API is a compelling task. I thought about it for a while and here are my first ideas. Comments are welcome :)

      Debugging is about setting breakpoints in the process *definition*, intercepting the *execution* and then stepping through the following steps. jBPM already offers a mechanism to observe the execution of a process. I can think of providing debugging facilities by creating a process instance with runtime actions installed at the node-enter event of every activity. I will call them "interceptors".

      There are two execution modes, "continuous" or "step-by-step". In the former, only interceptors marked as "breakpoints" can suspend the process execution. In the latter, all interceptors can suspend execution.

      Communication between the BPEL runtime and the debugger occurs through some remoting technology. EJBs are an option, but web services seem more appropriate since BPEL is about web services.

      The exposed operations are:

      setBreakpoint(processName: QName, activityName: String)
      ----
      Mark the interceptor at the entrance of the specified activity, which belongs to the specified process, as a breakpoint.

      debug(processName: QName) : ProcessInstanceHandle
      ---
      Create an instance of the specified process for debugging purposes. Returns a handle to the newly created instance.

      getBranches(instanceHandle: ProcessInstanceHandle) : List<ProcessBranchHandle>
      ---
      Retrieves the execution branches of the specified process instance.

      stepInto(branchHandle: ProcessBranchHandle)
      ---
      Executes the specified branch up to the next activity. If the branch currently points to a scope, execution will proceed up to the activity nested within the scope.

      stepOver(branchHandle: ProcessBranchHandle)
      ---
      Executes the specified branch up to the next activity. If the branch currently points to a scope, execution will proceed up to the activity that follows the scope.


        • 1. Re: debugger api
          Tom Baeyens Master

          jboss remoting seems a good candidate to make the service facade for the debugger api available.

          i think we would have to include something like the following in the jbpm-code on potential breakpoints:

          if (executionContext.isInDebuggerMode()) {
           DebuggerExecutionContext dec = (DebuggerExecutionContext) executionContext;
           Breakpoint breakpoint = dec.getBreakpoint("node-enter", dec.getNode());
           if (breakpoint.isActive()) {
           breakpoint.suspendExecution();
           }
          }