ThingWorx Flow > 创建和管理自定义操作 > 修改自定义操作的 settings.json 文件
修改自定义操作的 settings.json 文件
您可以修改 settings.json 文件来执行自定义操作的以下自定义:
创建自定义操作时,如果要包括不允许的节点模块,您可将其添加至允许列表。可在自定义操作中使用的节点模块列表可从此处获取。
* 
对于 ThingWorx Flow 9.2 及更高版本,允许列表会显示可为其添加自定义操作的内部和外部节点模块。
下表列出了默认情况下允许的 Node 模块:
Node 模块
允许列表
内部 Node 模块
"assert", "crypto", "path", "buffer", "events", "fs", "http", "https", "punycode", "querystring", "string_decoder", "url", "zlib"
* 
events 模块在自定义操作中可能不起作用。
外部 Node 模块
"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 服务的“复制”操作。
* 
默认情况下,下列第三方服务和实用程序不支持“复制”操作:
AzureDynamics 365 CRMExcel OnlineFTPFactoryTalk MOMODataOSLCSAP ODataSAP RFCSOAP“SQL 连接器”SwaggerThingWorxTwilioWindchillWindchill RV&SZendesk
即使对 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 自变量指定的位置。
2. 根据需要在步骤 3 后更新 settings.json 代码并予以保存。
要将内部节点模块列入白名单,请修改 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 自变量指定的位置。
2. 根据需要在步骤 3 后更新 settings.json 代码并予以保存。
要将内部节点模块列入允许列表,请修改 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"
]
}
}
}
}
这对您有帮助吗?