針對自訂動作修改 settings.json 檔案
您可以修改 settings.json 檔案,以針對自訂動作執行下列自訂:
• 建立自訂動作時,如果要包括未允許的節點模組,您可將其新增至允許清單。您可以在自訂動作中使用的節點模組清單位於
此處。
|
針對 ThingWorx Flow 9.2 及更新版本,允許清單會顯示可新增自訂動作的內部與外部節點模組。 |
下表列出預設允許的節點模組:
節點模組
|
允許清單
|
內部節點模組
|
"assert", "crypto", "path", "buffer", "events", "fs", "http", "https", "punycode", "querystring", "string_decoder", "url", "zlib"
|
外部節點模組
|
"request", "lodash", "soap", "xml2js", "ws", "ptc-apiai-connector", "ptc-aws-connector", "ptc-azure-connector", "ptc-bitly-connector", "ptc-box-connector", "ptc-clock-connector", "ptc-dropbox-connector", "ptc-dynamics365-connector", "ptc-devtools-connector", "ptc-excel-connector", "ptc-file-connector", "ptc-ftp-connector", "ptc-flow-sdk", "ptc-github-connector", "ptc-gitlab-connector", "ptc-google_form-connector", "ptc-google_gmail-connector", "ptc-google_drive-connector", "ptc-google_sheet-connector", "ptc-google_task-connector", "ptc-google_translator-connector", "ptc-ILMconnector-connector", "ptc-jira-connector", "ptc-odata-connector", "ptc-office365-connector", "ptc-onedrive-connector", "ptc-oslc-connector", "ptc-pubnub-connector", ptc-rockwell-connector", "ptc-rss_feeds-connector", "ptc-salesforce-connector", "ptc-sap_odata-connector", "ptc-sap_rfc-connector", "ptc-servicemax-connector", "ptc-slack-connector", "ptc-soap-connector", "ptc-swagger-connector", "ptc-thingworx-connector", "ptc-thingworx_mapper-connector", "ptc-trello-connector", "ptc-twilio-connector", "ptc-usgeocoder-connector", "ptc-windchill-connector", "ptc-youtube-connector", "ptc-zendesk-connector", "ptc-webtools-connector", "ptc-database-connector"
|
• 您可針對現成 ThingWorx Flow 服務允許或禁止「複製」動作。
|
依預設,下列協力廠商服務與公用程式不支援「複製」動作:
Azure、Dynamics 365 CRM、Excel Online、FTP、FactoryTalk MOM、OData、OSLC、SAP OData、SAP RFC、SOAP、「SQL 連接器」、Swagger、ThingWorx、Twilio、Windchill、Windchill RV&S、Zendesk
即使您修改 settings.json 檔案以針對這些協力廠商服務與公用程式允許「複製」動作,該動作也無法使用。
|
欲針對 ThingWorx Flow 伺服器上的自訂動作更新 settings.json 檔案,請執行下列操作:
針對 ThingWorx Flow 9.0 與 9.1
1. 執行下列指令,從 ThingWorx Flow 的實例下載組態設定:
flow-deploy settings download -f <Path_to_Customization_File> -t <ThingWorx_Base_URL> -u <ThingWorx_Administrator_Username> -p '<ThingWorx_Administrator_Password>' -c devtools -s default
此指令會將組態檔案下載至您使用指令中的 -f 引數指定的位置。
◦ 欲將內部節點模組加入白名單,請修改 settings.json 檔案中的 whiteListBuiltInModules 部份。
◦ 欲將外部節點模組加入白名單,請修改 settings.json 檔案中的 whiteListExternalModules 部份。
◦ 欲針對任何服務允許或禁止「複製」動作,請修改 settings.json 檔案中的 copyProhibitedConnectors 區段。
3. 執行下列指令,將組態設定上載至 ThingWorx Flow 的實例:
flow-deploy settings upload -f <Path_to_Customization_File> -t <ThingWorx_Base_URL> -u <ThingWorx_Administrator_Username> -p '<ThingWorx_Administrator_Password>' -c devtools -s default
此指令會從您使用指令中的 -f 引數指定的位置上載組態檔案。
成功上載檔案之後,您可在建立自訂動作時使用這些自訂。
ThingWorx Flow 9.0 與 ThingWorx Flow 9.1 的 settings.json 程式碼
{
"connectorid": "devtools",
"configschema": {
"$id": "https://example.com/person.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Devtools - WhiteListed Modules",
"type": "object",
"properties": {
"whiteListExternalModules": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"request",
"lodash",
"soap",
"xml2js",
"ws",
"ptc-apiai-connector",
"ptc-aws-connector",
"ptc-azure-connector",
"ptc-bitly-connector",
"ptc-box-connector",
"ptc-clock-connector",
"ptc-dropbox-connector",
"ptc-dynamics365-connector",
"ptc-devtools-connector",
"ptc-excel-connector",
"ptc-file-connector",
"ptc-ftp-connector",
"ptc-flow-sdk",
"ptc-github-connector",
"ptc-gitlab-connector",
"ptc-google_form-connector",
"ptc-google_gmail-connector",
"ptc-google_drive-connector",
"ptc-google_sheet-connector",
"ptc-google_task-connector",
"ptc-google_translator-connector",
"ptc-ILMconnector-connector",
"ptc-jira-connector",
"ptc-odata-connector",
"ptc-oslc-connector",
"ptc-office365-connector",
"ptc-onedrive-connector",
"ptc-pubnub-connector",
"ptc-rockwell-connector",
"ptc-rss_feeds-connector",
"ptc-salesforce-connector",
"ptc-sap_odata-connector",
"ptc-sap_rfc-connector",
"ptc-servicemax-connector",
"ptc-slack-connector",
"ptc-soap-connector",
"ptc-swagger-connector",
"ptc-thingworx-connector",
"ptc-thingworx_mapper-connector",
"ptc-trello-connector",
"ptc-twilio-connector",
"ptc-usgeocoder-connector",
"ptc-windchill-connector",
"ptc-youtube-connector",
"ptc-zendesk-connector",
"ptc-webtools-connector",
"ptc-database-connector"
]
},
"whiteListBuiltInModules": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"assert",
"crypto",
"path",
"buffer",
"events",
"fs",
"http",
"https",
"punycode",
"querystring",
"string_decoder",
"url",
"zlib"
]
},
"copyProhibitedConnectors": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"azure",
"excel",
"ftp",
"rockwell",
"odata",
"sap_odata",
"sap_rfc",
"soap",
"swagger",
"thingworx",
"windchill",
"dynamics365",
"integrity",
"zendesk",
"twilio",
"database",
"oslc"
]
}
}
}
}
針對 ThingWorx Flow 9.2
1. 執行下列指令,從 ThingWorx Flow 的實例下載組態設定:
flow-deploy settings download -f <Path_to_Customization_File> -t <ThingWorx_Base_URL> -u <ThingWorx_Administrator_Username> -p '<ThingWorx_Administrator_Password>' -c devtools -s default
此指令會將組態檔案下載至您使用指令中的 -f 引數指定的位置。
◦ 欲將內部節點模組加入允許清單,請修改 settings.json 檔案中的 allowBuiltInModulesList 部份。
◦ 欲將內部節點模組加入允許清單,請修改 settings.json 檔案中的 allowExternalModulesList 部份。
◦ 欲針對任何服務允許或禁止「複製」動作,請修改 settings.json 檔案中的 copyProhibitedConnectors 區段。
3. 執行下列指令,將組態設定上載至 ThingWorx Flow 的實例:
flow-deploy settings upload -f <Path_to_Customization_File> -t <ThingWorx_Base_URL> -u <ThingWorx_Administrator_Username> -p '<ThingWorx_Administrator_Password>' -c devtools -s default
此指令會從您使用指令中的 -f 引數指定的位置上載組態檔案。
成功上載檔案之後,您可在建立自訂動作時使用這些自訂。
ThingWorx Flow 9.2 的 settings.json 程式碼
{
"connectorid": "devtools",
"configschema": {
"$id": "https://example.com/person.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Devtools - Allowed Modules List",
"type": "object",
"properties": {
"allowExternalModulesList": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"request",
"lodash",
"soap",
"xml2js",
"ws",
"ptc-apiai-connector",
"ptc-aws-connector",
"ptc-azure-connector",
"ptc-bitly-connector",
"ptc-box-connector",
"ptc-clock-connector",
"ptc-dropbox-connector",
"ptc-dynamics365-connector",
"ptc-devtools-connector",
"ptc-excel-connector",
"ptc-file-connector",
"ptc-ftp-connector",
"ptc-flow-sdk",
"ptc-github-connector",
"ptc-gitlab-connector",
"ptc-google_form-connector",
"ptc-google_gmail-connector",
"ptc-google_drive-connector",
"ptc-google_sheet-connector",
"ptc-google_task-connector",
"ptc-google_translator-connector",
"ptc-integrity-connector",
"ptc-jira-connector",
"ptc-odata-connector",
"ptc-oslc-connector",
"ptc-office365-connector",
"ptc-onedrive-connector",
"ptc-openpdm-connector",
"ptc-pubnub-connector",
"ptc-rockwell-connector",
"ptc-rss_feeds-connector",
"ptc-salesforce-connector",
"ptc-sap_odata-connector",
"ptc-sap_rfc-connector",
"ptc-servicemax-connector",
"ptc-slack-connector",
"ptc-soap-connector",
"ptc-swagger-connector",
"ptc-thingworx-connector",
"ptc-thingworx_mapper-connector",
"ptc-trello-connector",
"ptc-twilio-connector",
"ptc-usgeocoder-connector",
"ptc-windchill-connector",
"ptc-youtube-connector",
"ptc-zendesk-connector",
"ptc-webtools-connector",
"ptc-database-connector"
]
},
"allowBuiltInModulesList": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"assert",
"crypto",
"path",
"buffer",
"events",
"fs",
"http",
"https",
"punycode",
"querystring",
"string_decoder",
"url",
"zlib"
]
},
"copyProhibitedConnectors": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"azure",
"excel",
"ftp",
"rockwell",
"odata",
"openpdm",
"sap_odata",
"sap_rfc",
"soap",
"swagger",
"thingworx",
"windchill",
"dynamics365",
"integrity",
"zendesk",
"twilio",
"database",
"oslc"
]
}
}
}
}