3 Replies Latest reply on Mar 1, 2007 3:16 PM by kukeltje

    Alter the flow of a process instance

    adrianr

      Hi, I need some way to alter the flow of a process instance, for example I have a process instance wich is in node A and I want to arbitrary move it to node D, node A and D don't have transitions between them. I know this doesn't respect the normal flow and is very awfull, but i need it to simulate some special behaviour. I've been searching in javadoc, and I've found that Token has a method called setNode(Node).
      So, one option would be:

      instance.getRootToken().setNodo(node);
      


      I tested it and apparently it works, although I don't know if this damages other things like logging, or if there's a better way for doing this.

      Thanks,
      Adrian R.


        • 1. Re: Alter the flow of a process instance
          kukeltje

          You could (temporarily) add a transition between the nodes as well, but I would not do that. Your solution is ok. It does not brake anything internally in the core. So if it does not break anything for you, you can use it.

          • 2. Re: Alter the flow of a process instance
            adrianr

            as i suspected this method doesn't log changes, so I think I need to consider your idea of adding temporarily transitions between the nodes, because I need logging the change.

            • 3. Re: Alter the flow of a process instance
              kukeltje

              I just remembered something... What I (once) did was create one kind of 'I'm-doing-something-out-of-the ordinary' node. That node had an actionhandler on node-enter that logged something AND looked at a process variable to see what node to go to next. There were no incomming or outgoing transitions but I did get logging