.Value);
bool bAllTrue = true;
CDest1 oDest1 = new CDest1();
oDest1.Main(ref K2);
for (int i=0;i<backgroundChecks;i++)
{
if (oDest1.IsSuccess == true) {
//== sendto
string user = "BackgroundCheck"+i;
K2.Destinations.Add(DestinationType.User,user);
if (bAllTrue == false)
{
return;
}
}
}
}
// Destination Classes
private class CDest1 {
public bool IsSuccess = false;
public void Main(ref DestinationRuleContext K2) {
this.IsSuccess = true;
}
}
That is the code behind my destination rule where the Datafield "childCount" is a variable integer that I set prior to this activity. Depending on what that number is, I want to be able to create that many Child workflows.
It all seems to work well except for 1 instance goes into error. Everytime.
Debug 5010 Executing Code Item IPCEvent - IPC Server
Debug 5170 Executed Proc:Main(218), Item:IPC Server.IPCEvent, Status:Active
Debug 5050 Executing IPC Event IPC Server(14), Act:MainFirstActivity(6), Proc:Main(218)
Debug 5010 Executing Code Item IPCEvent - IPC Server
Debug 5170 Executed Proc:Main(218), Item:IPC Server.IPCEvent, Status:Active
Debug 5050 Executing IPC Event IPC Server(15), Act:MainFirstActivity(6), Proc:Main(218)
Debug 5010 Executing Code Item IPCEvent - IPC Server
Debug 5170 Executed Proc:Main(218), Item:IPC Server.IPCEvent, Status:Active
Debug 5100 Executing Line Rule Child First Rule(3), StartAct:Start(2), Proc:Child(220)
Debug 5010 Executing Code Item LineRule - Child First Rule
Debug 5100 Executing Line Rule Child First Rule(3), StartAct:Start(2), Proc:Child(221)
Debug 5010 Executing Code Item LineRule - Child First Rule
Debug 5017 First Chance Exception in Code Item LineRule - Child First Rule : Item has already been added. Key in dictionary: '107' Key being added: '107'
Error 5015 Unhandled Exception in Code Item LineRule - Child First Rule : Item has already been added. Key in dictionary: '107' Key being added: '107'
Debug 5170 Executed Proc:Child(220), Item:Child First Rule.LineRule, Status:Error
Debug 5100 Executing Line Rule Child First Rule(3), StartAct:Start(2), Proc:Child(219)
Debug 5010 Executing Code Item LineRule - Child First Rule
This is the Error message I get when I open K2Server console. Here my Main workflow creates 3 Child workflows, IDs 219,220,221 and 219 is the one that goes into error.
On the Activity I have selected, "Create a slot for each destination" and there are no preceding or succeeding rules. There is a value for the datafield (I had this posted to the console). It also shows the n users that I create for the destination. Note: These users don't actually exist in ADUM though.
When I go to Server Manager and repair error, it goes through without a hitch.
Any glaring mistakes I am making here? Any help would be much appreciated.