Topic
3 replies Latest Post - ‏2010-05-11T19:34:04Z by SystemAdmin
SystemAdmin
SystemAdmin
532 Posts
ACCEPTED ANSWER

Pinned topic parse xml in method

‏2010-05-11T14:16:54Z |
Attempting to parse and update an xml variable.

From an Action List system out the data is returns as follows:
Msg: SystemOut: ${Variables/GetListTransformXml/RowSet} =
<RowSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:Discrete_PO/DiscretePOConfirmPO/GetListTransform@LP99990156N1">
<Row>
<COMPANY>999</COMPANY>
<SUNO>99957</SUNO>
<NAME>Acme Textiles Inc</NAME>
<PO_NBR>475444</PO_NBR>
<ORDER_DATE>2010-05-02 00:00:00.0</ORDER_DATE>
<ORDER_TYPE>DPO</ORDER_TYPE>
<WHSE>ARE</WHSE>
<PLANNER>6314</PLANNER>
<PLANNER_NAME></PLANNER_NAME>
<CHG_TYPE>CHG</CHG_TYPE>
<BAAN_STATUS>Closed</BAAN_STATUS>
<STATUS>Pending</STATUS>
<CHECKED xsi:nil="true" />
</Row>
.
.
.
</RowSet>

Now I want to parse and update the variable in a method but am unsure how to access it. I've tried the getXml without success.
The getObject
IXml x = (IXml) webAppAccess.getVariables().getObject("GetListTransformXml");
returns the following
x=com.bowstreet.builders.webapp.methods.SqlTransformToPagedXmlHelper$SqlXmlDataRetriever@6860686

Thanks for your help.
Updated on 2010-05-11T19:34:04Z at 2010-05-11T19:34:04Z by SystemAdmin
  • kevintap
    kevintap
    41 Posts
    ACCEPTED ANSWER

    Re: parse xml in method

    ‏2010-05-11T16:54:21Z  in response to SystemAdmin
    Your variable here is actually a data retriever object, which is a proxy object that WPF builds when a SQL Call builder has been configured to return paged subsets of the data. This allows WPF to not need to read the entire database table, and it will fetch data from the database as needed. If you treat one of these data retriever objects as IXml (which you can do, the data retriever implements the IXml interface), then you'll lose the ability to fetch data as needed from the database. Treating one of these data retriever objects as IXml will cause it to read the complete result set from the database, which could cause a performance problem in your application if you're retrieving a large amount of data.

    It might help if you could explain a little bit more about what you need to do with the data or how you need to modify it. In WPF 6.1.5, the Transform builders provide capabilities for modifying XML data, and they respect (when possible) that an object is a data retriever. (Some cases like grouping and sorting cannot be done without evaluating the full set of data.) I would suggest looking at the Transform Modify builder to see if any of the options available in this builder are sufficient for the data modification that you need to do. The Transform Modify builder will allow the data to continue to be treated as a data retriever and will modify data as each subset is read from the database.

    Also, be careful about adding SystemOut actions for these data retriever objects. If you do a SystemOut action to print the value of this object, it will cause the data retriever to be treated as IXml and retrieve the full data set.
    • SystemAdmin
      SystemAdmin
      532 Posts
      ACCEPTED ANSWER

      Re: parse xml in method

      ‏2010-05-11T17:34:22Z  in response to kevintap
      The model currently allows a user to confirm a PO but only one at a time. I'd like to add the capability to select multiple lines and do a mass confirmation. I've done similar functionality on another model, but the datasource in that case was a web service not a sql call. I'd like to update the xml as the user selects lines, then once they click "Submit" then update the Oracle table with the items that have been selected.
    • SystemAdmin
      SystemAdmin
      532 Posts
      ACCEPTED ANSWER

      Re: parse xml in method

      ‏2010-05-11T19:34:04Z  in response to kevintap
      Could you further describe how the Transform builders work or direct me to in-depth documentation? I'm currently on WPF 6.1.2.