Manage Configurator Models

You use Configurator Models REST API to create and update rule folders, and to query and edit configurator extension rule text. You typically use this resource in large scale deployments where common extension rules are used across models to manage updates to them across a broad set of models.

Here's a typical application processing flow for the scenarios:

  1. You can query model, model version, and rule folder details to identify the extension rules that require update
  2. You can create and edit rule folders
  3. You can query and edit configurator extension rule text

Query Model Version Details

In this scenario, you query model version details.

Example URL

Use this resource URL format.

GET

curl -u username:password "https://servername/fscmRestApi/resources/version /configuratorModels/14446/child/versions/300100126779049"

Example Response

Here's an example of the response body in JSON format.

{
    "Version": "Draft",
    "Workspace": "GSEFlow1_180530-121517",
    "WorkspaceDescription": "GSEFlow1_180530-121517",
    "EffectiveStartDate": "2018-06-29T12:15:00+00:00",
    "CreationDate": "2018-05-30T19:16:07.049+00:00",
    "CreatedBy": "JRSMITH",
    "LastUpdateDate": "2018-05-30T19:16:12.191+00:00",
    "LastUpdatedBy": "JRSMITH"
}

Create and Edit Rule Folders

In this scenario, you:

  • Create rule folders

  • Edit rule folders

Create Rule Folders

Example URL

Use this resource URL format to create the rule folder.

POST

curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.resourceitem+json" -d 'request payload' 
"https://servername/fscmRestApi/resources/version/configuratorModels/14446/child/versions/300100126779049/child/ruleFolders/1322/child/ruleFolders"

Example Request

Here's an example of the request body in JSON format.

{
"Name": "SR Rule Folder",
"Description": "Statement Rules Rule Folder"
}

Example Response

Here's an example of the response body in JSON format.

{
    "RuleFolderId": 1322,
    "Name": "SR Rule Folder",
    "Description": "Statement Rules Rule Folder",
    "CreationDate": "2019-12-07T23:16:48.238+00:00",
    "CreatedBy": "JRSMITH",
    "LastUpdateDate": "2019-12-07T23:16:48.238+00:00",
    "LastUpdatedBy": "JRSMITH"
}

Edit rule folders

Example URL

Use this resource URL format to edit rule folders.

PATCH

curl -X PATCH -u "username:password" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -d 'request payload'  "https://servername/fscmRestApi/resources/version /configuratorModels/14446/child/versions/300100126779049/child/ruleFolders/1322/child/ruleFolders/1322"

Example Request

Here's an example of the request body in JSON format.

{
"Name": "SR Rule Folder Name Update",
"Description": "Statement Rules Rule Folder Desc Update"
}

Example Response

Here's an example of the response body in JSON format.

{
    "RuleFolderId": 1322,
    "Name": "SR Rule Folder Name Update",
    "Description": "Statement Rules Rule Folder Desc Update",
    "CreationDate": "2019-12-07T23:16:48.238+00:00",
    "CreatedBy": "JRSMITH",
    "LastUpdateDate": "2019-12-07T23:18:00.238+00:00",
    "LastUpdatedBy": "JRSMITH"
}

Edit Configurator Extension Rule Text

In this scenario, you update the extension rule text for a specific extension rule.

Example URL

Use this resource URL format.

PATCH

curl -X PATCH -u "username:password" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -d 'request payload'  "https://servername/fscmRestApi/resources/version /configuratorModels/14446/child/versions/300100126779049/child/ruleFolders/300100128519803/child/extensionRules/300100149387124"

Example Request

Here's an example of the request body in JSON format.

{
"RuleText": "def PvcEvent() {\n  def baseNode = cxEvent.baseNode\n  def config = cxEvent.configuration\n  def root = config.getRootModels().get(0)\n  def Flow1Item = root.getChildByName(\"zcz rest cx mp si1\")\n  Flow1Item.select()\n}"
}

Example Response

Here's an example of the response body in JSON format.

{
    "RuleId": 300100149387124,
    "Name": "Battery: 3.8V/2600mAh",
    "Description": null,
    "Type": "Extension Rule",
    "EnabledFlag": true,
    "StatusCode": "LOGIC_GENERATED",
    "Status": "Valid",
    "EndDate": null,
    "BaseNode": "zCZ_AT6751010.zCZ_OC4752160.zCZ_CM4751115",
    "InstantiationScopeCode": "ORA_INSTANCE",
    "InstantiationScope": "Instance",
    "RuleText": "def PvcEvent() {\n  def baseNode = cxEvent.baseNode\n  def config = cxEvent.configuration\n  def root = config.getRootModels().get(0)\n  def Flow1Item = root.getChildByName(\"zcz rest cx mp si1\")\n  Flow1Item.select()\n}",
    "CreationDate": "2018-03-20T20:37:15.038+00:00",
    "CreatedBy": "JRSMITH",
    "LastUpdateDate": "2018-06-06T14:02:39.919+00:00",
    "LastUpdatedBy": "JRSMITH"
}