Repeating items in Infopath Schema

  • 28 July 2006
  • 1 reply
  • 0 views

Badge +8
I am working on developing a capability within our workflow app to allow the task owner to delegate the task to 1 or more persons, but I'm having trouble with the 'multiple' part of it.

The view for the workflow task will have a delegate button, and when that button is clicked it changes to a Delegate view, which contains a repeating table that will contain the names of the persons to which this task is delegated. There is a find button which does a lookup in Active Directory (via the task pane), and you can click the 'Insert Item' arrow to add another row and do a find. This control is bound to a repeating group in the xml schema as follows:

<Delegations>
<Delegated/>
<DelegatedFromName/>
<DelegatedFromComments/>
<DelegationsGroup> (this is the repeating group)
<DelegateToID/>
<DelegateToName/>
</DelegationsGroup
</Delegations>


If Delegate is clicked and the new view submitted, it writes the Delegations node from the Act xml to the Proc xml in the Succeeding rule. Then a line to itself evaluates true, and in the Destination rule I check to see if Delegated is true. If so, then I read the DelegationsGroup node and add each user as a destination user.

However, in the workspace I can view the xml schema for the activity and see the two 'delegatees', but in the proc xml there is only the first one. Apparently my code in the succeeding rule that writes the xml from the Activity to the Process only writes out the first DelegationsGroup item and not the second one.

Can anyone give me any tips on how to correct this? Here is the code:

bDelegated = CType(K2.ProcessInstance.DataFields("Delegated").Value,Boolean)

If bDelegated Then
Dim oActivityInstanceDest As SourceCode.KO.ActivityInstanceDestination
Dim SourceField As Object
Dim bDelegated As Boolean

For Each oActivityInstanceDest In K2.ActivityInstance.Destinations
'Note - at this point there is only one ActInstDest - the original one - this may be releated to my problem)
SourceField = SourceCode.K2Utilities.XMLFieldMod.GetXMLValue(oActivityInstanceDest.XmlFields.Item("K2InfoPathSchema").Value, "my:myFields/my:Reviewers/my:DelegationsGroup")
K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value = _
SourceCode.K2Utilities.XMLFieldMod.SetXMLValue(K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value, "my:myFields/my:Reviewers/my:DelegationsGroup", SourceField)
Next
End If


When I copy the ActXML schema to the ProcXML schema, it seems to be losing the second instance of the repeating row. How can I cause that to be retained?

1 reply

Badge +8
I fixed my own problem - I changed the node reference to the my:Delegations node and it worked.

Now how can I clear node values and then update the process xml?

Reply