4 Replies Latest reply on Dec 14, 2005 8:05 AM by finska2

    event registration for JBPM?

    finska2

      Looking for any input on this high-level question:

      Is there a way to register external events for jbpm, such that they cause a "state transition"?

      For example, if the process is in a wait state until a file is written to a specific directory:
      1. can I somehow register the "file existence" as an event to trigger state movement? or
      2. Must I write an action which polls the directory for the file's existence?

      It would be very useful to me if jBPM does use some event management plug-in for event capture,

      Any information is greatly appreciated,
      Finska

        • 1. Re: event registration for JBPM?
          sforema

          Is there a way to register external events for jbpm, such that they cause a "state transition"?

          jBPM is a workflow engine. It isn't designed to listen for events and react to them. That is up to the developer.

          You could slice this two ways:

          1. write an action that looks for the file and signals the token to continue (your suggestion). The process isn't in a wait state, but is running your code waiting for the file.

          2. put the process in a wait state and have a separate proces look for the file. When the file was located it would signal the token with the same results. The trick would be knowing the token_id, so I'd go with option 1.

          • 2. Re: event registration for JBPM?
            ralfoeldi

            or...

            write a timer that periodically checks for the file and only continues when present. (then you wouldn't need a thread :-)

            personally i'd go for the external polling mech. you would have to mark your token in some kind and then query it in order to signal the correct token. but maybe you can code the tokenId or something else into the filename.

            Rainer

            • 3. Re: event registration for JBPM?
              koen.aers

              I also think the external polling is the simplest and most flexible solution. Besides that, you will want to correlate the file with the processinstance/token anyway, so using the tokenid in the filename or have a correlation table where this is done are two possible solutions.

              Regards,
              Koen

              • 4. Re: event registration for JBPM?
                finska2

                Hi all
                Thanks for your replies - this is kind of what I expected (i.e. having to code up your own incoming event triggers to fit into jBPM process flow), but I'm just in the evaluation of jBPM as a fit for our requirements so expertise is much appreciated!

                I suppose I thought that there may have been some sort of event registration/mgmt plug-in for jBPM as some of the examples refer to "incoming emails" as triggers to movemenmt in the process chain - but I suppose, as befire, this is coded up by the jBPM developer also.

                Thanks again for your input
                Finska