5 Replies Latest reply on Jan 2, 2008 9:03 AM by kukeltje

    Seam & BPM - is there a way to 'filter' taskInstanceListForT

    javabeats

      Hi everyone,

      I have a business process where I assign tasks to pooled actors. All good and simple, assignment working as it should.

      I must, however, further restrict access to tasks in a pool. What I mean is best described with an example: Suppose I have a "shipping" task, assigned to the role "shippers". But, I have my shippers divided by geographic areas, a database table association between the shippers (users) and the areas they can ship to.

      Since I cannot express this division in the BPM script itself, how could I further filter the 'taskInstanceListForType' results for a shipper? Is this solved using Drools for task assignment (not sure about that), or should I leave that concern to the control/presentation layer?

      If I should delegate such a 'filtering' responsibility to my own software layer, what approach would you suggest I take?

      Thank you guys in advance, for any insight, or the sole courtesy of reading my post ;)

      Rodrigo

        • 1. Re: Seam & BPM - is there a way to 'filter' taskInstanceList
          pmuir

          I would write my own custom task instance list - use the code from the built in Seam components as examples - use whats there to get the tasks from jbpm and then apply filtering using a loop or whatever.

          • 2. Re: Seam & BPM - is there a way to 'filter' taskInstanceList
            javabeats

            I was hoping I could avoid a custom implementation, but it seems the only (proper) way to go here, indeed. Thanks for your reply :D

            Rodrigo

            • 3. Re: Seam & BPM - is there a way to 'filter' taskInstanceList
              pmuir

              Extending/overriding built in seam components if needed for more complex use cases is often the right way to do it - we would definitely encourage you to do this...

              • 4. Re: Seam & BPM - is there a way to 'filter' taskInstanceList
                javabeats

                Certainly. And contribute it back, should the code be good and useful for other people as well. ;)

                I was hoping I could hook a drools-kind-of-solution here to easily swap it in runtime, or even disable such "filtering" capability as the user sees fit. That can still be accomplished by extending the component, as you suggested, but it implies in more coding - and, a script seemed like a better way.

                But I see no problems extending it - the everlasting beauty of OOP in Java =D

                Rodrigo

                • 5. Re: Seam & BPM - is there a way to 'filter' taskInstanceList
                  kukeltje

                  Rodrigo,

                  For jBPM the 'pooled actors' is in one way nothing more than a string. So there might be a possible different solution

                  Creating a swimlane with the 'shippers' as assignment/role is possible and you can then have a custom assignment handler attached to this that returns another string with the 'correct value' e.g. shipper-americas, shipper-emea, shipper-south-pole. Which string is returned can be decided upon by e.g. drools based on whatever info you provide.

                  If you know which area a shipper is in (also e.g. via drools) you can just use the normal group tasklist.