Sorry - I miss an important detail.
I try to use Plan per Destination, all at once - but the destination is only one role so I have only one slot. This seems to act nearly as the default Plan just once - but I hope I will find the activity instance fields filled than - but this did'nt work as expected.
Johnny wrote another good article (Differences between "Plan just once" and "Plan per destination") - I read it - but sorry I'm still confused with this options.
I try to use also Plan just once and than the slot collections: K2.ActivityInstanceDestination.ActivityInstance.WorklistSlots[0].DataFields["Action Result"].Value.ToString();
But during build I get the error: Error 2 'Project_8607830a347f44759e95738a818e9eea.SucceedingRuleContext_53f3d1859467434d851da3f2d84f0af4' does not contain a definition for 'ActivityInstanceDestination'
That line can only be used in a server event within the Activity Instance.
If you want to use it in the succeeding rules, use this line instead.
K2.ActivityInstance.WorklistSlots[0].DataFields["Action Result"].Value.ToString();
Thx Johnny - this works.
Can you explain me why the changes to the form are not available during my UpdateTask? If I move the event to the next activity it works - but not if the event is directly behind the infopath client event in the same activity.
From my understanding (at least in K2.net 2003), the infopath client event copies the form XML data from the Process level XML field to the activity level XML field. When the succeeding rule is reached, the activity level XML field is copied back to the Process level XML field. So if you want to do any updates, you would modify the activity level XML field.
Now I might be wrong here but I think the behaviour has not changed in blackpearl. So I guess that you should be modifying the activity level XML field to update your form status.
This sounds good but I try this -
First I try with K2.ActivityInstance.XmlFieldss_xmlFieldName] but I got a runtime error "xmlfield not found".
Then I try: K2.ActivityInstance.WorklistSlotst0].XmlFieldsd_xmlFieldName] this runs but I found no changes during my UpdateTask Event. It seems "to late", because in this version I also get no changes if I move my Update Task Event to the next activity.
So I guess that when I reach the succeding rule the copy back is already done - but why do the next Event handels with "old" Form fields?
(I use now the Plan at once - because Plan per destination didn't help me)