-
1. Re: How to get taskId defined in BPMN file
swiderski.maciej Apr 23, 2012 3:38 AM (in response to devinderpal)If you would like to get this in on-entry or on-exit action I believe you could do something like this:
kcontext.getNodeInstance().getNode().getId();
HTH
-
2. Re: How to get taskId defined in BPMN file
devinderpal Apr 27, 2012 6:32 AM (in response to swiderski.maciej)But this method doesn't return string id specified in bpmn file. It returns some long value. Please let me know if you have any other ideas.
-
3. Re: How to get taskId defined in BPMN file
salaboy21 Apr 27, 2012 6:33 AM (in response to devinderpal)Why do you want that ID? I'm sure that you can resolve your problem without it I just want to know the background of your request in order to understand if you are approaching it correctly.
Cheers
-
4. Re: How to get taskId defined in BPMN file
swiderski.maciej Apr 27, 2012 6:47 AM (in response to devinderpal)aaa, right to get the id from the bpmn tag you should use:
kcontext.getNodeInstance().getNode()
.getMetaData("UniqueId");but Mauricio point is very good cheers
-
5. Re: How to get taskId defined in BPMN file
salaboy21 Apr 27, 2012 6:54 AM (in response to swiderski.maciej)hehe.. I think maciej get the background of my question.. If you base your application on the model internal IDs and then you someone changes the model, remove and add a node later on, you application which uses the models ID will explode in a billon pieces to put it in a nice way
-
6. Re: How to get taskId defined in BPMN file
devinderpal Apr 27, 2012 11:46 AM (in response to salaboy21)I want to keep some mapping between web pages to be shown and corresponding id defined in BPMN file. I want to show a different web page for user to feed in data based on what human task is pending. Once I define this mapping, I can get HTML page to be shown based on the id of the pending human task. ID defined in BPMN file is the only task ID I have. Other long IDs that are generated by jBPM engine can't be used for this mapping, as I don't know what's the algorithm for generating those IDs. And I didn't really get your logic of why application with blow up. IDs are defined manually by a developer who writes the BPMN file, why will it change while adding other nodes?
-
7. Re: How to get taskId defined in BPMN file
devinderpal Apr 27, 2012 3:43 PM (in response to devinderpal)Thanks Maciej,
It works!
-
8. Re: How to get taskId defined in BPMN file
salaboy21 Apr 27, 2012 7:04 PM (in response to devinderpal)"I want to keep some mapping between web pages to be shown and corresponding id defined in BPMN file" That doesn't sounds as a good idea...
When you say: "IDs are defined manually by a developer who writes the BPMN file" this is true when you have a controlled scenario that will never change. The IDs will change because if you remove and add a new one with the graphical editor the ID will be incremented and the new node will not have the old ID. As you mention you cannot rely on the other ID (the long one) because you don't know the algorithm used to generate that. You are creating a strong binding from the process to the BPMN file which is not a good idea. Why not using a Task List Oriented Approach, where the user picks the tasks from a list of pending tasks, and if the user just have one task, that task is automatically displayed?
Cheers
-
9. Re: How to get taskId defined in BPMN file
devinderpal Jun 25, 2012 4:12 PM (in response to salaboy21)i have been using Eclipse based BPMN editor, one mentioned in jBPM docs, and it never changes the task IDs already defined in the BPMN file. It would be a bad idea for any editor to change existing IDs of BPMN file when a file in imported. In my view, it's will be a bad editor design. Hopefully, we wouldn't come across that kind of editor
-
10. Re: How to get taskId defined in BPMN file
gigazhang Jun 25, 2012 9:50 PM (in response to devinderpal)If I got the id,,maybe can create a path to any other node...