Discussion:
[jboss-user] [jBPM] - Setting Node Metadata
Shobhit Tyagi
2013-04-01 22:53:17 UTC
Permalink
Shobhit Tyagi [https://community.jboss.org/people/roxy1987] created the discussion

"Setting Node Metadata"

To view the discussion, visit: https://community.jboss.org/message/805875#805875

--------------------------------------------------------------
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.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/805875#805875]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Shobhit Tyagi
2013-04-03 14:21:31 UTC
Permalink
Shobhit Tyagi [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Setting Node Metadata"

To view the discussion, visit: https://community.jboss.org/message/806223#806223

--------------------------------------------------------------
Anything on this please?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/806223#806223]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Sandra Renaud
2013-04-03 14:38:06 UTC
Permalink
Sandra Renaud [https://community.jboss.org/people/joploya] created the discussion

"Re: Setting Node Metadata"

To view the discussion, visit: https://community.jboss.org/message/806229#806229

--------------------------------------------------------------
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 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?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/806229#806229]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Shobhit Tyagi
2013-04-03 17:50:20 UTC
Permalink
Shobhit Tyagi [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Setting Node Metadata"

To view the discussion, visit: https://community.jboss.org/message/806286#806286

--------------------------------------------------------------
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.


Loading Image... Loading Image...
Thanks.

--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/806286#806286]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Sandra Renaud
2013-04-04 13:13:16 UTC
Permalink
Sandra Renaud [https://community.jboss.org/people/joploya] created the discussion

"Re: Setting Node Metadata"

To view the discussion, visit: https://community.jboss.org/message/806466#806466

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

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

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.
Loading Image... Loading Image...

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,
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/806466#806466]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Shobhit Tyagi
2013-04-04 14:30:02 UTC
Permalink
Shobhit Tyagi [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Setting Node Metadata"

To view the discussion, visit: https://community.jboss.org/message/806501#806501

--------------------------------------------------------------
Thanks a lot 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 I could modify the package, as you suggested.
I think I am gonna retrieve the class name from the node and check what class it belongs to. Thanks a lot. :)

--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/806501#806501]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...