Question

How to: Multiple destination users??


Am creating an approval process. My requirement is to trigger a K2 BlackPearl workflow from infopath form. The user will select couple of users on the form who can approve. On submitting the infopath form the K2 workflow has to send this approval task to the approvers selected by the user on the form.


Now all the approvers has to APPROVE the process to continue OR atleast one approver has to REJECT the process to discontinue the workflow and send mail to the user.


How to handle this??? 


21 replies

Create a repeating xml field on the infopath form which will have the users selected in the following format


<Approvers>


<Approver>K2:Domain-NameUserName1</Approver>


<Approver>K2:Domain-NameUserName2</Approver>


</Approvers>


 


Now for configuring the workflow as you said..


Create a activity and go to its properties and click on users tab(blue color icon) and click back and select "run in advanced mode" and configure the workflow as follows


1) select Plan per destination- All at once


2) Then for destination set the <Approver> field.


3) create the approve and decline outcomes in the client activity


Configure All Slots of ActionResult = Approved for Approval Outcome


Configure At Least 1 Slot of ActionResult = Declined for Decline Outcome

Great explanation maxpirate.

There's an example of much of what maxpirate explains here:

http://k2underground.com/blogs/fromthebench/archive/2008/05/22/activity-destination-users-based-upon-a-repeating-xml-element.aspx

This example does not cover the slots which maxpirate explains well.  The slots configuration is important as that permits the complex outcome logic.

Hi maxpirate,


Thx much. Am gonna try this. Will revert to you with the outcome.

Hi Bob,


Your link comes handy with gr8 help. Thanks.

Thanks Bob.


 

Hi Maxpirate,


Am creating the sample flow as in K2 Documentation - Expense Claim using infopath. I follow your instructions to configure


1. Destination Rule Options


I have included 3 destination users for the activity. Task items are created for the users but if one of the user 'Decline' the process then for ohter users the task list item is still existing.

Hi Maxpirate,


Am creating the sample flow as in K2 Documentation - Expense Claim using infopath. I follow your instructions to configure


1. Destination Rule Options


I have included 3 destination users for the activity. Task items are created for the users but if one of the user 'Decline' the process then for ohter users the task list item is still existing.

did u configure the outcomes as i said??

I did the following configutaion: 


Destination Rule Options
->Plan per destination
 ->All at once


THEN
 ->Create a slot for each destination -selected
 ->Create a slot for each role and group -selected


THEN


  ->a destination user set is created which consists of 3 users.


 When i run this workflow,,, tasks are being created for all 3 users. But if either of the user 'DECLINE' the process, rest of the users task list is still showing the task item on their list.


How to prevent this?


Thanks.

Are they able to open the task in worklist and action it? 


Did you configure the decline outcome as 'Atleast 1 Slot of action result =  declined' ?

currently unable to open the task item from worklist. but just by selecting the task (chkbox) in worklist and by selecting Action from dropdown am testing it.


Am not clear on configuring the outcome as 'Atleast 1 Slot of action result =  declined'. Where & how do i need to do this?


THANKS

ezaz,


The worklist does not auto refresh itself once the item has been actioned.. try refreshing the worklist and let me know if the problem still persists

No luck max, Even after refreshing the worklist also the task item is still there for user2 eventhough user1 has rejected the approval process. 

I got it max. Thank you very much for supporting me.


CHEERS

Glad that you have got it.

Where did you go wrong in the earlier implementation??

The outcom rule was not properly configured. Thx much max.


Since we discussed work list earlier, i have an issue with Opening InfoPath task from the list. When i click on task item to open the InfoPath form this is the error:


Server was unable to process request. ---> List could not be found in specified site. ---> Value does not fall within the expected range. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at SourceCode.SharePoint.WebServices.K2SPFiles.UploadDocument(String listNameOrTitle, String folderUrl, String fileName, Byte[] oByte, Boolean overWrite, String xmlMetadataFields) at SourceCode.Workflow.RuntimeServices.OpenInfoPathTask.OpenFormsServerPage(String infoPathFormData, String fileName) at SourceCode.Workflow.RuntimeServices.OpenInfoPathTask.OpenSharePointLocation(WorklistItem wli, String xmlFieldName, String libURL, Boolean openAsWebPage, String spSiteURL, Boolean isSingleInstance) at SourceCode.Workflow.RuntimeServices.OpenInfoPathTask.Page_Load(Object sender, EventArgs e) System.Object[] ReadResponse(System.Web.Services.Protocols.SoapClientMessage, System.Net.WebResponse, System.IO.Stream, Boolean)


Please contact your administrator.


Any clue?

Yes, i know this error.. the infopath xml which needs to be actioned is not found in the library that u have deployed your form to.. please check the process again..

K2 uploads the infopath xml to the document library to which the process was deployed to..

During the Infopath client event, i've created a new form library and deployed my Infopath form to this. So by rite Infopath xml should exist there. Its just guess of mine. Is it otherwise? If yes, what is the work around?


Thx max.

It would exist in the form library specified at the time of infopath integration

I have the exact error.  Can you tell me how I see if the xml is in the document library

After the client event triggered, the xml would be present in the form library

Reply