Discussion:
[jboss-user] [jBPM] - How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?
Thomas Setiabudi
2012-11-13 07:00:03 UTC
Permalink
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
Hi,

In our environment, we use JBPM5.3 as a service via JBPM-Console REST service.

when we call this REST:
/gwt-console-server/rs/tasks/{idRef}

The resulting JSON is something like this:
{
tasks:
  [
   {
    id:6,
    processInstanceId:11,
    processId:com.sample.evaluation,
    name:Performance Evaluation,
    assignee:thomas,
    isBlocking:true,
    isSignalling:false,
    outcomes:[],
    currentState:ASSIGNED,
    participantUsers:[],
    participantGroups:[],
    url:http://localhost:8080/gwt-console-server/rs/form/task/6/render,
    priority:0
   },
   {
    id:7,
    processInstanceId:11,
    processId:com.sample.evaluation,
    name:Performance Evaluation,
    assignee:thomas,
    isBlocking:true,
    isSignalling:false,
    outcomes:[],
    currentState:ASSIGNED,
    participantUsers:[],
    participantGroups:[],
    url:http://localhost:8080/gwt-console-server/rs/form/task/6/render,
    priority:0
   }
  ]
}



The outcomes field is always empty.. "outcomes":[]

is there any way to fill value to this field?

We have a requirement to add a custom field for every human task, and retrieve its value when we open personal task list.
We thought that maybe we can fill in the custom field in the JSON "outcomes" field.
is it possible? Or is there any other way? maybe like create a custom WorkItemHandler that extends the Human Task?


Any help is appreciated.


Regards,
Thomas Setiabudi
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2012-11-14 08:53:31 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
Thomas, I am afraid that without bit of implementation it won't be doable. I mean that you would need to extend existing console server functionality to add that.

Why using task variables is not a good way of achieving what you described? If it's same value for all tasks for given user task node then simply define it as constant value in task definition in data inputs, if it is dynamic use variable.

HTH
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Setiabudi
2012-11-26 02:17:36 UTC
Permalink
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
Hi,

Thanks Maciej, will give it a try..



Regards,
Thomas Setiabudi
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Setiabudi
2012-11-26 02:42:40 UTC
Permalink
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
Hi Maciej,

After I define my variable in data input for the task, how do I retrieve its value using TaskClient?



Regards,
Thomas Setiabudi
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2012-11-26 06:37:06 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
Thomas, first you need to get task and from it you get contentId of your inputs using task.getTaskData().getDocumentContentId(). Once you have it you use this id to get content using taskClinet.getContent() method. Note that you would need to use marshaller to get the object out if it.

HTH
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Thomas Setiabudi
2012-11-26 10:58:48 UTC
Permalink
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
Hi Maciej,

the code looks like this


BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
  taskClient.getContent(task.getTaskData().getDocumentContentId(), getContentResponseHandler);
 
  Content content = getContentResponseHandler.getContent();
 



inside content, I got only content.getContent() that will return byte[]

And the byte[] should be marshalled to? XML file?


Regards,
Thomas Setiabudi
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Chris Melas
2013-05-08 12:52:16 UTC
Permalink
Chris Melas [https://community.jboss.org/people/melc] created the discussion

"Re: How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
Hello,
Get object with data from content,

byte[] byteContent = content.getContent();
byteArrayInputStream = new ByteArrayInputStream(byteContent);
inputStream = new ObjectInputStream(byteArrayInputStream);
contentObject = inputStream.readObject();
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Sean Coetzee
2013-05-07 13:47:24 UTC
Permalink
Sean Coetzee [https://community.jboss.org/people/atomic_mass] created the discussion

"Re: How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
Hello,

I'm confused about what goes in the {idRef} parameter. Could you perhaps provice some direction?

Thanks,
Sean
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Chris Melas
2013-05-08 13:03:35 UTC
Permalink
Chris Melas [https://community.jboss.org/people/melc] created the discussion

"Re: How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
hi, just noticed the dates of this thread :)
so the  {idref} referes to the username of the user whose tasks you need to retrieve.
--------------------------------------------------------------

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

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Sean Coetzee
2013-05-08 13:15:59 UTC
Permalink
Sean Coetzee [https://community.jboss.org/people/atomic_mass] created the discussion

"Re: How to fill the value of "outcomes" field in JBPM-console JSON for Personal Task List?"

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

--------------------------------------------------------------
Thanks for that - should have been obvious :-)
I will try it out once I figure out the authentication for the service.
--------------------------------------------------------------

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

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