3 Replies Latest reply on Nov 17, 2005 4:18 AM by shaoguang geng

    Unittesting without states

    Markus Joschko Newbie

      Hi,
      my processdefinition mainly consists of custom nodes mixed with a few decision nodes. How can I unit test the flow between these nodes? The examples always check on wait states which are not in given in my process.

      Any chance to get the path of the token afterwards?

      Thanks,
      Markus

        • 1. Re: Unittesting without states
          Markus Joschko Newbie

          Mhm, don't want to be impatient but this is currently a real showstopper for me.
          I hope that the question itself is clear: how can I check the flow of a token in an unit test if it the process does not have states but only nodes included which directly call the transition without the need for token.signal() and therefor the chance to check on the current node in the unit test?

          Thanks,
          Markus

          • 2. Re: Unittesting without states
            Koen Aers Master

            Upon a signal (either starting a processinstance or signalling a token), the jBPM engine keeps calculating until it reaches the next state, executing all intermediary actions defined in nodes, events, transitions. The token tree of the processinstance will only be in a stable state (hmm) when the process is waiting in a state for the next signal.
            If you want to test if a particular path has been taken, you should either rely on processvariables that may have been set/used along this path or, if this is not possible, add runtime actions for test purposes to the processdefinition. You can add them after the process has been read from xml, for instance in the setup method of your unit test.

            Regards,
            Koen

            • 3. Re: Unittesting without states
              shaoguang geng Newbie

              You could try to change log level of you org.jbpm.*, there are a lot of messages.