Skip to main content
Question 1: I've got an optional activity that can have multiple instances. We are using an InfoPath form with a repeating item. If you fill in the item with user info, then add another and fill it in, it will create 2 instances of the activity.

Each person gets a task to approve. However, when one person does their approval, the other instance of that task (for the other person) changes status to Expired. How do I prevent this from happening?

Question 2: When passing control to another workflow process, the folio is not carried over. All the process datafields and InfoPath XML Schema are passed, yet the folio is blank in the SP K2 Tasklist.

Does anyone know how to overcome these problems?
Hi,

1. You will need to create a slot for each destination if you want all users configured as destination users to act on the item. You will also need to configure special succeeding and line rules. You can check the K2 help file for more info on that.

2. There's no direct way I that I'm aware of to set the folio of the child process to be the same as the parent process. A quick workaround would be to create an activity variable in the activity that hosts the IPC event, populate the field using the parent process's folio in a server event:
.Value = K2.ProcessInstance.Folio;

And then configure the folio in the IPC event (below the server event of course) to use the activity datafield populated above.
Thanks, DC.

We are using code in the activity destination rule to generate multiple instances of this activity, and to assign them to multiple people.


strTemp1 = K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value
objNodeList = SourceCode.K2Utilities.XMLFieldMod.GetXMLNodeList(strTemp1, _
"my:myFields/my:OptionalApprovalsAndReviews/" & _
"OptionalDeptLevelApprovalsPriorToDeptSuptGroup/" & _
"OptionalDeptLevelApprovalsPriorToDeptSupt")

For Each xmlNode In objNodeList
For Each PropNode In xmlNode.ChildNodes
If PropNode.LocalName = "OptionalDeptLevelPriorToDeptSuptApproverUserID" Then

'determine if domainuserid exists. If so, this is a legitimate userid, so add this destination user
strTemp2 = split(PropNode.InnerText,"")
If ubound(strTemp2)>0 Then
K2.Destinations.Add(DestinationType.User, PropNode.InnerText)
End If
End If
Next
Next



It does create mulitple instances, and assigns workflow tasks to all designated people, but when one is approved the other expires and halts the workflow. We need it such that all instances must be approved before the workflow continues.

In addition, only the first optional person listed gets an email - the rest of them don't even though they get a workflow task assignment.
You will still need to create a destination slot for each assigned destination (right-click the activity, select "Properties" and select the "Create a slot for each destination" radio button).

Remember to create applicable succeeding and line rules too.

Reply