Common

Use API Stored Procedures to Post Assets

The Stewardship Tier includes some API stored procedures that allow a variety of assets to be programmatically created and changed. In order to utilize these API stored procedures users need to develop their own custom processes that populate data into the relevant staging tables within the DSPCommon database before calling the procedures to create/update assets.

Create Assets in the Knowledge Tier

The Stewardship Tier allows the following types of Knowledge Tier assets to be created:

  • Systems System Fields

  • Data Sets and Data Set Fields

  • Rules

  • Terms

The creation of these assets can be done programmatically by populating the underlying staging tables within the DSPCommon database and then executing the associated API stored procedure. This section describes how to programmatically create each of these assets.

NOTE: It is recommended that all assets are manually downloaded before creating new assets. This step is to allow new assets to reference existing users and assets.

[In 7.4.4 there will be an API procedure that allows Assets to be downloaded programmatically]

Use the API stored procedures to

Programmatically Create System in the Knowledge Tier

Procedure apiSKTSystem_PostJobIns can be used to create new systems in the Knowledge Tier. This procedure creates a job that calls the Knowledge Tier REST API based on data populated in the following tables:

  • ttSKTSystem_Post

  • ttSKTSystemSupportingDocumentation_Post

  • ttSKTSystemRelationship_Post

  • ttSKTSystemInformation_Post

  • ttSKTSystemContact_Post

This procedure has the following input parameters:

  • @zCounter (Required)—Identifies the record in table ttSKTSystem_Post that is to be created

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to “SKTSystem”

  • @QueueID (Optional)—Controls which queue the Job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)

Programmatically Create System Fields in the Knowledge Tier

Procedure apiSKTSystemField_PostJobIns can be used to create new system fields in the Knowledge Tier. This procedure creates a job that calls the Knowledge Tier REST API based on data populated in the following tables:

  • ttSKTSystemField_Post

  • ttSKTSystemFieldType_Range_Post

  • ttSKTSystemField_Type_Post

  • ttSKTSystemField_Tag_Post

  • ttSKTSystemField_RangeValue_Post

  • ttSKTSystemField_Location_Post

This procedure has the following input parameters:

  • @zCounter (Required)—Identifies the record in table ttSKTSystemField_Post that is to be created

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to ”SKTSystemField”

  • @QueueID (Optional)—Controls which queue the job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)

Programmatically Create Terms in the Knowledge Tier

Procedure apiSKTTerm_PostJobIns can be used to create new terms in the Knowledge Tier. This procedure creates a job that calls the Knowledge Tier REST API based on data populated in the following tables:

  • ttSKTTerm_Post

  • ttSKTTermSupportingDocumentation_Post

  • ttSKTTermSponsor_Post

  • ttSKTTermRelationship_Post

This procedure has the following input parameters:

  • @zCounter (Required)—Identifies the record in table ttSKTTerm_Post that is to be created

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to “SKTTerm”

  • @QueueID (Optional)—Controls which queue the job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)

Programmatically Create Rules in the Knowledge Tier

Procedure apiSKTRule_PostJobIns can be used to create new rules in the Knowledge Tier. This procedure creates a job that calls the Knowledge Tier REST API based on data populated in the following tables:

  • ttSKTRule_Post

  • ttSKTRuleSupportingDocumentation_Post

  • ttSKTRuleSponsor_Post

  • ttSKTRuleRelationship_Post

This procedure has the following input parameters:

  • @zCounter (Required)—Identifies the record in table ttSKTRule_Post that is to be created.

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to “SKTRule”

  • @QueueID (Optional)—Controls which queue the job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)

Programmatically Create Data Sets in the Knowledge Tier

Procedure apiSKTDataset_PostJobIns can be used to create new data sets in the Knowledge Tier. This procedure creates a job that calls the Knowledge Tier REST API based on data populated in the following tables:

  • ttSKTDataset_Post

  • ttSKTDatasetSupportingDocumentation_Post

  • ttSKTDatasetRelationship_Post

  • ttSKTDatasetContact_Post

