Enterworks
In an application, right-click on Sources -> select Create source -> type any Source name and select EnterworksSource in the Source type field -> click Create.
-
hostName - hostname
-
userName - user name
-
password - password
-
basicAccessToken - contact us to get the token
-
UIURL: It is used to implement impersonation when InfoLink is embeded into Enable UI. If provided, it is concatenated as prefix to
/enable-api/reauthcall. If not provided, the prefix is constructed from the current browser URL. -
passGetTokenCredentialsInURL: Because Enable REST API is changed starting with version 10.2.1, if you use Enable before 10.2.1, you have to go to all Enable API sources and set parameter passGetTokenCredentialsInURL to
true.
Transform
You can use Transform operation to query data in Enable repositories using JSON from the Enable API call POST /api/items/filters. In Transform select any EnterworksSource-typed source as source, any target source (eg MSSQLServerSource-typed source), enter JSON into the query editor. For example, the following query returns all records from repository 10060. To use filtering/joins/etc read about POST /api/items/filter in the Enable API documentation at <enable-host>/webcm/rest/swagger-ui.html
{
"repositoryId": 10060,
"page": 1,
"pageSize": 100,
"getCodeSetDescInd": false,
"userPreferenceId": 0,
"savedSetId":0
}RunSourceJob
RunSourceJob supports the following two type of jobs:
-
/api/items/promote: Here is an example:
{ "into":{ "spaceName":null, "sourceName":null, "tableName":null }, "opName":"RunSourceJob", "opParams":{ "name":"/api/items/promote", "sourceName":"Enable_API", "params":{ "repositoryId":"10321" }, "body":[] }, "title":"RunSourceJob: /api/items/promote", "targetTables":[] } -
/api/items/validateAll: Here is an example:
{ "into":{ "spaceName":null, "sourceName":null, "tableName":null }, "opName":"RunSourceJob", "opParams":{ "name":"/api/items/validateAll", "sourceName":"Enable_API", "params":{ "repositoryId":"10321" }, "body":{ "validateDynAttrInd":0, "correctionFileTypeCode":0, "savedSetId":0, "validationLevelInd":4, "correctionFileInd":0, "validationOption":1 } }, "title":"RunSourceJob: /api/items/validateAll", "targetTables":[] }
Loading data using Import Templates
Our “Connectors” application contains a scenario called “Enterworks” that implements steps described in
http://<enable-host>:8090/webcm/rest/swagger-ui.html#!/Item_API/importItemUsingPOSTBrief description:
-
Call
http://<enable-host>:8090/webcm/rest/api/items/import/filesand getdnsId. -
Call
http://<enable-host>:8090/webcm/rest/api/items/import/mappingspassingdnsId(from the prev call) andimportConfigId(which the import template id) -
Call
http://<enable-host>:8090/webcm/rest/api/items/importpassing the following as body and get job id:{ "dsnId": parseInt($il.variables.dnsId), <------- this is from the first call "fileMappingList": JSON.parse($il.variables.importMappingArray), <----- this is from the previous call "startLineNum": 2, "startLineText": "", "startLineType": "Number", "stopLineNum": null, "stopLineText": "", "stopLineType": "EOF" } -
Then using the job id I call:
http://<enable-host>:8090/webcm/rest/api/jobs/${jobId}/historywhile jobStatus == 0 - it means still executing.