We had an issue while updating the datafield values without executing the action in the application form. If we use ProcessInstance Update method, it was obvious that we need to provide the admin rights for all the users which is not an ideal solution. So we found in the K2 Blackpearl Arcticles that we can update the Data Fields with an Action seperately created for that with in the workflow defintion. The information is described below.
Updating Values within a K2 Process Instance KB Number:KB000307 Introduction When updating values (i.e. a data field) of a process instance without completing the process in pre-0807 releases of K2 blackpearl it was possible to use the [WorkListItem].[ProcessInstance].Update() method. In K2 blackpearl 0807 the [WorkListItem].[ProcessInstance].Update() method now requires a user with process Admin rights. Configure the Action in K2 Designer for Visual Studio The Add Action dialogue screen contains a radio button option that enables the Action to be updated without the Worklist item being completed: Click here to see the screen shot that shows the configuration for Save with action name UpdateWorkItem. This radio button must be selected in order to programatically update the value within a process instance. Update the Work Item Using the K2 API The recommended method uses an "update" action, as opposed to firing the ProcessInstance.Update() method, so will work without Admin permissions: SourceCode.Workflow.Client.WorklistItem wi; Remember that the Action must be configured using the This action will update the work item option during the design of the process, as demonstrated in the K2 Designer for Visual Studio section above. SourceCode.Workflow.Client.WorklistItem wi;
|
|