Skip to main content


 

Symptoms


Consider this scenario at a customer:

We have a process with an activity which destinations should be planned all at once. The activity contains a client event which creates worklist items. The outcomes are defined as "If at least 1 of Action Result approves or rejects the work list item, the outcome of the activity will be approved or rejected".

Later in the process we need to get the user who caused the approval or rejection. My first try was to retrieve the user using the "Workflow Content BrowserActivity Destination InstanceUser" property. This worked well as long as the task was not delegated (haven't tested with redirection). When I delegated the task the property returned the original task owner. I then checked the default SmartObjects and found "Activity Instance Destination" and "Activity Slot Data". Both returned the data I needed in the SmartObjects - Services - Tester Tool.

I wanted to use the "Activity Instance Destination" SmO in the process to retrieve the completing user using the Process Instance ID, Activity Instance ID and the Status "Completed". At least this was my idea but then I stumbled across some strange behaviours:

a)
I created a test process with data fields, ActivityInstanceId, ProcessInstanceId, Status and DestinationUser. I used a data event to retrieve the destination user using the "Actiivity Instance Destination" SmartObject and store it to the DestinationUser. I configured the list method to retrieve the first item of the result.
When I start a new instance of the process, the data field DestinationUser contains no value. Depending on the values I use the SmartObjects Tester returns at least one row. If I use the same values in the process, the DestinationUser is empty in any case. I created a new test case to create new Destinations for each row returned. But this failed because the field destination contained no value.

b)
In my original test case I created a work list item with two destinations. The tester returns two rows:
Activity Instance Destination ID 31, Destination User domainusera
Activity Instance Destination ID 34, Destination User domainuserb

I delegated the worklist item of usera to userc. After userc completed the work list item the tester returned these rows:
Activity Instance Destination ID 31, Destination User domainusera
Activity Instance Destination ID 34, Destination User domainuserb
Activity Instance Destination ID 34, Destination User domainuserc

If the work list item of usera is delegated to userc and userc completes the task then the DestinationId of the new row should definitely not be the ID of userb.

Despite these strange behaviours my ultimate goal is to retrieve the user who completed the work list item.
 

Diagnoses


K2 Service account has admin privileges but most likely cannot see the reporting SmartObject data.
 

Resolution

On your workflow, please check if the current workflow server admin account (usually your K2 Service account) has View permissions on the process. The problem is most likely that even though K2Service is a workflow admin, it cannot see the reporting SmartObject data.




 
Be the first to reply!

Reply