Skip to main content
I have a series of web pages that are used to complete a process. Each page adds information to an XML field. The first page works fine. I load the xml schema from the process, add values from my web page and then copy the xml field back to the process. My guess is this works because I am starting the process from this page and there is no activity associated with this step.



I am copying the xml back using the following code:



_pi.XmlFields["ASR"].Value = Utilities.GetString(_doc);

_conn.StartProcessInstance(_pi);



So the next step I load the xml into the web page. Fill in the values that are already filled out and then allow the user to complete the next part of the form. I then upload the xml and complette the activity like so:



_pi.XmlFields["ASR"].Value = Utilities.GetString(_doc);

WorklistItem _wli = _conn.OpenWorklistItem(Request.QueryString["SN"], "asp");

_wli.Actions["Form Complete"].Execute();



When I check the ASR field in debug it has the correct values but after this activity completes the new values are missing. I tried to update the xml in the activity as follows, assuming that the activity was overwriting the process when it completed, but I am receiving a XML field not found error:



WorklistItem _wli = _conn.OpenWorklistItem(Request.QueryString["SN"], "asp");

_wli.ActivityInstanceDestination.XmlFields["ASR"].Value = Utilities.GetString(_doc);

_wli.Actions["Form Complete"].Execute();




I also tried it with an index of [0] and it said that the index was out of bounds. I am thinking this is pretty easy and I am just missing something. Any help would be appreciated.

Hi,


To have this working, you need to do your data update from your Worklistitem object.


WorklistItem _wli = _conn.OpenWorklistItem(Request.QueryString["SN"], "asp");
_wli.ProcessInstance.XmlFields["ASR"].Value = Utilities.GetString(_doc);
_wli.Actions["Form Complete"].Execute();


To beĀ able to update data from your ActivityInstanceDestination object, you need to first create these data on your design. And remember, values of ActivityINstanceDestination data is only available during the activity execution.


HTH


I knew it had to be something simple. That did the trick.


Thank you


Reply