Skip to main content

サプライ・チェーン・データ・モデル API

このページでは、InterSystems Supply Chain Orchestrator™ で提供されるデータ・モデル API について説明します。

Supply Chain Orchestrator には、モデルの検出とカスタマイズに使用できる、以下の手段を提供するデータ・モデル APIOpens in a new tab が含まれます。

  • すべてのサプライ・チェーン・データ・オブジェクトをリスト

  • 任意のオブジェクトの詳細 (属性、データ型、サイズ制限など) を取得

  • 既存のサプライ・チェーン・オブジェクトにカスタム属性を追加することでデータ・モデルを拡張

サプライ・チェーン・データ・オブジェクトのリスト

この API 呼び出しを使用して、データ・モデル内のすべてのサプライ・チェーン・オブジェクトを検索します。

GET {{IRIS-SERVER}}/api/scdata/v1/objects

応答は以下の例のようになります。

[
    {
        "objectName": "BOM",
        "className": "SC.Data.BOM",
        "description": "Object for bill of material. This object is commonly
                        used in manufacturing to specify the parts required 
                        to make or assemble a product."
    },
    {
        "objectName": "Carrier",
        "className": "SC.Data.Carrier",
        "description": "This object is used to capture shipment 
                        carrier information."
    },
...
]

各オブジェクトの詳細を検索するには、この API 応答で返された objectName 値を、次の API 呼び出しで指定します。

オブジェクト定義の取得

オブジェクトの詳細を取得するには、まず上記の API 呼び出しを使用してオブジェクト名を取得します。次に、以下の API 呼び出しを使用します。

GET {{IRIS-SERVER}}/api/scdata/v1/objects/[ObjectName]

例えば、以下に示すのは、Customer オブジェクトに対して返される応答の一部です。

{
    "objectName": "Customer",
    "className": "SC.Data.Customer",
    "objectName": "This object is used to capture the master
                  data for a customer.",
    "attributes": [
        {
            "name" : "uid",
            "description" : "unique ID of a customer",
            "dataType" : "String",
            "required" : 1,
            "maxLength" : "256",
            "isCustom" : 0
        },
        {
            "name" : "name",
            "description" : "official name of the customer",
            "dataType" : "String",
            "required" : 0,
            "maxLength" : "256",
            "isCustom" : 0
        },
...
    ]
}

カスタム属性の追加

サプライ・チェーン・モデル内のオブジェクトに新しい属性を追加するには、以下の API 呼び出しを使用します。

POST {{IRIS-SERVER}}/api/scdata/v1/attributes/[ObjectName]

この際に、以下のように API 本文に属性定義の JSON を含めます。

{
    "name" : "customProperty",
    "description" : "Custom attribute added for testing",
    "dataType" : "String",
    "maxlength" : 120,
    "required" : 1
}

この API によって属性が追加されると、データ・アクセス API を使用して、属性にデータをロードしたり、新規作成した属性に基づいてレコードを検索することができるようになります。追加の手順や待機は必要ありません。

Important:

この API では、インデックスや検証ルールの追加など、クラスを直接変更することによって実行される、より高度なカスタマイズはサポートされません。また、カスタム属性を更新または削除する API は存在しないため、この API は注意して使用してください。

関連項目

FeedbackOpens in a new tab