Hello,
I have a main page where I added the WorkItemContext by dragging a process variable to the main page, saving, and deleting it. This main page goes to a partial page where I can create a record. In the controller where the record is being saved, I assigned values to a the process variables in the workItemContext. In the debugger, I can see that it's being assigned and saved. However, when the controller goes back to the main page's controller, all of the data int he workItemContext is cleared. In the debugger, all of the data is still stored during prepareForm Controller (which is the controller for the main page), all the way until it hits the Transform_Web_Page section.
Is there something that I need to configure in order for the WorkItemContext to be saved?
I have a main page where I added the WorkItemContext by dragging a process variable to the main page, saving, and deleting it. This main page goes to a partial page where I can create a record. In the controller where the record is being saved, I assigned values to a the process variables in the workItemContext. In the debugger, I can see that it's being assigned and saved. However, when the controller goes back to the main page's controller, all of the data int he workItemContext is cleared. In the debugger, all of the data is still stored during prepareForm Controller (which is the controller for the main page), all the way until it hits the Transform_Web_Page section.
Is there something that I need to configure in order for the WorkItemContext to be saved?
RE: WorkItemContext data is cleared
When you open the form from BizFlow it first retrieves the Workitem Context information and then caches it away. When a form is submitted, by default it sends back an empty workitem context structure containing values just for the PVs on the form. This is then merged with the cached information to get the latest version.
As your PV changes made in the controller are not in the cache this is probably why they are being lost. If so, you need to either make sure that the cached PV data is updated as well, or make sure these new values get submitted from the page.
For the first approach have a look at the second option suggested in this post: http://www.hyfinity.com/node/343
To get the values to be submitted form your page you could add a hidden field for each one that is bound to the correct PV locations.
Alternatively change the 'Advanced Binding Mode Options' for the submission action from the page. Firstly edit the 'output data' document (eg calling_xxxx_action.xml) and remove the blank WorkitemContext structure. Then choose the +?+?++Maintain Additional Data+?+?+? option and enter in an XPath of '/mvc:eForm/mvc :D ata/Workitemcontext'.
This should ensure that the page submits the full workitem context information to this action, rather than a blank structure. The values changed on the form will then be placed on top of this structure.
I hope this makes sense and is useful.
Let me know if you have any questions, or if I have misunderstood what your issue is.
Regards,
Gerard