sherenegladysj - Monday, October 19, 2009 5:29 AM:
Hello all,
Can anyone please let me know how to delegate an activity to a group identity in a workflow and waiting for everyone's approval before it moves on to next activity?
I have enabled "Wait for all Votes", "Wait for all Inputs", "Required", "For all member" option in that activity. But none of the option works after delegating the activity...
Should I write code to handle this? Please help me to resolve this....
Thanks & Regards,
Sherene.
tstickel - Tuesday, October 20, 2009 1:25 PM:
I did some quick experiments on this and I could not find an easy way to do what you are looking for. The key issue is that Innovator automatically sets the for_all_members = "0" on the new activity assignment that it creates when you do a delegation. It does not matter what the for_all_members was set to in the original activity assignment. Also it appears that once the new (delegated) activity assignment is created it does no good to set its for_all_members = "1". I tried this using a SQL command and had no affect.
I suspect that it might be possible to write a server method that could deal with this problem, but there appears to be a couple of hurdles:
1. What will trigger this server method? You might try a "On Delegate" server method for the Activity in question. I suspect that it will be triggered before Innovator disables the original activity assignment and creates the new (delegated) activity assignment. The method could create your own new (delegated) activity assignments at this point. But, that may not be trivial as you may have to do your own "Identity explosion" for the group that is being delegated to. That is, you may have to determine which users belong to the group Identity. If you get over this hurdle you might still have to do something to keep Innovator from also creating the new (delegated) activity assignment that it was already going to create. I have no idea how that might be accomplished!! [Additional information added on 10/21 - The "On Delegate" server method receives an Activity item as its Me object. There are 2 additional properties in the Me object, AssignmentId and ToAssignmentId, which point to the ids of the "delegated from" and "delegated to" Activity Assignments, respectively. I tried updating the for_all_members in the item pointed to by ToAssignmentId in this method and it did set the property, but it did not cause Innovator to automatically do the "identity explosion" to create assignments for all members of the Group Identity. There is good news in that it appears feasible for the "On Delegate method to mark the Group Assignment that Innovator automatically creates as "is_disabled" and do your own "identity explosion". I will continue to experiment with this in my spare time.]
2. The other trigger you might try is a "On Vote" server method for the Activity in question. But this would also be complicated. Briefly, this server method would have to check to see if the assignment that is being voted on was the result of a delegation and, if so, create the additional assignments that are need. E.g. If Vote Group is an Identity composed of Person1, Person2, and Person3. Then when Person1 votes on the delegated assignment the server method would create assignments for Person2 and Person3. This would imply that Person2 and Person3 would not get a chance to vote until Person1 votes???
So my take on this is that you would have to really need this capability to put the effort into solving it. All of my tests were done in Innovator 9.0.1.
tstickel - Wednesday, October 21, 2009 2:09 PM:
Over lunch today I continued testing an "On Delegate" server method and was successful. As the code stands now it does not check that the Identity being delegated to actual represents a Group. It also has hard-coding for the identities that compose the Group to be delegated to (ie. it always delegates to Test1 and Test2 identities no matter which Identity you delegate to). But it does show that the concept is viable. Here's the code:
Dim myInnovator As Innovator = Me.getInnovator()
Dim newAssignId As String = Me.getProperty("ToAssignmentId")
Dim newAssignItem As Item = myInnovator.newItem("Activity Assignment","get")
newAssignItem.setProperty("id",newAssignId)
Dim actVarValue As Item = myInnovator.newItem("Activity Variable Value","get") 'This will get any Activity Variables associated with the Assignment
actVarValue.setAttribute("select","variable(name),value")
newAssignItem.addRelationship(actVarValue)
newAssignItem = newAssignItem.apply()
Dim explodeAssignItem As Item = newAssignItem.clone(True)
explodeAssignItem.setProperty("related_id","87A9DC9FA32844378AD28A9B0C56ACBC") 'This is Test1 Identity
explodeAssignItem.setProperty("voting_weight",50)
Dim res As Item = explodeAssignItem.apply()
explodeAssignItem= newAssignItem.clone(True)
explodeAssignItem.setProperty("related_id","7E67FA920287417EBC9A47A1681E32AF") 'This is Test2 Identity
explodeAssignItem.setProperty("voting_weight",50)
res = explodeAssignItem.apply()
Dim updateNewAssign As Item = myInnovator.newItem("Activity Assignment","edit")
updateNewAssign.setID(newAssignId)
updateNewAssign.setProperty("is_disabled","1")
res = updateNewAssign.apply()