Professional Documents
Culture Documents
U ng Conffigured
d Item SStructure
C
Cloud S
SOAP WWeb Serrvice
S
Sales View and Co
omplete In
nstance View
V
ORACLE WHITE PAPER | SEPTEMBER 2017
Table of Contents
Introduction 1
Overview: 1
This document assumes that user will have knowledge of working with web services like constructing input XML
payload, invoking web services and creating web service proxy.
Overview:
This web service will be used by the consuming products to retrieve and view the options selected for the model
item as well as the configured item structure. This will include the Model reference and description, selected options
and description, and TIAs related to the selected options. Four operations will be provided as part of this service
which enables to retrieve the two types of structures requested.
This service provides four operations; findCtoSalesStructure operation is used to retrieve the sales structure of the
configured item, findCtoItemStructure operation is used to retrieve the complete item structure of the configured
item, refreshConfigStructure is used to refresh the item structure in the explosion repository and
deleteConfigStrucure will purge the item structure from the explosion repository.
Sales Structure (findCtoSalesStructure): Is the set of options, option classes and match-enabled TIAs selected
by the user at runtime.
Sales structure for the Configured Item Number: VIK12*100 looks like below.
Sales structure of VIK12*100 will include the sales structure of the entire child ATOs. Assuming that BRN*11,
BSOC*2 and OVOC*30 are the configured items for the child ATOs you can see the structure of them included in
the sales structure of the VIK12*100 in the following table.
If any match enabled transactional item attribute (TIA) is present for the item that is also returned along with the Item
7 FINISH Black ‐ ‐
Complete Item Structure (findCtoItemStructure): Is the complete structure for a configured item which includes
all the model items, selected options, mandatory components and phantom sub-assembly structure. This also
includes substitutions and Transactional item attributes for the selected components.
Example:
Assuming the same example as for sales structure, the complete instance view for VIK12*100 looks like below.
Complete Instance structure for the VIK12*100 looks like below.
LIN SUB_ITEM_TYPE ITEM_NUMBER INVENTORY_ITEM_ PARENT_L CONFIG QTY UOM WIP_SUP RootPhantomItem
E_ID ID INE_ ID ITEM_NUMBER PLY_TYP Id
E
Note that mandatory items STVU and CLK-Assembly under VIK12 are also included in the results. As COMLG &
CLK-Assembly are phantom items, their sub-assemblies also gets included the in the result.
Explosion Repository: Whenever complete item structure information of a configured item is requested, structure
information of that configured item is first pulled and stored in the explosion tables called explosion repository and
later information is fetched from this repository. So for this operation to return the data, it is necessary that structure
information is present in the repository. Following are the ways in which the information stored in the repository can
be refreshed.
» Passing RefreshStructure attribute value ‘true’ to the find item structure operation in the first row of the input will
force structure information in the repository will always be refreshed before fetching the data. Default value for
this attribute is ‘false’, in this case only missing structure information is pulled into the repository and existing data
in the repository will not be refreshed.
» Explosion repository can be refreshed by calling the refreshConfigStructure operation (details of refresh configure
structure operation are explained in the below section) prior to the invocation of find item structure with the same
set of input parameters as find operation. This is the preferable approach for invoking the find item structure
operation that is going to return large amount of data because structure information of the required configured
items will be readily available in the explosion repository and need not to be pulled into the repository as part of
the find operation invocation, the performance of the find operation will be improved.
General use of this operation is that this will be called prior to the invocation of the find item structure so that
performance of the find operation will improve much as the structure information of the required configured items will
be readily available in the explosion repository for the find operation to retrieve and need not to be populated as part
of the find operation invocation.
Delete Config Structure: This operation will delete the structure information of the configured items matching the
input search criteria from the explosion repository. Following are the list of parameters that can be passed as input
to this operation.
This operation is used to purge the structure information of configured items that are no longer required or used from
the explosion repository.
Attribute Name Type Description
ConfigItemId ** Long Item Id of the Configured Item
ConfigItemNumber ** String Item name of the Configured Item
BaseModelId ** Long The Item Id of the ATO Model
BaseModelItemNumber ** String The Item name of the ATO Model
CreationDateFrom ** Date Configured item creation date from
CreationDateTo ** Date Configured item creation date to
** Indicates at least one of the attributes is mandatory.
http://hostname:port/ctoUtilitiesPublicService/ConfiguredItemService
Choose one operation from the list of operations drop down, currently four operations are available
findCtoItemStructure, findCtoSalesStructure, refreshConfigStructure and deleteConfigStructure.
Enter the payload and click on Invoke to get the response. The following section explains on how to build the
payload in detail.
1. findCriteria: The structure containing all the object and attribute filter criteria.
1.1. fetchStart and fetchSize are required. They define the number of rows in the result set plus which row to start
with.
» fetchStart: The zero-based row index to start with. The default is 0 (first row). If the value is 0 the result set
will begin with the first row of the data set. If the value is 99 the result set will begin with the 100th row of the
data set.
» fetchSize: The maximum number of rows to retrieve. A fetchSize of -1 gets all rows found, starting with the
start row (fetchStart). If fetchSize is greater than the number of remaining rows, only the remaining rows are
returned. This service has a predefined maximum fetchSize of 500 which cannot be exceeded in a single
query. If fetchSize is set to a value greater than 500 or -1, service throws an exception if there are more than
500 records matching the input criteria.
1.2. filter: The structure containing all runtime search conditions. View criteria restrict returned data to those rows
matching the defined filters. If there are no view criteria, there are no filters applied during query processing. You
can think of view criteria as a collection of one or more "query-by-example" (QBE) rows that define a data filter for a
view object. The view criteria are converted to a SQL WHERE clause.
1.2.1. conjunction: Defines how search conditions are evaluated in relation to each other (i.e. And, Or, Not,
AndNot, OrNot). Absence of a value defaults to AND behavior. For those with an ADF background, this is the
conjunction used between these view criteria and the previous view criteria, if any exist. Conjunction is case
sensitive.
1.2.2. group: The structure containing a set of runtime search/filter conditions for 1 or more attributes. For those
with an ADF background, this is the list of view criteria rows, where each row defines distinct view criteria.
1.2.2.2. item: The structure containing one runtime search condition for an attribute.
1.2.2.2.2. upperCaseCompare: Boolean flag specifying whether the returned attribute values are converted to
uppercase before being evaluated against the filter value.
1.2.2.2.3. attribute: Case sensitive name of the object attribute to filter on. Note that the root node of a child object
is technically an attribute of the parent object.
Following are the list of filter attributes supported for complete item structure.
Attribute Name Type Description
ConfigItemId ** Long Item Id of the Configured Item
ConfigItemNumber ** String Item name of the Configured Item
BaseModelId ** Long The Item Id of the ATO Model
BaseModelItemNumber ** String The Item name of the ATO Model
CreationDate ** Date Date of Configured Item Creation
OrganizationId Big Decimal Organization id of Configured Item
OrganizationCode String Organization Code of Configured Item
EffectiveAsOfDate Date Effective date of the Configured item
Following are the list of filter attributes supported for sales item structure.
Attribute Name Type Description
ConfigItemId ** Long Item Id of the Configured Item
ConfigItemNumber ** String Item name of the Configured Item
BaseModelId ** Long The Item Id of the ATO Model
BaseModelItemNumber ** String The Item name of the ATO Model
CreationDate ** Date Date of Configured Item Creation
** Indicates at least one of the attributes is mandatory. An error will be thrown if none of the required attributes are
used in the search criteria.
An error will be thrown if any other attributes is used for this field.
1.2.2.2.4 operator: =, >=, <=, >, <,<>, ISBLANK, ISNOTBLANK, CONTAINS, STARTSWITH, AFTER,
ONORAFTER, BEFORE, ONORBEFORE, BETWEEN, NOTBETWEEN. Not all available operators will work
against all attribute types (e.g. String, Integer, Date etc). Note that the numeric comparison operators (=,< etc)
generally work against String fields. Operator is case sensitive.
Only following operators are allowed for the mandatory attributes of the complete item structure
Attribute Name Operator Supported
ConfigItemId ** =
ConfigItemNumber ** =
BaseModelId ** =
BaseModelItemNumber ** =
CreationDate ** BETWEEN
There is no restriction on the operators for the non-mandatory attributes of the complete item structure and attributes
of sales structure.
1.2.2.2.5. value: The attribute filter criteria which can include a non-leading '%' wildcard (e.g. Foo%).
1.3. sortOrder: The structure containing directives for sorting the result set in ascending or descending order.
1.4. findAttribute: Specifies the subset of attributes to retrieve when the search/filter criteria is satisfied. When none
is specified, all attributes are fetched. When specified, only those are returned. Note that a child object is technically
an attribute of the parent object.
1.5. excludeAttribute: Boolean flag. When True, attributes defined by findAttribute declarations are not returned.
2. findControl: The structure defining whether or not to retrieve all translations of attributes if they exist. This is a
global parameter affecting the entire result set
Following is the payload for retrieving complete instance structure for the Configured Item Number VIK12*100
<ns1:findCtoItemStructure
xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:fetchStart>0</ns2:fetchStart> ‐‐ start at index 0
<ns2:fetchSize>‐1</ns2:fetchSize> ‐‐ Indicates all the rows should be returned
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:attribute>ConfigItemNumber</ns2:attribute> ‐‐ Condition is Based on ConfigItemNumber
<ns2:operator>=</ns2:operator>
<ns2:value>VIK12*100</ns2:value> ‐‐ Configured Item Number Value
</ns2:item>
</ns2:group>
<ns2:nested/>
</ns2:filter>
<ns2:excludeAttribute/>
</ns1:findCriteria>
<ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:retrieveAllTranslations/>
</ns1:findControl>
</ns1:findCtoItemStructure>
Scenario 2: Passing multiple conditions & filtering the output
Following is the payload for retrieving complete item structure for all the configured items created between ’09-Dec-
2012’ and ‘ 09-Dec-2015’ with base model item VIK12. This example also tells us how to remove/exclude certain
attributes from the response.
In this example the item element is repeated. Item elements are used to specify runtime search conditions for
attributes. Item elements are child structures within a group container. There can be multiple item elements within
the group container.
<ns1:
findCtoItemStructurexmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStr
uctureService/types/">
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
Following is the payload for refreshing the explosion repository & retrieving complete item structure for all the
configured items created between ’09-Dec-2012’ and ‘ 09-Dec-2015’ with base model item VIK12. The payload also
contains the Refresh Structure attribute with the value ‘true’, so the structure information for all the matched
configured items will be refreshed in the explosion repository before the actual query.
<ns1:
findCtoItemStructurexmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStr
uctureService/types/">
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:fetchStart>0</ns2:fetchStart>
<ns2:fetchSize>‐1</ns2:fetchSize>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare></ns2:upperCaseCompare>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
The service has to be called multiple times in a loop for retrieving larger structures which are expected to have more
than 500 rows in the response by modifying the fetch start and size appropriately.
Following are the payloads for retrieving the complete item structure for all the configured items created within the
given date range. Assuming that response contains 690 rows( > 500 rows which is the pre-defined limit of maximum
number of rows that service can retrieve), the service has to be invoked twice by passing fetch start and fetch size
appropriately.
In the first invocation we will be retrieving the first 500 rows by passing fetch start as ‘0’ and fetch size as 500. In the
second invocation we will be retrieving the rows from 500 to 690 by passing the fetch start as 500.
First Invocation:
<ns1:findCtoItemStructure
xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:fetchStart>0</ns2:fetchStart>
<ns2:fetchSize>500</ns2:fetchSize>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:attribute>CreationDate</ns2:attribute>
<ns1:findCtoItemStructure
xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:fetchStart>500</ns2:fetchStart>
<ns2:fetchSize>500</ns2:fetchSize>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:attribute>CreationDate</ns2:attribute>
<ns2:operator>BETWEEN</ns2:operator>
<ns2:value>2014‐12‐09</ns2:value>
<ns2:value>2015‐12‐09</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:excludeAttribute/>
</ns1:findCriteria>
<ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:retrieveAllTranslations/>
</ns1:findControl>
</ns1:findCtoItemStructure>
* As the second invocation is made with fetch start value greater than zero, neither structure information is refreshed
nor the missing item information is pulled into the repository, so the first call with fetch start as zero is mandatory
when making multiple calls to retrieve larger structures.
Scenario 5: Refresh Config Structure prior to find Item structure for larger structures
If findItemStructure is directly called for larger structures it may take lot of time to retrieve the data as it has to
refresh & pull the structure information into the explosion repository before querying for the data. To avoid this
scenario we should invoke refresh config structure operation prior to invoking the find item structure with the same
input parameter values, so when the find item structure operation is called later the required structure information
will be readily available in the explosion repository and performance of the find operation will be much better.
Sample payload for this scenario is given below.
<ns1:refreshConfigStructure
xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
>
<ns1:configList
xmlns:ns2="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/">
<ns2:CreationDateFrom>2014‐12‐09</ns2:CreationDateFrom>
<ns2:CreationDateTo>2015‐12‐09</ns2:CreationDateTo>
</ns1:configList>
</ns1:refreshConfigStructure>
findItemStructure Invocation:
<ns1:findCtoItemStructure
xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:fetchStart>0</ns2:fetchStart>
<ns2:fetchSize>500</ns2:fetchSize>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:attribute>CreationDate</ns2:attribute>
<ns2:operator>BETWEEN</ns2:operator>
<ns2:value>2014‐12‐09</ns2:value>
<ns2:value>2015‐12‐09</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:excludeAttribute/>
</ns1:findCriteria>
<ns1:findControl xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:retrieveAllTranslations/>
</ns1:findControl>
</ns1:findCtoItemStructure>
Scenario 6: Grouping conditions
This example shows how to retrieve the complete instance structure of all the configured items created between ’09-
Dec-2012’ and ‘ 09-Dec-2015’ or with base model item VIK12.
<ns1:findCtoItemStructure
xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:fetchStart>0</ns2:fetchStart>
<ns2:fetchSize>500</ns2:fetchSize>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
This example shows how to retrieve the complete item structure for the configured item VIK12*100 and only show
TIA information which has the attribute name starts with MFG_Transactional_Attributes and attribute’s value is
‘Black’
<ns1:findCtoItemStructure>
<ns1:findCriteria>
<ns2:fetchStart>0</ns2:fetchStart>
<ns2:fetchSize>‐1</ns2:fetchSize>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>ConfigItemNumber</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>VIK12*100</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:childFindCriteria> ‐‐ This is the structure for adding conditions based on TIA
<ns2:fetchStart>0</ns2:fetchStart>
<ns2:fetchSize>‐1</ns2:fetchSize>
<ns2:filter>
Following payload retrieves the complete item structure for all the configured items which are created between 09-
DEC-2012 and 09-DEC-2016 and having the Transaction item attribute with name ‘SCO_color’ and value is ‘Black’.
To achieve this user has to invoke the service twice, in the first invocation we will find all the configured items
matching the above filter criteria and we should invoke the service for the second time with the returned values (ex:
ConfigItemNumber) from first invocation as the parameters.
First Invocation:
<ns1:findCtoItemStructure >
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:fetchStart>0</ns2:fetchStart>
<ns2:fetchSize>500</ns2:fetchSize>
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>CreationDate</ns2:attribute>
<ns2:operator>BETWEEN</ns2:operator>
<ns1:findCtoItemStructure
xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:fetchStart>0</ns2:fetchStart> ‐‐ start at index 0
<ns2:fetchSize>‐1</ns2:fetchSize> ‐‐ Indicates all the rows should be returned
<ns2:filter>
<ns2:conjunction>And</ns2:conjunction>
<ns2:group>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:item> ‐‐ This block has to be repeated for all the configured items returned from the previous call
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare/>
<ns2:attribute>ConfigItemNumber</ns2:attribute> ‐‐ Condition is Based on ConfigItemNumber
<ns2:operator>=</ns2:operator>
<ns2:value>VIK12*100</ns2:value> ‐‐ Configured Item Number returned from the previous call
</ns2:item>
</ns2:group>
<ns2:nested/>
Scenario 9: Purge the item structure information.
Delete config structure operation can be invoked to purge the structure information of unused configured items from
the repository. Following is the payload for removing the structure of all the configured items with base model item
number value as ‘VIK12’ from the repository.
<ns1:deleteConfigStructure
xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
>
<ns1:configList
xmlns:ns2="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/">
<ns2:BaseModelItemNumber>VIK12</ns2:BaseModelItemNumber>
</ns1:configList>
</ns1:deleteConfigStructure>
Once the proxy for web service is created, we can use java code similar to the following code snippet to invoke the
service using proxy by passing the filter criteria as the input.
Scenario 1: Retrieving complete item structure based on simple condition using proxy
The following code queries complete item structure for all the configured items created between 09-Dec-2011 and
09-Dec-2018. The service was called in a loop. Each iteration will call the service with fetch size of 500. Loop will be
exited if the number of records fetched is less than 500.
Following code retrieves the complete item structure for all the configured items which are created between 09-
DEC-2012 and 09-DEC-2016 and having the Transaction item attribute with name ‘SCO_color’ and value is ‘Black’.
//Code Block for finding the list of Configured Items based on TIA filter‐Starts
ObjectFactory obj = new ObjectFactory();
ViewCriteriaRow vcr = obj.createViewCriteriaRow();
ViewCriteria vc = obj.createViewCriteria();
ViewCriteriaItem vci = obj.createViewCriteriaItem();
vci.setAttribute("CreationDate");
vci.getValue().add("2012‐12‐09");
vci.getValue().add("2016‐12‐09");
vci.setOperator("BETWEEN");
vci.setConjunction(Conjunction.AND);
vcr.getItem().add(vci);
//Code Block for setting TIA filter criteria‐Starts
ViewCriteriaItem childExistsItem = obj.createViewCriteriaItem();
childExistsItem.setAttribute("CtoTransactionAttr");
childExistsItem.setOperator("EXISTS");
childExistsItem.setConjunction(Conjunction.AND);
vcr.getItem().add(childExistsItem);
vc.setConjunction(Conjunction.AND);
ViewCriteriaRow childCriteriaRow = obj.createViewCriteriaRow();
ViewCriteria childCriteria= obj.createViewCriteria();
ViewCriteriaItem childCriteriaItem = obj.createViewCriteriaItem();
childCriteriaItem.setAttribute("AttributeName");
childCriteriaItem.getValue().add("SCO_Color");
childCriteriaItem.setOperator("=");
childCriteriaItem.setConjunction(Conjunction.AND);
childCriteriaRow.getItem().add(childCriteriaItem);
childCriteriaItem = obj.createViewCriteriaItem();
childCriteriaItem.setAttribute("CharacterAttributeValue");
childCriteriaItem.getValue().add("Black");
childCriteriaItem.setOperator("=");
childCriteriaItem.setConjunction(Conjunction.AND);
childCriteriaRow.getItem().add(childCriteriaItem);
childCriteria.getGroup().add(childCriteriaRow);
childExistsItem.setNested(childCriteria);
vc.getGroup().add(vcr);
//Code Block for setting TIA filter criteria‐Ends
//Code for the first Inovcation‐starts
FindCriteria fc = obj.createFindCriteria();
fc.setFilter(vc);
int counter=0;
List<CtoItemStructure> configItemList=new ArrayList<CtoItemStructure>(); //List for holding
the output from the first service call
List<CtoItemStructure> opTempList=null;
while(opTempList==null || opTempList.size()==500)
{
Assume that service has been called using the proxy; each row of the output will be stored in the relational database
table. Data can be queried later from this table as per the need.
For this we need to create the relational database table (CTO_ITEM_STRUCTURE) which includes a column for
each attribute in the response. Also we should create a separate table for storing the transactional item attributes
(CTO_TRANSACTION_ATTR), which will have foreign key relationship with other table based on LINE_ID.
LINE_ID
CONFIG_ITEM_ID
CTO_ITEM_STRUCTURE CTO_TRANSACTION_ATTR
ATTRIBUTE_NAME
CONFIG_ITEM_NUMBER
LINE_ID CHARACTER_ATTRIBUTE_VALUE
PARENT_LINE_ID NUMBERIC_ATTRIBUTE_VALUE
….. …..
Query: SELECT * FROM CTO_ITEM_STRUCTURE WHERE <CONDITION>
Scenario 2:
Assume that service has been called using the proxy; each row of the output will be converted to XML format using
the following sample code and stored in to the database table with Clob column.
Code for converting the output row into XML:
JAXBContext contextObj = JAXBContext.newInstance(new Class[]{CtoItemStructure.class});
Marshaller marshallerObj = contextObj.createMarshaller();
marshallerObj.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
JAXBElement<CtoItemStructure> rootElement = new JAXBElement<CtoItemStructure>(new
QName("CtoItemStructureRow"), CtoItemStructure.class, opTempList.get(Index));
marshallerObj.marshal(rootElement, baos);
String xmlContent = new String(baos.toByteArray());
ClobDomain objClobDomain = new ClobDomain(xmlContent);
Once we convert the row to XML, the data will be stored in the table with the following structure.
CTO_ITEM_STRUCTURE:
Attribute Name Type Description
CONFIG_ITEM_ID Long Item Id of the Configured Item
ITEM_STRUCTURE Clob XML Data of the Row
Later data can be queried from this table using the following similar query.
select CONFIG_ITEM_ID,
Following is the XSLT code which transforms the XML output of the service.
This formatting or conversion can also be done programmatically using the following sample code.
String xml = “input.xml"; // input XML file location
String xslt = “transformations.xsl"; // XSLT file location
String output = "formatted.xml"; //output XML file location
TransformerFactory tf = TransformerFactory.newInstance();
Transformer tr = tf.newTransformer(new StreamSource(new File(xslt)));
tr.transform(new StreamSource(new File(xml)),
CONNECT WITH US
blogs.oracle.ccom/oracle
Copyyright © 2017, Oracle and/or
a its affiliates. All rights reserved. This document
d is provided for
f information purposes only, and the
conte ents hereof are subjecct to change without notice. n This document is not warranted to be
b error-free, nor subje ect to any other
facebook.com
m/oracle warra anties or conditions, whhether expressed orallyy or implied in law, inclluding implied warranties and conditions of merchantability
m or
fitnesss for a particular purpo
ose. We specifically dissclaim any liability with respect to this document, and no contractua al obligations are
forme ed either directly or inddirectly by this document. This document may m not be reproduced d or transmitted in anyy form or by any
twitter.com/orracle mean ns, electronic or mecha anical, for any purpose,, without our prior writte en permission.
Intel and
a Intel Xeon are traddemarks or registered trademarks
t of Intel Corrporation. All SPARC trademarks are used un
nder license and
are trrademarks or registere
ed trademarks of SPARRC International, Inc. AMD,
A Opteron, the AMDD logo, and the AMD Opteron
O logo are
trade
emarks or registered tra
ademarks of Advanced Micro Devices. UNIX is a registered tradema ark of The Open Group
p. 0117