1 2 Previous Next 16 Replies Latest reply on Aug 10, 2009 4:06 PM by kukeltje

    [BPMN2] Resource assignment

    camunda

      Moving from Mail to forum:

      Ronald:

      >>> This works:
      >>>
      >>> <bpmn:userTask id="UserTask" name="user task"
      >>> implementation="other">
      >>> <!-- use jbpm internal task management -->
      >>> <bpmn:performer id="myPerformer"
      >>> resourceRef="sampleResource">
      >>> <bpmn:resourceAssignmentExpression
      >>> id="rae">
      >>> <bpmn:formalExpression
      >>> language="juel">${assignedUser}</bpmn:formalExpression>
      >>> </bpmn:resourceAssignmentExpression>
      >>> </bpmn:performer>
      >>> <bpmn:rendering id="myRendering">
      >>> <jbpm:form>MyForm.ftl</jbpm:form>
      >>> </bpmn:rendering>
      >>> </bpmn:userTask>
      >>>
      >>> Assigning a task to a user while parsing a processvariable. Not sure
      >>> how I have to use the resource though, that's still a blurry subject
      >>> for me in this regard.
      >>>
      >>> What also works is setting the form on the taskDefinition based on
      >>> the jbpm:form inside the rendering element (yes Tom, OTHER namespace
      >>> required :-P), so it might just be that it is possible to hook this
      >>> up to the console already.
      >>>
      >>> What I'm currently looking into is how to differentiate between
      >>> users and groups. There is a potentialOwner element of which you can
      >>> have multiple, but it might be that
      


      Ronald:
      >> I could initially do something like:
      >>
      >> <bpmn:potentialOwner id="myPerformer"
      >> resourceRef="sampleResource" jbpm:type="group">
      >>
      >> for groups
      >>
      >> and
      >>
      >> <bpmn:potentialOwner id="myPerformer"
      >> resourceRef="sampleResource" jbpm:type="user">
      >>
      >> for users.
      


      Tom wrote:

      > isn't the simplest way if we couple resourceRef directly to our groups ?
      >
      > <bpmn:potentialOwner id="myPerformer" resourceRef="accounting">
      >
      > in jBPM we could then associate the group as a candidate for that
      > task. i think that covers the most common form of task assignment.
      >
      > wdyt?


      Bernd:
      > This is not the BPMN 2 way of thinking I guess. So I would go for what
      > Ronald proposed, that looks like valid BPMN 2.
      >
      > For the groups I didn't find anything in the spec. I check Bruce's
      > book. Maybe there...
      >
      > Intuitivley I would put it in the resource (example from spec, p. 183):
      >
      > <resource id="regionalManager" name="Regional Manager">
      > <resourceParameter id="buyerName" isRequired="true" name="Buyer Name"
      > type="xsd:string"/>
      > <resourceParameter id="region" isRequired="false" name="Region"
      > type="xsd:string"/>
      > <jbpm:type>user</jbpm:type>
      > </resource>
      


      Tom:
      can't we start with resourceAssignmentExpression instead of the resourceRef as the most basic way of assigning a task?
      
      <potentialOwner id="myPerformer">
       <resourceAssignmentExpression>
       <formalExpression body="tom" language="jbpm-user" />
      
      or
      
      <potentialOwner id="myPerformer">
       <resourceAssignmentExpression>
       <formalExpression body="sales-dept" language="jbpm-group" />
      


        • 1. Re: [BPMN2] Resource assignment
          camunda

          Ronald:

          What about:
          
          <resource id="regionalManager" name="Regional Manager">
           <resourceParameter id="buyerName" isRequired="true" name="Buyer Name"
          type="xsd:string"/>
           <resourceParameter id="region" isRequired="false" name="Region"
          type="xsd:string"/>
           <resourceParameter id="type" isRequired="false" name="jBPM type"
          type="xsd:string"/>
          </resource>
          And then set it in the activityResource? I'll initially go for what Bernd propose. The hard part is getting the resource related to the activityResource
          


          Bernd wrote:

          I had something like this in mind first, but wonder if that is correct (since the regionalManager is maybe always a user)?


          • 2. Re: [BPMN2] Resource assignment
            koen.aers

             

            <resource id="regionalManager" name="Regional Manager">
             <resourceParameter id="buyerName" isRequired="true" name="Buyer Name"
            type="xsd:string"/>
             <resourceParameter id="region" isRequired="false" name="Region"
            type="xsd:string"/>
             <resourceParameter id="type" isRequired="false" name="jBPM type"
            type="xsd:string"/>
            </resource>


            Bernd wrote:

            I had something like this in mind first, but wonder if that is correct (since the regionalManager is maybe always a user)?


            I nevertheless think that this is the way the spec wants us to do it. A resource only specifies a number of parameters that are used at runtime to resolve the actual potential owner. There is probably room to define shortcuts that make it less clumsy to work with the jBPM task management implementation, but I would not concentrate on that for now.

            Regards,
            Koen

            • 3. Re: [BPMN2] Resource assignment
              kukeltje

              I kind of like Tom's idea of the language type. Maybe I can even leverage the existing jbpm 3 assignment expression.

              I'll focus on that.

              • 4. Re: [BPMN2] Resource assignment
                koen.aers

                 

                "Ronald" wrote:
                I kind of like Tom's idea of the language type. Maybe I can even leverage the existing jbpm 3 assignment expression.

                It doesn't feel very natural to me to define a separate language to resolve between groups and users. Using a jBPM 3 like assignment expression language probably makes sense though.

                Regards,
                Koen

                • 5. Re: [BPMN2] Resource assignment
                  camunda

                  Good point: Why not make it part OF the expression (for now)?

                  Bruce doesn't have anything about it in his book...

                  • 6. Re: [BPMN2] Resource assignment
                    kukeltje

                    Yep, thought of that to, you guys beat me. I'll make JUEL functions and just leverage that.

                    • 7. Re: [BPMN2] Resource assignment
                      koen.aers

                      One can already feel that this will be an area where "BPMN compliant" implementations will be highly incompatible :-)

                      Regards,
                      Koen

                      • 8. Re: [BPMN2] Resource assignment
                        kukeltje

                        And 'java serviceTask', send/receive message (e.g. to jms, folder etc... Very oriented towards esb stuff. Maybe we should join forces with those guys.

                        • 9. Re: [BPMN2] Resource assignment
                          camunda

                           

                          Ronald wrote:
                          One can already feel that this will be an area where "BPMN compliant" implementations will be highly incompatible :-)


                          Yes, but the compatible answer to these questions is WS-HumanTask.

                          • 10. Re: [BPMN2] Resource assignment
                            kukeltje

                            Is it? I did not find any mapping to WS-HumanTask for assignments other than that you can specify that HumanTaskWebservice is the task type.

                            Have you read that spec btw? Another 150 pages or so I believe...

                            What we can also do is use the "evaluatesToTypeRef" Attribute and specify a type of jbpm:group and jbpm:user which just extend string...

                            • 11. Re: [BPMN2] Resource assignment
                              koen.aers

                               

                              "Bernd" wrote:
                              Yes, but the compatible answer to these questions is WS-HumanTask.

                              AFAICS the only lines in the spec wrt execution semantics of user tasks is the following:
                              User Task: Upon instantiation, theUser Task is distributed to the assigned person or group of
                              people. When the work has been done, theUser Task completes.

                              So the actual implementation of assignment is up to the implementor. This implementation has to look up the assignee or candidate based on the actual parameters that are available. I could be wrong but I think it means that this will probably not be very portable across implementations.

                              Cheers,
                              koen

                              • 12. Re: [BPMN2] Resource assignment
                                sebastian.s

                                Hello!

                                Actually I thought meanwhile there was a public draft of the BMPN 2.0 standard available but on the OMG's website it is still just available for members. I did not find anything useful with a Google search. Is there a way of taking a look into the draft?

                                • 13. Re: [BPMN2] Resource assignment
                                  kukeltje

                                  afaik, it still is only available for omg members.

                                  • 14. Re: [BPMN2] Resource assignment
                                    koen.aers

                                    Hi Guys,

                                    I've been chewing on this a little bit. Maybe I am totally missing something, but I was thinking that it probably would be best to keep things as simple as possible for now. So instead of introducing a new schema for jbpm tasks, why not just reuse the 'id' attribute of rendering to determine the form to be rendered. Also, I would like to get rid of most of the namespace declarations and language specifications in the root element. AFAIK the ones that are specified now are the defaults anyway. The resulting xml for the bpmn process definition could become a lot simpler.

                                    <?xml version="1.0" encoding="UTF-8"?>
                                    <definitions
                                     id="UserTaskSimple"
                                     xmlns="http://schema.omg.org/spec/BPMN/2.0"
                                     targetNamespace="myTargetNamespace">
                                    
                                     <resource name="sampleHumanResource" />
                                    
                                     <process id="UserTaskSimpleProcess" name="Simple process with user task">
                                    
                                     <!-- FLOW NODES -->
                                    
                                     <startEvent id="Start" />
                                    
                                     <userTask id="UserTask" name="user task"
                                     implementation="other">
                                     <performer id="myPerformer" resourceRef="sampleResource">
                                     <resourceAssignmentExpression id="rae">
                                     <formalExpression language="juel">
                                     ${assignedUser}
                                     </formalExpression>
                                     </resourceAssignmentExpression>
                                     </performer>
                                     <rendering id="myRendering.ftl"/>
                                     </userTask>
                                    
                                     <endEvent id="End" name="End" />
                                    
                                     <!-- SEQUENCE FLOW -->
                                    
                                     <sequenceFlow id="flow1" name="fromStartToUserTask"
                                     sourceRef="Start" targetRef="UserTask" />
                                    
                                     <sequenceFlow id="flow2" name="fromUserTaskToEnd"
                                     sourceRef="UserTask" targetRef="End" />
                                    
                                    
                                     </process>
                                    
                                    </definitions>
                                    


                                    What do you guys think about this?

                                    Regards,
                                    Koen

                                    1 2 Previous Next