Skip to main content

Hi all,

 

I am trying to set up a workflow in Studio where a new list item - call them Incidents -  will kick off the workflow (done) and perform the following actions.  I have a list that represents various users assined to divisions (list has user, division fields).  That list I have exposed through a SmartObject and then through a K2 Role.

 

My goal is ultimately to email all the users in the role that are assigned to a specific division (which is selected when the Incident is created). 

 

Right now I'm just trying to email all of the users in the role as a first step and can't get that working.

 

I have a Default Activity with a Client Event setup.  In that Client Event's Destination Rules I have chosen Plan per Destination "All at Once" then "Create a slot for each destination" and "Resolve all roles and groups to users".  In my Destination Set I chose to try the Role itself for now thinking that would just email all of the Users in the Role.  Later on I will figure out how to filter on Division and take the same basic approach - email all of the users in the Role tied to a Division.

 

Am I on the right path here?

 

I deploy my workflow and the error states "An activity with a Client Event should have at least one destination".

 

Any hand holding is greatly appreciate - I'm a total K2 NOOB.

 

Thank you!!!!

Hi afpkennett

 

There are a couple of things to remember here.

 

  1. The Role must have members in it
  2. The K2 Identity Service will only update the Role membership every 8 hours (by default)

This means if you add users to a role they will not automatically show up when you query the role membership in workflow.

 

There is a tool you can get from K2 market  that will refresh Role membership.

 

http://community.k2.com/t5/General-K2-Utilities/Force-Identity-Service-Refresh/ba-p/74061

 

 


Hi Andrew,

 

Thanks for the response.  The role has users in it and it has been longer than 8 hours (been a few days actually).

 

 


Hi afpkennett

 

You say in your post you have a list that you have exposed as a SmartObject and then as a K2 Role. I assume you are referring to a SharePoint list? Have you used a SmartObject method to return the names from this list as the Role Item? If so, this might be your problem as K2 may not be able to convert the list property you are returning to a "User".

 

You can create a "User" SmartObject that you can use to return the list of users in a Role. This is useful to troubleshoot Role issues.

 

In the SmartObject Tester find the "User Role Manager Service" and expand it and then expand the "URM Service". Under this find the "User" service object, right click and create a SmartObject from it (you can call it User or whatever you want).

 

This User SmartObject has a method called "Get Role Users" that will accept the name of a Role as input. Execute this in the Smartobject tester with the name of your Role to see what gets returned - if its empty then this is why your workflow is erroring.


Hi Andrew - thank you for your response I appreciate it.

 

Yes sorry - the list is a SharePoint list.  I used the SO tester to return the User(s) thorugh the Get List Items method and I directed the SmartObject to use this method and return my User(s) (Value).

 

I will take a look at your suggested approach and let  you know how it goes.  I guess I don't understand why I can't use the SmartObject that was created on top of the SP List straight away given the SmartObject tester is returning the values.

 

Thanks again,

 

Andrew


Ok interesting - that Get Role User Names call on that URM returned no values.

 

I'm now looking at the setup of the Role itself.  It is setup on the "List Name" SmartObject (not the Attachments or the third one List Name List).  I have it pointing at the GetListItems method.  It is returning the User (Values) value.

 

Something is obviously wrong in that approach......


In your sharepoint list Person column are you allowing multiple entries?  If so this could definitely be the issue. Even with single entries this could be a problem.

 

I have never tried this approach, but I know sometimes K2 has trouble converting "Person" values in SharePoint to a K2 user. I think this is because the users in SharePoint are stored as IDs.


Well that stinks.

 

I'm using a single value'd Person field.  I really wanted to allow the users to maintain their own lists as they pertain to workflow.  Am I just barking up the wrong tree here?  Its funny because if you hover over the person in the SP list, you see their email.


Try using a SharePoint Group instead. It's perhaps not as user friendly but it will work easily with K2.


Reply