1 Reply Latest reply on Mar 2, 2008 3:47 PM by mimiru

    Creating new node

    mimiru

      Hello all

      I read the documentation at http://docs.jboss.com/jbpm/v3.2/userguide/html/. It mentions that nodetype node can have customized behavior when it comes to creating new execution paths in the form of a token, also this behavior must be programmed in an action handler.

      The node behavior I want to create is when a token arrives, a new token is created and passed on to a leaving transition, the arrived token is passed over the default leaving transition (eventually i will be expanding this to allow for any number of new tokens and any number of leaving transitions).

      token token
      -----> [Split] -----> ...
      | new token
      \-----------> ... -> [end-state]

      I implemented this in the execute method like this:

      Token newToken = new Token(executionContext.getToken(), "split");
      ExecutionContext newContext = new ExecutionContext(newToken);
      executionContext.leaveNode();
      newContext.leaveNode("split");

      When I run the process I can see that the new tokens are produced and indeed arrive in the end state all seems to be in order as far as I can tell.

      Except that calling JbpmContext.getGraphSession().deleteProcessInstance(theInstanceContainingSplitId) (this I use to remove the process from the database while testing) throws a database constraint exception on the foreign key for the token table. Is this because I am doing something wrong while producing the new tokens or is this some bug?

        • 1. Re: Creating new node
          mimiru

          Did not notice that white-space is trimmed on the forum (replacing white space with _)

          token_____token
          ----->[Split] -----> ...
          _______| new token
          _______\------------> ... ---> [end-state]