Tasks Initialize method for Business Data

I like to initialize some values of my Business Data Output with values from Business Data Input. The Output should be visible and changeable in the task portlet view.

So I draged my output values to the task portlet view and try to initialize the values by using Data Flow Implementation of the Initialize method. Should work in my opinion.

But when I watch this on My webMethods Server, the input controls are empty :?:. Some dirty test with System.out in the Initialize method bare that the values are initialized with the right values, but they are not displayed in the task. Value Expressions for the control and System.out are the same.

What’s going wrong?

It is not very clear what you are trying to do. Most of the time there is no separation between input and output documents for the task business data. If document comes from business process it is both input and output. e.g. the same document which gets into the task also gets out. There are some cases when you may need some internal task data which may be not part of this document, then you can set these field both not input and not output e.g. they are never interfaced with business process

Said that you have for example Order as input and output document of the task which comes from business process. Then in the task details view you should be able to create UI controls and bind their Value to the corresponding fields of the Order document.

The exercise to figure out whats possible was to get a Order Document Type as input and a Invoice Document Type as output.

My idea was to initialize the Invoice Document Type with the Initialize Method. By now I get that doesn’t work cause of instance pooling.

Now I see two solutions. The first is to integrate both Document Types in the UI and to transfer data with button controls. The second and easier one is to change the Input Document Type to invoice.

Thanks a lot!

Hi Daniel,

in order to update Task Data, you need to first “accept” the task before. Could it be that you have not accepted the task prior to setting the values in the output document?

Hope this helps,

Hi Javier,

I accepted. Anyway, there was no change to my output document, when I called an action.
But I discovered by myself to call views applyChanges method. This method writes changed task data irrevocable to my business data.
Is that the proper way and is it somewhere documented?

Thanks for any hints,

Another way of dealing with it would be to initialize output document from the input document in the task Queued event (which would fire only once when task is first queued).

Then in the UI you can allow modifications only on output document fields (and display input as necessary).

Once task is completed TE should return to ProcessEngine only output document.