K2 Studio how to know who approved an activity with multiple approvals


Badge +2

Hello,

 

I have a workflow with an activity which requires 2 people to approve before progressing.  When a user approves I want to log a history entry in my SmartObject with their name.  How would I go about getting access to this information from within the workflow?

 

To be clear I would expect 2 records in my history table, one for each person who approves.

 

Thanks in advance

 

 

Matt


7 replies

Badge +10

The built in smartbjects should contain all this information. If you look at the Activity Instance Destination Smartobject under the Workflow Reports category. When you passin a ProcessInstance ID it wil show you all the activities and the FInal Action coloumn shoul shouw you what action was taken by the person assigned that task. Hope this helps.

Badge +2

Thanks someone!

 

I can see from the smart object tester that this is exactly what I need, but when I try and pull the data out using a SmartObject event it looks promising, but at runtime I'm getting a "Object reference not set to an instance of an object." error.

 

Could this be because I'm logging a result from a list method into a single variable?

 

Thanks

 

 

Matt

Badge +10

It could be but I have not had that problem before. When I have mapped a list return properties to a single field, it has always taken the last value passed by the list method. Not sure how you are using the method and the purpose. if you could show that, then we can maybe come to a workaround.

 

Thanks

Badge +2

It's really odd, but I can't get anything out of this object at all from within a workflow even thought the smartobjecttester clearly shows that it has what i need... so frustrating!

 

I'm not getting an error now, I am just not getting any results...

 

I tried a Smart Object event and a Data Event calling the SmartObject, but neighter returned anything...

 

Could it be a security thing?

Badge +8

Yes, it could a security issue.  If the the user under which your process runs doesn't have View permissions on your process, you won't get any results from the Activity Instance Destination SmartObject.

Badge +2

Thank you @sbrownhuntoilco,

 

Works perfectly now, thank you!

Badge +2

Worth mentioning for others who read this in the future that I had to put in a 10 second delay before starting the stage.

 

I noted that sometimes no records were returned, sometimes only some rows and other times all the rows.

 

With a 10 second delay all records get picked up.

Reply