In a K2 process that is designed to run SharePoint Integration Client Events in parallel, the following issues have been experienced if all the events have the same name and the "All at Once" planning option per destination set is selected:
- When the user actions the first event in the K2 process all the other events will also complete irrespective of the assigned destination user.
- If, for example, five SharePoint Client Events are created as shown in the image below, and each event is assigned a different destination user, at runtime five worklist items will be created in the K2 worklist. However, in the SharePoint Workflow Status page only three will be visible.
Note: For running instances there are manual steps required to ensure that the instances continue to function as normal after this hotfix has been applied. These steps are detailed in the Error Resolution section below.
|Note: The circumstances described in this article are one scenario under which this issue may, or is known to occur. The description is intended to be specific to the scenario described and does not take into account all possible scenarios or circumstances.|
To reproduce this error:
- Create a SharePoint Workflow Integrated process containing multiple parallel SharePoint Workflow Integrated Client Events. Give all the events the same name.
- Integrate the process with a SharePoint document library and configure it to start automatically when a new item is added to the library.
- Assign a different destination user to each of the parallel activities containing the SharePoint Client Events.
- Start an instance of the K2 process.
- Worklist items will be created successfully for each of the different destination users and will be visible in their individual K2 Worklists.
- Browse to the Workflow Status page in SharePoint and notice that not all the items are listed. There will be some items missing.
No Error message is displayed. Worklist items will be missing.
This Hotfix is contained within the latest K2 Update.
- Install the update package to resolve the error.
- To avoid an “Object Reference not set to an instance” error occurring on running instances after installing the hotfix, it is necessary to update the Design Templates and redeploy the processes.
Complete the following steps to update the Design Template:
- Open the existing process in K2 Designer for Visual Studio or K2 Studio.
- Right-click on the design canvas and select ‘Update Design Template’.
- Select the items to be updated by checking the relevant check box.
- Click Finish.
- Save and redeploy the process.
If an existing process instance is actioned before the Design Template is updated an Object reference error will occur. In this instance a GOTO the next activity will be required for the process to continue.
To perform a GOTO follow the steps below:
- Open K2 Workspace >K2 Management Console >Workflow Server> Instances.
- Select the instance that is causing the Object Reference error.
- Click on the Goto Activity button displayed on the menu bar.
- Click on the Activity that the process instance is to be taken to.