-
1. Re: Comment for proccessInstance
aguizar Nov 12, 2005 3:06 PM (in response to gwittwer)Comments are added by actors and scoped to a task. A task instance has an actor, hence this actor may add comments.
The creation of a process instance is not always associated with an actor. If it is, then it has a start task, and the comment would belong to that task.
If you want a comment viewable from all tasks, you can use a variable, have the initial actor write it, and then read it in other tasks. -
2. Re: Comment for proccessInstance
kukeltje Nov 12, 2005 8:36 PM (in response to gwittwer)hmm.. not completely true Alex. On one of my jBPM journeys, I did this:
myComment="any text"; context.getProcessInstance().getRootToken().addComment(myComment.toString());
It add's info to the token, and since the root token is kind of the basis for the process instance. It works.
In the tasklist I do:<h:outputText value="#{taskInstance.token.processInstance.rootToken.comments[0].message}" />
If you add more comments, you can use [1], [2]
I'm not saying this is better then using a variable, but is does kind of work good, and you do not have to define the variable in each task. -
3. Re: Comment for proccessInstance
gwittwer Nov 13, 2005 9:01 AM (in response to gwittwer)Hello
Thanks for your solutions.
I think the second solution (Ronald's) is the better one. I don't like to do this with variables, because it's something like a descpription of the actual process instance (to show not just the name of the open tasks in the webapplication) and should not change the processdefinition.xml (in my case create with an own application, by different users). I don't like to extend my application with the constraint, that every task must have a comment-variable, because the application should be upgradeable for other BPM's.
I will test the "root-token-case".
Thank you
Gerhard