5 Replies Latest reply on Apr 4, 2013 10:33 AM by Shobhit Tyagi

    Setting Node Metadata

    Shobhit Tyagi Master

      Hi,

       

      I set a field in the metadata map of the nodes of a process. But when i retrieve it doesnt output the newly added key. It returns me the old keys only.

      Do i need to make changes to the xml code as well? If yes then how do I do it please.

       

      Thanks.

        • 1. Re: Setting Node Metadata
          Shobhit Tyagi Master

          Anything on this please?

          • 2. Re: Setting Node Metadata
            joploya Newbie

            Hello,

             

            I find this document about bpmndiagram notation.

             

            https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&cad=rja&ved=0CFEQFjAE&url=http%3A%2F%2Fwww.omgwiki.org%2Fbpmn2.0-ftf%2Flib%2Fexe%2Ffetch.php%3Fid%3Dpublic%253Aspecification_documents%26cache%3Dcache%26media%3Dpublic%3A13_notation.doc&ei=aT1cUdiFAoeRtQbn4oHYDA&usg=AFQjCNFtDg5JrIswPrTIF7l5cLj1TOyQJw&sig2=mf68t6KSkKD18ortmTi8Fg&bvm=bv.44697112,d.Yms

             

             

            Are you sur you can add metadatas? What is your aim?

             

            Edit :

             

            Metadatas are interpreted by the Editor, so if you insert new metadatas they are not recognize :

            Maybe you have to create new element like this :

            https://github.com/worktokenteam/worktoken/blob/master/bpmn/BPMNDI.xsd

             

            PS : sorry if I didn't understand your question!

            • 3. Re: Setting Node Metadata
              Shobhit Tyagi Master

              Thanks for your reply Sandra.

              I wanna attach some information to a node. Any kind of node(Task, Script, Mail). I think that we can add elements to metadata as there is an add button. But may be some modification in the xml code is also required.

               

              For now my motive is to know what kind of a node this is. So I am trying to attach a key "type" to the meta data map. May be you could help me with the API to do that. But ultimately I would like to know if elements could be added or not.

               

               

              Untitled.png

              Thanks.

              • 4. Re: Setting Node Metadata
                joploya Newbie

                OK, I make search on your problem and find this :

                 

                metadata_topic_1.png

                I try to add a new field in metadata but no impact on the xml code :

                metadata_topic_2.png metadata_topic_3.png

                 

                But for me it seems to be normal because when we modify the flow with the graphical interface, it is transform/interpreted with the jbpm-bpmn2 package I think.

                metadata_topic_4.png

                 

                And if you see the doc in supported elements you can see that no more attributes are supported for every task :

                1. 6.3. Supported elements / attributes

                Table 6.1. Keywords

                Element

                Supported attributes

                Supported elements

                Extension attributes

                Extension elements

                definitions

                 

                rootElement BPMNDiagram

                 

                 

                process

                processType isExecutable name id

                property laneSet flowElement

                packageName adHoc version

                import global

                sequenceFlow

                sourceRef targetRef isImmediate name id

                conditionExpression

                priority bendpoints

                 


                 

                 

                 

                 

                Activities

                 

                 

                 

                 

                task

                name id

                ioSpecification dataInputAssociation dataOutputAssociation

                taskName x y width height

                 

                scriptTask

                scriptFormat name id

                script

                x y width height

                 

                script

                 

                text[mixed content]

                 

                 

                userTask

                name id

                ioSpecification dataInputAssociation dataOutputAssociation resourceRole

                x y width height

                onEntry-script onExit-script

                potentialOwner

                 

                resourceAssignmentExpression

                 

                 

                resourceAssignmentExpression

                 

                expression

                 

                 

                businessRuleTask

                name id

                 

                x y width height ruleFlowGroup

                onEntry-script onExit-script

                manualTask

                name id

                 

                x y width height

                onEntry-script onExit-script

                sendTask

                messageRef name id

                ioSpecification dataInputAssociation

                x y width height

                onEntry-script onExit-script

                receiveTask

                messageRef name id

                ioSpecification dataOutputAssociation

                x y width height

                onEntry-script onExit-script

                serviceTask

                operationRef name id

                ioSpecification dataInputAssociation dataOutputAssociation

                x y width height

                onEntry-script onExit-script

                subProcess

                name id

                flowElement property loopCharacteristics

                x y width height

                 

                adHocSubProcess

                cancelRemainingInstances name id

                completionCondition flowElement property

                x y width height

                 

                callActivity

                calledElement name id

                ioSpecification dataInputAssociation dataOutputAssociation

                x y width height waitForCompletion independent

                onEntry-script onExit-script

                multiInstanceLoopCharacteristics

                 

                loopDataInputRef inputDataItem

                 

                 

                onEntry-script*

                scriptFormat

                 

                script

                 

                onExit-script*

                scriptFormat

                 

                script

                 

                 

                 

                 

                 

                 

                Gateways

                 

                 

                 

                 

                parallelGateway

                gatewayDirection name id

                 

                x y width height

                 

                eventBasedGateway

                gatewayDirection name id

                 

                x y width height

                 

                exclusiveGateway

                default gatewayDirection name id

                 

                x y width height

                 

                inclusiveGateway

                default gatewayDirection name id

                 

                x y width height

                 

                 

                 

                 

                 

                 

                Data

                 

                 

                 

                 

                property

                itemSubjectRef id

                 

                 

                 

                dataObject

                itemSubjectRef id

                 

                 

                 

                itemDefinition

                structureRef id

                 

                 

                 

                ioSpecification

                 

                dataInput dataOutput inputSet outputSet

                 

                 

                dataInput

                name id

                 

                 

                 

                dataInputAssociation

                 

                sourceRef targetRef assignment

                 

                 

                dataOutput

                name id

                 

                 

                 

                dataOutputAssociation

                 

                sourceRef targetRef assignment

                 

                 

                inputSet

                 

                dataInputRefs

                 

                 

                outputSet

                 

                dataOutputRefs

                 

                 

                assignment

                 

                from to

                 

                 

                formalExpression

                language

                text[mixed content]

                 

                 

                 

                 

                 

                 

                 

                BPMNDI

                 

                 

                 

                 

                BPMNDiagram

                 

                BPMNPlane

                 

                 

                BPMNPlane

                bpmnElement

                BPMNEdge BPMNShape

                 

                 

                BPMNShape

                bpmnElement

                Bounds

                 

                 

                BPMNEdge

                bpmnElement

                waypoint

                 

                 

                Bounds

                x y width height

                 

                 

                 

                waypoint

                x y

                 

                 

                 

                 

                So maybe by modifying the org.jbpm.bpmn2 package you could add more metadatas but there is certainly another way to know in which type of node you are.

                 

                Perhaps by using directly the map variables or programmatically by retrieving the Node from the processInstance.

                 

                Regards,

                1 of 1 people found this helpful
                • 5. Re: Setting Node Metadata
                  Shobhit Tyagi Master

                  Thanks Sandra. The table gives some clarification as to why adding to metadata doesnt work. I was just curious since there was an add button. But may be I could modify the package, as you suggested.

                  To check the type though, I think I am gonna retrieve the class name from the node and check what class it belongs to. Thanks a lot.