3 Replies Latest reply on Mar 25, 2013 5:37 AM by swiderski.maciej

    Data input objects - blocking a task

    annah

      Hi!

       

       

      I need an explanation of how Data Input Objects should work in JBPM. If data input is not available should it block the task?

      From what I've read here http://brsilver.com/bpmn-2-0-mystery-process-datainput-and-dataoutput/ it says:

      The operational semantics of ioSpecification and inputSet say that a process or task cannot start until the inputSet data is available


      So from this explanation I concluded that if I have a human task which has an association to a data input object, the task should not start until this object is available? I've tried a little example, with a simple process shown below but the human task gets activated and I only get a warning message  "Could not find variable scope for variable DataInput_1 when trying to execute Work Item Human Task. Continuing without setting parameter."

       

      example.jpg

       

      What I want to achieve is that human task is activated when I insert the required data input into ksession (e.g. some data gets submitted to a system and I pass it to ksession so human task can be executed). How do I have to model the process to achieve this blocking behaviour?

       

       

      Thanks!

        • 1. Re: Data input objects - blocking a task

          Hi.  I believe we are working on a similar problem - If I understand your question.  I have received a few helpful suggestions.  The easiest (and ugliest) was to put an AND gateway and a signal intermediate event in front of each task.  This way, the task is not reached until the signal event (new data) is added to the process/ksession.  The other option, which I am working on now (a recommendation from salaboy I think), is implementing this functionality in a customworkitem - where the handler will not complete the work item until the required data is available.  This way, one handler could be used to look for a message that was defined as a parameter in that workitem.  This seems much cleaner to me. 

          hth  (let me know if you have any thoughts)

          -J

          1 of 1 people found this helpful
          • 2. Re: Data input objects - blocking a task
            annah

            Hi Jim,

             

             

            Thank you for your suggestions, I had the same two solutions in my mind. I guess custom handler is the right way to go.

            There is so little documentation about data objects in jbpm, so I was hoping I'm just doing something wrong and that it can be modeled the way I showed above (associating a data object to a task). I'm not really sure what is the intended purpose of data object arfiacts in this case, since they don't make any difference in process execution, it seems like it is just a visual element for clarification of the process, but that's all.

            • 3. Re: Data input objects - blocking a task
              swiderski.maciej

              one additional way of achieving blocking execution until something happens is to use intermediate events. As it comes to the case described I would suggest to use conditional intermediate event that will be activated as soon as defined condition becomes true - for example an object is inserted into the session.

               

              HTH