Skip to main content

I have a situation that I'm hoping someone has seen before or knows how to fix.


 I have an Infopath form with a repeating table that someone fills out country information in each row.  I have custom code that determines the user destination based on country by looping through each row of the table.  With that, when the person filling out this repeating table submits, an email is sent out to an approver for each country with a link back to the form.  Those approvers must then select the row in the table with their country, review the information, select approve, reject, etc, and then submit, all in parallel with the other approvers.


 Problem is when one approver opens the form and approves their country, and another does the same at the same time, that first user's approval won't be reflected and appears to be overwritten when the second approves and submits.


Ideally I'd like for only the section of the repeating table with the pertinent country information to be sent to each approver, and then all merged back together once everyone approves, but I'm not sure if this should be done in K2 or Infopath.


 Anyone have any suggestions?  Is there a better way to do what I'm doing?


 Thanks for your help and let me know if I need to clarify more.  

I would suggest using a parallel workflow and multiple views for what you are trying to accomplish. Then each approver gets a different view with only the information that pertains to them. I can't guarantee that it would work though. May still have the same issue with overwriting.


 In that case maybe you could spread it out a little. What I mean by that is go down the list of the approvers and when one approves then the next step in the workflow would be to notify the next approver that they need to review the document and so on. Might be too much if you are having many different approvers.


This is how I would do it: (involves writing code)


The problem is that K2 creates an individual XML file for each destination user. When any user finishes a task, the entire document XML is copied to the Process XML field - which is why you see the overwrite behaviour.


This happens in the Succeeding Rule of the InfoPath Activity, and this code is executed everytime a user finishes his task.


You will have to modify the code in there to not do a complete copy of the Activity XML to the Process XML, but rather only update the approval value for that user.


On the Form itself, you can use InfoPath Rules to Hide elements if a condition is true or not, use the K2 InfoPath web service supplied with K2 and use the whoami method to figure out who the user is and then only show his country.


 


Reply