Call the Web Service Through Proxy
Create the proxy for the web service, then use the Java programming language to call the service through your proxy. You send filter criteria as the input.
Get the Item Structure According to a Simple Condition
Here's part of a payload that gets the item structure for configured items you create between 09-Dec-2018 and 09-Dec-2019. You call the service in a loop, where each iteration calls the service with a fetch size of 500. If the number of records you fetch is less than 500, then the code exits the loop.
ObjectFactory obj = new ObjectFactory();
ViewCriteriaRow vcr = obj.createViewCriteriaRow();
ViewCriteria vc = obj.createViewCriteria();
ViewCriteriaItem vci = obj.createViewCriteriaItem();
vci.setAttribute("CreationDate");
vci.getValue().add("2018-12-09");
vci.getValue().add("2019-12-09");
vci.setOperator("BETWEEN");
vci.setConjunction(Conjunction.AND);
vcr.getItem().add(vci);
vc.setConjunction(Conjunction.AND);
vc.getGroup().add(vcr);
FindCriteria fc = obj.createFindCriteria();
fc.setFilter(vc);
int fetchCounter = 0;
List < CtoItemStructure > opList = new ArrayList < CtoItemStructure > ;
List
for storing all the output records List < CtoItemStructure > opTempList = null;
List
for storing the result of one service call
while (opTempList == null || opTempList.size() == 500) {
fc.setFetchStart(fetchCounter);
fc.setFetchSize(500);
opTempList = ctoConfigItemService.findCtoItemStructure(fc, null);
opList.addAll(opTempList);
items of result list from the service call be will be added to the final list fetchCounter = fetchCounter + 500;
}
Get the Item Structure According to Transaction Attribute
Here's part of a payload that gets the item structure for configured items you create between 09-Dec-2017 and 09-Dec-2019, and where the SCO_color transaction attribute contains the value Black.
//Get the list of configured items according to transaction attribute
ObjectFactory obj = new ObjectFactory();
ViewCriteriaRow vcr = obj.createViewCriteriaRow();
ViewCriteria vc = obj.createViewCriteria();
ViewCriteriaItem vci = obj.createViewCriteriaItem();
vci.setAttribute("CreationDate");
vci.getValue().add("2017-12-09");
vci.getValue().add("2019-12-09");
vci.setOperator("BETWEEN");
vci.setConjunction(Conjunction.AND);
vcr.getItem().add(vci);
//Set the filter criteria for the transaction attribute
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);
//Make the first call
FindCriteria fc = obj.createFindCriteria(); fc.setFilter(vc);
int counter = 0;
List < CtoItemStructure > configItemList = new ArrayList < CtoItemStructure > (); //List that holds the output from the first call
List < CtoItemStructure > opTempList = null;
while (opTempList == null || opTempList.size() == 500) {
fc.setFetchStart(counter);
fc.setFetchSize(500);
opTempList = ctoConfigItemService.findCtoItemStructure(fc, null);
counter = counter + 500;
configItemList.addAll(opTempList);
}
//End of making the first call
//End of get the list of configured items according to transaction attribute
//Get the item structure for configured items that the first call returned
ViewCriteriaRow configVcr = obj.createViewCriteriaRow();
ViewCriteria configVc = obj.createViewCriteria();
ViewCriteriaItem configVci = null;
for (CtoItemStructure itemStructRow: configItemList) //For loop to iterate through the list of configured items
{
if (itemStructRow.getSubItemType().getValue().intValue() == 1) // if it is a config item create condition based on config item id
{
configVci = obj.createViewCriteriaItem();
configVci.setAttribute("ConfigItemId");
configVci.getValue().add(itemStructRow.getConfigItemId().getValue());
configVci.setOperator("=");
configVci.setConjunction(Conjunction.OR);
configVcr.getItem().add(configVci);
}
}
configVc.getGroup().add(configVcr);
//Make the second call
FindCriteria configFc = obj.createFindCriteria(); configFc.setFilter(configVc);
counter = 0;
List < CtoItemStructure > opList = new ArrayList < CtoItemStructure > (); //List for storing the final output opTempList=null;
while (opTempList == null || opTempList.size() == 500) {
configFc.setFetchStart(counter);
configFc.setFetchSize(500);
opTempList = ctoConfigItemService.findCtoItemStructure(configFc, null);
counter = counter + 500;
opList.addAll(opTempList);
}
//End of making the second call
//End of get the item structure for configured items that the first call returned
Here's an example of the response you receive for the entire structure.
< ns0: findCtoItemStructureResponse xmlns: ns0 = "http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/ty
pes / "> <
ns2: result
xmlns: ns2 = "http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/ty pes/"
xmlns: ns1 = "http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/"
xmlns: ns0 = "http://xmlns.oracle.com/adf/svc/types/"
xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi: type = "ns1:CtoItemStructure" >
<
ns1: ConfigItemId > 300100071637243 < /ns1:ConfigItemId> <
ns1: ConfigItemNumber > DOS - BAT - CTO * 101 * < /ns1:ConfigItemNumber> <
ns1: BaseModelId > 100100035462338 < /ns1:BaseModelId> <
ns1: BaseModelItemNumber > DOS - BAT - CTO < /ns1:BaseModelItemNumber> <
ns1: InventoryItemId > 300100071637243 < /ns1:InventoryItemId> <
ns1: InventoryItemNumber > DOS - BAT - CTO * 101 * < /ns1:InventoryItemNumber> <
ns1: ParentInventoryItemId > 300100071637243 < /ns1:ParentInventoryItemId> <
ns1: ParentInventoryItemNumber > DOS - BAT - CTO * 101 * < /ns1:ParentInventoryItemNumber> <
ns1: HeaderId > 300100071637281 < /ns1:HeaderId> <
ns1: LineId > 300100071637284 < /ns1:LineId> <
ns1: ParentLineId xsi: nil = "true" / >
<
ns1: SubItemType > 1 < /ns1:SubItemType> <
ns1: UnitQuantity xmlns: tns = "http://xmlns.oracle.com/adf/svc/errors/"
unitCode = "Ea" > 1 < /ns1:UnitQuantity> <
ns1: UnitUOM > Ea < /ns1:UnitUOM> <
ns1: CreationDate > 2018 - 12 - 02 T10: 59: 08.119 + 05: 30 < /ns1:CreationDate> <
ns1: RevisionId xsi: nil = "true" / >
<
ns1: EffectivityDate > 2018 - 12 - 02 T10: 59: 08.119 + 05: 30 < /ns1:EffectivityDate> <
ns1: DisableDate xsi: nil = "true" / >
<
ns1: OrganizationId > 204 < /ns1:OrganizationId> <
ns1: OrganizationCode > V1 < /ns1:OrganizationCode> <
ns1: BillSequenceId > 300100046112964 < /ns1:BillSequenceId> <
ns1: ComponentSequenceId xsi: nil = "true" / >
<
ns1: ComponentType > 1 < /ns1:ComponentType> <
ns1: WIPSupplyType xsi: nil = "true" / >
<
ns1: OptionalComponent > Y < /ns1:OptionalComponent> <
ns1: SubstituteComponent > N < /ns1:SubstituteComponent> <
ns1: ComponentYieldFactor xsi: nil = "true" / >
<
ns1: PlanningFactor xsi: nil = "true" / >
<
ns1: RoundingDirection xsi: nil = "true" / >
<
ns1: BasisType xsi: nil = "true" / >
<
ns1: CheckATP xsi: nil = "true" / >
<
ns1: ComponentHierarchy > 300100046112964 < /ns1:ComponentHierarchy> <
ns1: ComponentItemHierarchy > 300100071637243 < /ns1:ComponentItemHierarchy> <
ns1: ItemClassId > 100000011369001 < /ns1:ItemClassId> <
ns1: RootPhantomItemId > < /ns1:RootPhantomItemId> <
/ns2:result> <
ns2: result >. . .< /ns2:result> <
ns2: result >. . .< /ns2:result>. . .<
/ns0:findCtoItemStructureResponse>
Here's an example of the response you receive for the structure according to configure options your user sets in the sales order.
< ns2: result xsi: type = "ns1:CtoSalesStructure"
xmlns: ns2 = "http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types /
" xmlns:ns1="
http: //xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/" xmlns:ns0="http://xmlns.oracle.com/adf/svc/types/" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance">
<
ns1: ConfigItemId > 300100090366280 < /ns1:ConfigItemId> <
ns1: ConfigItemNumber > BSOC * 220 * < /ns1:ConfigItemNumber> <
ns1: BaseModelId > 300100032201662 < /ns1:BaseModelId> <
ns1: BaseModelItemNumber > BSOC < /ns1:BaseModelItemNumber> <
ns1: InventoryItemId > 300100032201442 < /ns1:InventoryItemId> <
ns1: InventoryItemNumber > STD - Burner < /ns1:InventoryItemNumber> <
ns1: ParentInventoryItemId > 300100090366280 < /ns1:ParentInventoryItemId> <
ns1: ParentInventoryItemNumber > BSOC * 220 * < /ns1:ParentInventoryItemNumber> <
ns1: HeaderId > 300100090366310 < /ns1:HeaderId> <
ns1: LineId > 300100090366315 < /ns1:LineId> <
ns1: ParentLineId > 300100090366312 < /ns1:ParentLineId> <
ns1: SubItemType > 2 < /ns1:SubItemType> <
ns1: UnitQuantity unitCode = "Ea"
xmlns: tns = "http://xmlns.oracle.com/adf/svc/errors/" > 1 < /ns1:UnitQuantity> <
ns1: UnitUOM > Ea < /ns1:UnitUOM> <
ns1: ItemHierarchy > /300100090366280/
300100032201442 < /ns1:ItemHierarchy> <
ns1: CreationDate > 2018 - 10 - 05 T06: 49: 45.836 - 07: 00 < /ns1:CreationDate> <
ns1: RootHeaderId > 300100090366310 < /ns1:RootHeaderId> <
ns1: CtoTransactionAttr >
<
ns1: LineId > 300100090366315 < /ns1:LineId> <
ns1: TimestampAttributeValue xsi: nil = "true" / >
<
ns1: NumberAttributeValue > 0 < /ns1:NumberAttributeValue> <
ns1: DateAttributeValue xsi: nil = "true" / >
<
ns1: CharacterAttributeValue xsi: nil = "true" / >
<
ns1: AttributeName > Number < /ns1:AttributeName> <
/ns1:CtoTransactionAttr> <
/ns2:result>