This procedure has the following input parameters:

  • @zCounter (Required)—Identifies the record in table ttSKTDataset_Post that is to be created

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to “SKTDataset”

  • @QueueID (Optional)—Controls which queue the job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)

Programmatically Create Data Set Fields in the Knowledge Tier

Procedure apiSKTDatasetField_PostJobIns can be used to create new data set fields in the Knowledge Tier. This procedure creates a job that calls the Knowledge Tier REST API based on data populated in the ttSKTDatasetField_Post table .

This procedure has the following input parameters:

  • @zCounter (Required)—Identifies the record in table ttSKTDatasetField_Post that is to be created

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to ”SKTDatasetField”

  • @QueueID (Optional)—Controls which queue the job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)

Change Assets in the Knowledge Tier

The Stewardship Tier allows the following types of Knowledge Tier assets to be changed:

  • Rules

  • Terms

The change of these assets can be done programmatically by populating the underlying staging tables within the DSPCommon database and then executing the associated API Stored Procedure. This section of the document describes how to programmatically change each of these assets.

NOTE: It’s recommended that all assets are manually downloaded before making changes.

Use the API stored procedures to

Programmatically Change Rules in the Knowledge Tier

The Knowledge Tier REST API to change rules works by way of a FULL replacement of an asset based on what is sent in the request. Therefore, to avoid making unintended changes to rules, download the latest version of a rule (Published or Draft). This can be done programmatically using the procedure apiSKTRule_Put_GetSingleForChangeJobIns. This procedure extracts the data into the following tables:

  • ttSKTRule_Put

  • ttSKTRuleSupportingDocumentation_Put

  • ttSKTRuleRelationship_Put

  • ttSKTRuleSponsor_Put

This procedure has the following input parameters:

  • @zCounter—Identifies the Rule in table ttSKTRule_Get that is to be downloaded

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to “SKTRule_SingleGet”

  • @QueueID (Optional)—Controls which queue the job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)

Once the data is staged into the tables above, it can be updated and procedure apiSKTRule_PutJobIns run to change rules in the Knowledge Tier. This procedure creates a job that calls the Knowledge Tier REST API.

This procedure has the following input parameters:

  • @zCounter—Identifies the Rule in table ttSKTRule_Put that is to be downloaded

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to “SKTRuleChange”

  • @QueueID (Optional)—Controls which queue the job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)

Programmatically Change Terms in the Knowledge Tier

The Knowledge Tier REST API to change terms works by way of a FULL replacement of an asset based upon what is sent in the request. Therefore, to avoid making unintended changes to terms, download the latest version of a term (Published or Draft). This can be done programmatically using the procedure apiSKTTerm_Put_GetSingleForChangeJobIns.

This procedure extracts the data into the following tables:

  • ttSKTTerm_Put

  • ttSKTTermSupportingDocumentation_Put

  • ttSKTTermReleationship_Put

  • ttSKTTermSponsor_Put

This procedure has the following input parameters:

  • @zCounter—Identifies the Term in table ttSKTTerm_Get that is to be downloaded

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to ”SKTTerm_SingleGet”

  • @QueueID (Optional)—Controls which queue the job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)

Once the data is staged into the tables above, it can be updated and procedure apiSKTTerm_PutJobIns run to change terms in the Knowledge Tier. This procedure creates a job that calls the Knowledge Tier REST API.

This procedure has the following input parameters:

  • @zCounter—Identifies the term in table ttSKTTerm_Put that is to be downloaded

  • @boaUserID (Not Required)—This parameter is not used

  • @Group (Optional)—Controls whether a job is processed single order or multi-threaded. If left blank, the value is defaulted to ”SKTTermChange”

  • @QueueID (Optional)—Controls which queue the job is processed with. If left blank, the value is defaulted to “E8204DD3-64B2-41D1-BB51-A8248624C71C” (General Queue)