AnsweredAssumed Answered

Tracking execution tokens and transitions

Question asked by danosaur on Aug 10, 2011
Latest reply on Aug 10, 2011 by danosaur
Hi,

I am currently working on the use case where I need to retreive process variables based on information about previously executed activities. I want to retreive only those process variables that have been changed by "previous" activities in the control flow but not those which were created/changed by activities in parallel control flows. I tried to put execution listeners on transitions, but the problem is that I could not find a way to retreive information from Activiti about which execution will be used to take the outgoing transition. The code snippet from the ExecutionImpl shows that this information is never made available.


      // first create the concurrent executions
      while (!transitions.isEmpty()) {
        PvmTransition outgoingTransition = transitions.remove(0);

        ExecutionImpl outgoingExecution = null;
        if (recyclableExecutions.isEmpty()) {
          outgoingExecution = concurrentRoot.createExecution();
          log.fine("new "+outgoingExecution+" created to take transition "+outgoingTransition);
        } else {
          outgoingExecution = (ExecutionImpl) recyclableExecutions.remove(0);
          log.fine("recycled "+outgoingExecution+" to take transition "+outgoingTransition);
        }
       
        outgoingExecution.setActive(true);
        outgoingExecution.setScope(false);
        outgoingExecution.setConcurrent(true);
        outgoingExecutions.add(new OutgoingExecution(outgoingExecution, outgoingTransition, true));
      }

      // prune the executions that are not recycled
      for (ActivityExecution prunedExecution: recyclableExecutions) {
        log.fine("pruning execution "+prunedExecution);
        prunedExecution.end();
      }

      // then launch all the concurrent executions
      for (OutgoingExecution outgoingExecution: outgoingExecutions) {
        outgoingExecution.take();
      }

So my question: is there any way to track back execution transitions to get a path/trace of the execution token?

Outcomes