Update Process XMLField from web page

rated by 0 users
This post has 2 Replies | 2 Followers

Top 75 Contributor
Posts 87
Points 199
moffutt Posted: Wed, Jul 1 2009 9:29 PM
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.

  • | Post Points: 4
Top 25 Contributor
Posts 205
Points 975
jan replied on Thu, Jul 2 2009 12:38 AM

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

Jan
The statements and opinions made in my postings are my own, and do not reflect the opinions of SourceCode Technology Holdings, Inc. or its subsidiaries. All information is provided as is with no warranties, express or implied, and grants no rights or licenses.

  • | Post Points: 9
Top 75 Contributor
Posts 87
Points 199
moffutt replied on Thu, Jul 2 2009 8:25 AM

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

Thank you

  • | Post Points: 1
Page 1 of 1 (3 items) | RSS