-
1. Re: How to retrieve the current workitem (or node)?
salaboy21 Aug 29, 2011 9:12 AM (in response to d.y.)What is exactly your use case ? why do you want to get the current workitem? Usually work items are external interactions with external systems.
If you take a look there is another thread that says how to get the current node of the process, but you usually don't need to do that.
If you can explain what do you want to achieve from the business level we can help you out.
Cheers
-
2. Re: How to retrieve the current workitem (or node)?
melc Aug 29, 2011 9:15 AM (in response to d.y.)1 of 1 people found this helpful -
3. Re: How to retrieve the current workitem (or node)?
d.y. Aug 29, 2011 9:48 AM (in response to melc)Thank you chris, that kinda helped.
Mauricio: Probably i didn't get yet the difference between node and workitem.
What I want to do is to retrieve the current node of a process so i can see what nodes have been passed and what nodes are yet to be done.
-
4. Re: How to retrieve the current workitem (or node)?
salaboy21 Aug 29, 2011 10:06 AM (in response to d.y.)You can get that information from the history logs instead of getting it from runtime. The main idea of the history logs is to decouple the runtime environment to the query information capabilities that you will use in your application to show the process status.
Cheers
-
5. Re: How to retrieve the current workitem (or node)?
melc Aug 29, 2011 10:21 AM (in response to d.y.)Hi,
If you want to retrieve all nodes of the process (besides the active ones ; i guess you try to display a percentage of completion or at what stage of the process you're at ....) you can use the KnowledgeBase object and getProcess(..) , cast to WorkflowProcess and call getNodes().
-
6. Re: How to retrieve the current workitem (or node)?
d.y. Aug 29, 2011 10:35 AM (in response to melc)Yes, i want to display the previous task and the upcoming tasks (nodes?) of a process.
If I'm right the method getNodes() returns an array of all the nodes that are in that process. Should I go through the array and check if any of that is the active one or is there a better way to go?
-
7. Re: How to retrieve the current workitem (or node)?
melc Aug 29, 2011 2:42 PM (in response to d.y.)Hi,
Yes exactly, you could retrieve the active nodes and then all the nodes and compare them until you find the active ones.