Skip to main content

I have requirement to add users dynamically. Let me explain my requirement little clear.


I have a infoPath Form which need to go through multiple approver Groups. For say, Once user submit the form it should go to Goup 1 approvers (A,B,C) and once every one in that group approves, it should go to Group 2 approvers (X,Y,Z)and so on. Until this part i am able to implemeted. But more tricky part is,  One of the Group 1 Approver (Person A) can add more approvers if he/she feels that other   person (D) has to approve the request. In this case Email should send to approver D only. If any person already approves or got an email, they should not get any email again because they already approved or received.


How can I implement the above requirement?


I hope i expalined my requirement clearly. If not let me know.  


Thanks In advance.


 

Use a smart object to save additional approvers to the database if additional approvers are specified in your InfoPath form.  Then, the next step will be to concatenate your list of 'normal' approvers with the additional approvers from your smart object (send the e-mail here for each additional user) into a repeating node XML structure (each node represents an approver's account).  Assign your task to that xml structure, and each account in there will get the task to approve.


I'm being pretty vague, as usual, but I hope it helps point you in a direction for the correct solution


Tim Byrne,


Thanks for your reply. I am not using smartObject to save the Approvers instead I am using Infopath Repeating table. Basically i am not sure how to save the Repeating table data in Smart object. I would appreciate if you give some ideas on this too.


The solution you mentioned above was not cleared to me (sorry i am new to K2). Is it possible to give me more details or some sample codes.


I too have a same problem. I am tring to implement this in smart object, could you please tell us how to use this smart object in K2 with an example?

Tim,


Can you explain more detail, how to concatenate list of 'normal' approvers with the additional approvers from your smart object into a repeating node XML structure?


 


I haven't forgotten you guys, I'll try and put something together for you that will be easier to follow than my vague instructions. 


Basically, you want to load your approvers into a simple xml structure like this:


<approvers>


<approver>;account name]</approver>


<approver>;account name]</approver>


<approvers>


And it would be a two step process to do so - first you'd get your normal approvers into this structure and then loop through the additional approvers and append to it.  Then, in your destination rule, you can assign the task to this xml structure and it will create the task for the account in each 'approver' node.


Tim,


Thanks for your time and i really apreciate it. I still confuse to where i need to write a code or configure to Loop through Smart Object and concatinate with already existing approver list.


Just before your activity that you want to assign to the extended list of approvers, and just after the InfoPath client activity where the user added the extra users, make a new activity with a destination rule based on your SmartObject 'GetList'.  Within this activity, make a server code event that appends the activity instance data to your list of approvers.  Not too sure where you have your list of existing approvers... that might help me to help you


Again, time permitting, I will try and write up something official on this matter as it comes up quite a bit.  That will take some time, though, so I will continue to try and help you one little step at a time.


I am storing my list of approvers in Smart Object. My question is, what happend if current activity Approver want to add more approvers to approve same activity?


 


16914iC9384C44AF164B50.png

Hi Vijayakumar,


I have data in Sql server database, how do i populate that into smartobject depending on the control selected in Infopath and selected data i need to set it as destnation user in infopath client event at k2 workflow.


Could you please explain me how do i integrate sql server database to smarobject, the same i need to use for dropdown population in infopath.. 


 


Ah, I see... I didn't realize you were trying to affect the approvers of the current activity... what I would suggest, is that you make an action off of that activity for 'Updated Approvers' or something.  When the user selects this action, have the process save the new approvers and reload them, then route it right back to the original activity just with the updated approvers list.  The downside here is that the task will disappear from the approver's queue for a moment while the 'Updated Approvers' action is processed

Madhan,


Sorry, I did not get a chance to work with SQL Server and K2. So i am not sure how to do it but i know that it is possible. When ever i get a chance i will look into it. Once again i am sorry that i am not able to help you.


Tim,


I did as you said, created a new action called "Added More Approvers", and pointed to the same activity. It works but i have couple of concerns here.


1. Approvers has to select this action "Added More approvers" if they want to add more users and then he /she has to open the form to Approve or Reject the form. There is no single step. So, it confiuse user and makes a training issue.


2. I used smart object to store all approvers(Old and new approvers). So, it sends mail again to both old and new users which i dont want. Mail should send to only newly added approvers.


 


Please advise me, is there any way i can achieve myrequirement ?


 


 


1)  You can make the 'Reject' action path also invoke 'add more approvers'.  That way, any approvers they have added in the form will get saved on a reject and that can be part of your business process (you have to reject the item if it needs more approval).  You can also make the 'Added More Approvers' linked to a 'Save' button on your form, so it is more intuitive to the user to open the form, add new approvers, click save.


2)  That is a tougher problem - if you take my first suggestion in #1 (save approvers on reject), we could potentially do away with the 'Added More Approvers' action all together, so in order for new approvers to be included, the user would have to approve or reject


Just a couple of ideas, let me know if they won't fit into what you are trying to accomplish and we can brainstorm some more 


 


Reply