1 2 Previous Next 28 Replies Latest reply on Jul 19, 2006 9:30 AM by Daniel Lipski

    Modeling simple process(tasks)

    Daniel Lipski Newbie

      Hi, I'm using jBPM for few days, i've read whole documentation and i have problem with modeling very simple process.
      First short process description:

      Supplier creates order after that, order can be accepted or rejected by shop employee. But diffrent employees have different permissions: some can only accept ,some reject, others can do both. After accepting process go's to accepted state, after rejecting go's to rejected state.

      As i understand documentation permissions can be applied only to tasks so i have to create to tasks acceptOrder and rejectOrder and assign them to some task node for ex. orderCreated.
      This node should have two transitions: goToAccepted and goToRejected. Now it's very easy to get all user tasks (getTaskMgmtSession().findTaskInstances(#userId#)).

      But there is one problem how i can know witch transistion I should take after completing one of these tasks ? Of course in this simple process i know witch but it must be handcoded outside of workflow (in the client). How to model such cases ? How to link tasks with transistions witch should be taken after completing them.

        • 1. Re: Modeling simple process(tasks)
          auré manga Novice

          hello,

          If I understand well you want to create a task for few poeple who have some different roles. In order to do this you can use in your process model the "swimlane" which permit you to define a specific role to a task and put some poeple who can execute this task. I'm putting the link in order to see you what is it specialy.

          http://docs.jboss.com/jbpm/v3/userguide/taskmanagement.html#swimlanes

          I hope I help you

          antitrust1982

          • 2. Re: Modeling simple process(tasks)
            Daniel Lipski Newbie

            Thanks for your help, but swomlines aren't solution to my problem. I have problem with assigning transition to task. For example, I have task node with 2 tasks t1 i t2 and have two transitions from this node: tt1 and tt2. Now, when user u1 performs t1 i want to move token through tt1 and when user performs task t2 I want to take tt2.

            • 3. Re: Modeling simple process(tasks)
              Daniel Lipski Newbie

              Maybe some one knows sites where i can found same example processes ?
              It's hard to imagine that there isn't simple solution for such (in my opinion) common situation.
              Nevertheless i have second question:
              How i can get list o tasks for user grouped by task node ? Or better how to get
              task nodes where user have some tasks to perform, and then get only these tasks. (considering task assignments)

              • 4. Re: Modeling simple process(tasks)
                Ronald van Kuijk Master

                The situation is not uncommon, the way you model it is. Look at the workflow patterns site to see what comes close, look at the jbpm testcases for these patterns and think out of the box, model it differently. Or create custom pages with just one transition in it. jBPM currently does not do evertything automagically, nor will it ever fully do.

                Things to consider:
                - set a variable in each task, have just one transition
                - use a decision to direct the process

                Again, dare thinking out of the box. If it does not seem to work in the way you did it, maybe you should do it differently

                • 5. Re: Modeling simple process(tasks)
                  Daniel Lipski Newbie

                   

                  The situation is not uncommon, the way you model it is

                  So what is a common way ? But dont reference me to workflow patterns because they dont use task nodes, task instances, and other jBPM specifics so in this situtaion are useless.
                  I have to use tasks beacouse it is only way(only in iBPM ?) i can apply permissions.
                  model it differently

                  I try to model it differently but i don't know how (look at subject of my first post)
                  create custom pages

                  What are pages ? pages == nodes ? I didn't remember these term from documentation.
                  BPM currently does not do evertything automagically

                  Do u see any magic here ? where ? ;) Connecting tasks with transitions is magic ?
                  In my opinion not.
                  Your solution:
                  - set a variable in each task, have just one transition
                  - use a decision to direct the process


                  • 6. Re: Modeling simple process(tasks)
                    Daniel Lipski Newbie

                    [Continuation]
                    Your solution:

                    - set a variable in each task, have just one transition
                    - use a decision to direct the process

                    Have few disadventages:
                    -adding any tasks invloves modifiaction of decision
                    -technicals details have influence on process design, so it is not understandable for process designers.

                    Once again why thre isnt simple way to connect task with trasition ?
                    And once again how to get nodes where are some tasks witch user should perform ?

                    Sory for my inquisitiveness but i cant imagine that such simple cases causes such problems.

                    • 7. Re: Modeling simple process(tasks)
                      Koen Aers Master

                      The problem *is* simple, as is the solution. As Ronald said, think out of the box...
                      Task nodes are nothing else than special states... The patterns on the workflowpatterns site all use states with transitions, so the mapping should be fairly easy...

                      Regards,
                      Koen

                      • 8. Re: Modeling simple process(tasks)
                        Daniel Lipski Newbie

                        We had to missanderstand.

                        I know that there is few solutions for this problem, but what i'm trying to say is none of them take adventage of provided with jBPM task nodes and very easy to use API for retriving task assigned for actor (pooled or performed).

                        In addition none of these patterns considers user permissions whitch in jBMP can be assgined only to tasks. So i couldnt just create node with few transitions with different conditions(as in Exclusive Choice patter) because i dont't know how to assign permissions to these transitions. Whats more i don't know how to query (via provided API) workflow engine for actions avaliable for user (such as getTaskMgmtSession().findTaskInstances(actorId)).

                        Imagine that I have very simple UI: one page for every process instance. In this page i have table where number of rows = number of process instances.
                        In the columns i have buttons each for task that user can perform. So if task instance t1 is in task node with 3 tasks there will be 3 buttons in these row. When user click button i know witch task he want to perform, after completing task i want to read FROM PROCESS DESIGN whitch transition i should take and afther that the user will return to the same form. But there will be diffrent buttons in row coresponding to these porcess instance because token is in different task node. Offcorse i can use some namimg convention for task and transitions ex. task1 and after_task1 but in m opinion it is not good idea.

                        So i have to immortal questions:
                        1)how to map such situation
                        2)how to query for task for user grouped by task node (or process instance)

                        As Ronald said, think out of the box...

                        What do u exactly mean... ?


                        Thanks for your help

                        • 9. Re: Modeling simple process(tasks)
                          Chris OBrien Novice

                          If you have a single task node with three tasks, and you want to leave the node after ONE task is complete?

                          Why not just have 3 separate task nodes with one task a piece? The 'task selection' would be the page before hand, which would select which transition to go to (which would decide which task node to go to)

                          • 10. Re: Modeling simple process(tasks)
                            Ronald van Kuijk Master

                            and add an action that cancels all other parallel tasks if one is acted upon

                            • 11. Re: Modeling simple process(tasks)
                              Daniel Lipski Newbie

                               

                              If you have a single task node with three tasks, and you want to leave the node after ONE task is complete?

                              Yes
                              Why not just have 3 separate task nodes with one task a piece?

                              Tasks instances are created when token comes to task node, so when i'm one step before (as u said in node with 3 transitions) i don't know witch transitions user can take (permissions rules).


                              • 12. Re: Modeling simple process(tasks)
                                Chris OBrien Novice

                                 

                                "kukeltje" wrote:
                                and add an action that cancels all other parallel tasks if one is acted upon


                                I don't think that's needed... The task node can be configured as signal=first end-tasks=true, right?

                                <task-node name="task3" end-tasks="true" signal="first">


                                That will let the first task signal to the next node and cancel all open tasks, at least from my understanding.

                                • 13. Re: Modeling simple process(tasks)
                                  Ronald van Kuijk Master

                                  it cancels ALL open tasks indeed, FOR NOW ;-) cause that is a bug. It should only cancel tasks in the same task-node

                                  • 14. Re: Modeling simple process(tasks)
                                    Chris OBrien Novice

                                    Oh wow, ouch. Yeah, I assumed it maintained the relationship to the current task-node. :)

                                    1 2 Previous Next