受注構成でのWebサービスの使用例
次のサンプル・ペイロードを使用して、受注構成でwebサービスを使用する方法について、いくつかのアイデアを取得します。
基本問合せ
単純条件の問合せ
findCtoItemStructureを使用して、構成済品目VIK12-100の構造全体を取得します。
<?xml version="1.0" encoding="UTF-8"?>
<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>
-- Get all rows
<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 on ConfigItemNumber
<ns2:operator>=</ns2:operator>
<ns2:value>VIK12-100</ns2:value>
--value for Configured Item Number
</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>
複数の条件に対する問合せおよびフィルタ結果
findCtoItemStructureを使用して、構成モデルがVIK12である2018年12月9日から2019年12月9日までの間に作成された各構成品目の構造全体を取得します。 レスポンスにInventoryItemId属性またはParentInventoryItemId属性を含めないでください。
<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>
<ns2:upperCaseCompare></ns2:upperCaseCompare>
<ns2:attribute>CreationDate</ns2:attribute>
<ns2:operator>between</ns2:operator>
<ns2:value>2018-10-9</ns2:value> -- Use format YYYY-MM-DD.
<ns2:value>2019-12-09</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare></ns2:upperCaseCompare>
<ns2:attribute> BaseModelItemNumber </ns2:attribute>
<ns2:operator>CONTAINS</ns2:operator>
<ns2:value>VIK12</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:findAttribute>InventoryItemId</ns2:findAttribute> --List of attributes to include or not include in response.
<ns2:findAttribute>ParentInventoryItemId</ns2:findAttribute>
<ns2:excludeAttribute>true</ns2:excludeAttribute> --true means don't include in response.
</ns1:findCriteria>
</ns1: findCtoItemStructure>
リフレッシュしてから複数の条件で問合せ
findCtoItemStructureを使用して、構成モデルがVIK12である2018年12月9日から2019年12月9日までの間に作成された各構成品目の構造全体を取得します。 RefreshStructureを使用して、展開リポジトリをリフレッシュします。
<ns1: findCtoItemStructurexmlns: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>-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>
<ns2:upperCaseCompare></ns2:upperCaseCompare>
<ns2:attribute>CreationDate</ns2:attribute>
<ns2:operator>between</ns2:operator>
<ns2:value>2018-10-09</ns2:value> -- Use format YYYY-MM-DD.
<ns2:value>2019-12-09</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare></ns2:upperCaseCompare>
<ns2:attribute> BaseModelItemNumber </ns2:attribute>
<ns2:operator>CONTAINS</ns2:operator>
<ns2:value>VIK12</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare></ns2:upperCaseCompare>
<ns2:attribute> RefreshStructure </ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>true</ns2:value> -- Use true or false with RefreshStructure.
</ns2:item>
</ns2:group>
</ns2:filter>
</ns1:findCriteria>
</ns1: findCtoItemStructure>
大規模な構造の取得
大規模な構造の取得
構成品目構成のwebサービス・レスポンスに500行を超える行が含まれている場合は、500行のセットごとにサービスを1回呼び出す必要があります。 たとえば、構造に1550行が含まれている場合は、4つのコールを実行します。
-
初回コールで0から499行を取得
-
2番目のコールで500から999行を取得
-
3回目のコールで1,000行から1,499行を取得
-
4回目のコールでは、行1,500から1,550が取得されます
最初のコールで開始値を0より大きい値に設定することはできません。 2番目のコールの開始値がゼロより大きいため、webサービスはリポジトリをリフレッシュしません。 最初のコールで開始値を0に設定すると、webサービスによって構造全体がリフレッシュされます。
この例では、レスポンスに690行が含まれているとします。
-
最初のコールでは開始を0に設定し、サイズを500に設定して行0から499を取得します。
-
2番目のコールでは、開始を500に設定して、行500から690を取得します。
これが最初のコールです。
<?xml version="1.0" encoding="UTF-8"?>
<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>2018-12-09</ns2:value>
<ns2:value>2019-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>
これが2回目のコールです。
<?xml version="1.0" encoding="UTF-8"?>
<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>2018-12-09</ns2:value>
<ns2:value>2019-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>
リフレッシュしてから大きな構造を取得
findCtoItemStructureを使用して大きな構造を取得すると、まず展開リポジトリをリフレッシュして構造の詳細を取得してからデータを問い合せる必要があるため、時間がかかる場合があります。 この問題を回避するには、2つの呼び出しを行います。
-
リポジトリをリフレッシュします。
-
構造を取得します。
各コールで同じパラメータ値を使用します。
これが最初のコールです。
<?xml version="1.0" encoding="UTF-8"?>
<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>2018-12-09</ns2:CreationDateFrom>
<ns2:CreationDateTo>2019-12-09</ns2:CreationDateTo>
</ns1:configList>
</ns1:refreshConfigStructure>
後続のコールを追加して構造を取得します。 前述の「大規模な構造の取得」セクションを参照してください。
その他の問合せ
条件のグループ化
この例では、findCtoItemStructureを使用して、構成モデルVIK12の09- Dec-2018から09-Dec-2019の間に作成された各構成品目の構造全体を取得します。 OR結合を使用して条件をグループ化します。
<?xml version="1.0" encoding="UTF-8"?>
<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>2018-12-09</ns2:value>
<ns2:value>2019-12-09</ns2:value>
</ns2:item>
</ns2:group>
<ns2:group>
<ns2:conjunction>Or</ns2:conjunction>
--Group with the OR condition.
<ns2:upperCaseCompare />
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare />
<ns2:attribute>BaseModelItemNumber</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>VIK12</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>
トランザクション属性の取得
findCtoItemStructureを使用して、VIK12-100構成済品目の構造全体を取得します。 MFG_Transactional_Attributesで始まり、値Blackを含むトランザクション属性名の詳細のみが含まれるように結果をフィルタします。
<ns1:findCtoItemStructure xmlns:ns1="http://xmlns.oracle.com/apps/scm/cto/matchRepository/utilities/configItemStructureService/types/"
>
<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>
<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>AttributeName</ns2:attribute>
<ns2:operator>STARTSWITH</ns2:operator>
<ns2:value>MFG_Transactional_Attributes</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>CharacterAttributeValue</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>Black</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:childFindCriteria/>
<ns2:childAttrName>CtoTransactionAttr</ns2:childAttrName> -- This value is fixed and needs to be passed if we want filter based on the TIA
</ns2:childFindCriteria>
</ns1:findCriteria>
<ns1:findControl>
<ns2:retrieveAllTranslations>false</ns2:retrieveAllTranslations>
</ns1:findControl>
</ns1:findCtoItemStructure>
トランザクション属性に従って品目構成全体を取得
2018年12月9日から2019年12月9日までの間に作成された構成品目の品目構成全体を取得し、トランザクション属性SCO_colorの値が黒です。
このサービスを2回呼び出します。
-
フィルタに一致する構成品目を取得します。
-
最初のコールがパラメータとして返す値(ConfigItemNumberなど)を使用します。
これが最初のコールです。
<?xml version="1.0" encoding="UTF-8"?>
<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>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>
<ns2:value>2018-12-09</ns2:value>
<ns2:value>2019-12-09</ns2:value>
</ns2:item>
<ns2:item>
--This block contains logic for filtering configured items according to TIA
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>CtoTransactionAttr</ns2:attribute>
<ns2:operator>Exists</ns2:operator>
<ns2:nested>
<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>AttributeName</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>SCO_Color</ns2:value>
</ns2:item>
<ns2:item>
<ns2:conjunction>And</ns2:conjunction>
<ns2:upperCaseCompare>false</ns2:upperCaseCompare>
<ns2:attribute>CharacterAttributeValue</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>Black</ns2:value>
</ns2:item>
</ns2:group>
</ns2:nested>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:excludeAttribute />
</ns1:findCriteria>
</ns1:findCtoItemStructure>
これが2回目のコールです。
<?xml version="1.0" encoding="UTF-8"?>
<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 />
</ns2:filter>
<ns2:excludeAttribute />
</ns1:findCriteria>
</ns1:findCtoItemStructure>
品目構成の削除
構成済品目の構造をリポジトリから削除します。
品目番号としてVIK12を含むすべての構成済品目の構造を削除するペイロードを次に示します。
<?xml version="1.0" encoding="UTF-8"?>
<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>