-
1. Re: User Task Assignment and Assignment Restrictions
jemmerling Jan 13, 2012 8:46 AM (in response to charliebarjel)Here is a code snippet from the Human Task Example in jbpm-examples that accesses content via the API. Is this what you have in mind?
BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
taskClient.getTask(task4.getId(), getTaskResponseHandler);
Task task = getTaskResponseHandler.getTask();
BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
taskClient.getContent(task.getTaskData().getDocumentContentId(), getContentResponseHandler);
Content content = getContentResponseHandler.getContent();
ByteArrayInputStream bis = new ByteArrayInputStream(content.getContent());
ObjectInputStream in;
try {
in = new ObjectInputStream(bis);
Object result = in.readObject();
in.close();
Map<?, ?> map = (Map<?, ?>) result;
for (Map.Entry<?, ?> entry: map.entrySet()) {
System.out.println(entry.getKey() + " = " + entry.getValue());
}
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} -
2. Re: User Task Assignment and Assignment Restrictions
charliebarjel Jan 24, 2012 5:47 PM (in response to jemmerling)So I guess I can place "flow" data into the Content of each User Task indicating the next possible steps. That way, I can dynamically render pages for users depending on the current task, and the next possible outcome?
Do you think this is the best approach?
For example, when a user loads their task, say a REVIEW task, I want to dynamically determine what are the next possible outcomes (APPROVE -> Go to Test, REJECT -> Go back to development) and display those buttons on the screen for the user.
Is the Content field, the best place to store this information?
Thanks in advance.
Charlie
-
3. Re: User Task Assignment and Assignment Restrictions
melc Jan 25, 2012 5:30 AM (in response to charliebarjel)Hello,
You could also use process variables i.e. have a colleciton with possible outcomes that gets populated on the entry action of each task.
The advantage of these approaches is the simplicity in implementing them, however the downside is that you enter data to your process that is already there.... if i understand correctly. So i guess it would be best to just use the data that is already defined within your bpmn.
Have you tried traversing your process and examine each of the nodes to see whether you can retrieve such data?
Take a look at the following post on how to traverse your process,
-
4. Re: User Task Assignment and Assignment Restrictions
charliebarjel Jan 29, 2012 7:52 PM (in response to melc)Thanks.
I will traverse the process to achieve what I need.
Charlie