ThingWorx Flow > 安装和配置 > 配置 ThingWorx Flow > 在 ThingWorx Composer 的 WorkflowSubsystem 中执行服务
在 ThingWorx Composer 的 WorkflowSubsystem 中执行服务
先决条件
ThingWorx Composer 中执行服务之前,确保满足以下先决条件:
ThingWorx Flow 服务器必须处于运行状态。
以管理员身份登录 ThingWorx
步骤
1. ThingWorx Flow 仪表板中,单击 Composer 以导航至 ThingWorx Composer
2. ThingWorx Composer 中的“系统”下,选择“子系统”
3. 选择 WorkflowSubsystem,然后单击“服务”选项卡。以下服务适用于 ThingWorx Flow
4. 搜索服务,然后执行以下任务之一:
选择服务以查看其输入信息和输出信息。
单击 。提供适当的输入值,然后单击“执行”
服务
LoadOAuthConfiguration
使用此服务可将 OAuth 配置 JSON 文件加载到 ThingWorx Flow 服务器。此服务会为在 JSON 文件中指定的连接器更新或添加 OAuth 提供者。它不会删除任何现有 OAuth。
输入
输出
参数名称
基本类型
说明
oauthConfigurations
JSON
为连接器提供具有正确 OAuth 配置设置的有效 JSON 文件。
随后会返回一条消息,表明已成功完成或在服务执行期间出错。
例如:要为 JIRA 加载 OAuth 配置,请将 oauthConfigurations 的值提供为
"jira": {
"JIRA": {
"CLIENT_ID": "<Client ID>"
"CLIENT_SECRET": "<Secret>"
}
},
有关 ThingWorx Composer 中提供的 OAuth 配置 JSON 文件模板,请参阅配置和加载 OAuth
DeleteOAuthConfiguration
如果 OAuth 提供工具未在任何连接器中使用,则使用此服务可删除 ThingWorx Flow 服务器中的 OAuth 配置。
输入
输出
参数名称
基本类型
说明
Connector config name
字符串
提供要删除其 OAuth 配置设置的有效连接器配置值
随后会返回一条消息,表明已成功完成或在服务执行期间出错。
OAuth provider
字符串
为指定连接器提供有效的 OAuth 提供者。
要删除 JIRA 的相同 OAuth 配置,请将 Connector config name 字段的值提供为 jira,并将 OAuth provider 字段的值提供为 JIRA
GetOAuthConfiguration
使用此服务可检索要将其 OAuth 加载到 ThingWorx Flow 服务器的连接器列表。系统不会显示客户端 ID、客户端机密和 URL 等敏感信息。
输入
输出
参数名称
基本类型
说明
-
返回一个 JSON,其中包含连接器名称和加载到 ThingWorx Flow 服务器的所有 OAuth 的 OAuth 提供者名称。
DeleteOAuthAccessToken
使用此服务可删除指定 OAuth 提供者的 OAuth 访问令牌。
输入
输出
参数名称
基本类型
说明
OAuth provider
字符串
为第三方服务或实用程序提供有效的 OAuth 提供工具。
随后会返回一条消息,表明已成功完成或在服务执行期间出错。
User Name
字符串
对于要删除其由指定 OAuth 提供工具生成的访问令牌的用户,请提供其 ThingWorx 用户名。
此字段为可选字段。如果未指定用户名,则服务将删除指定 OAuth 提供工具所有用户的所有 OAuth 访问令牌。
* 
在服务删除 OAuth 提供者的 OAuth 访问令牌后,会显示 ThingWorx Flow 仪表板上带有 图标的 OAuth (指定用户) 连接器。
删除用户的 OAuth 访问令牌后,用户需要为 OAuth 连接器提供其授权信息以便执行工作流:
“OAuth (指定用户)”- 编辑“OAuth (指定用户)”连接器以提供重新配置连接器的凭据。
“OAuth (会话用户)”- 在其工作流中使用此“OAuth (会话用户)”连接器的所有用户必须再次登录并向第三方服务或实用程序提供批准和授权。
RefreshMetadata
ThingWorx Flow 会缓存 Windchill OData 信息以提高性能。如果已修改 Windchill 元数据规范或已更新 Windchill 服务器上的可变属性,则可使用此服务在 ThingWorx Flow 服务器上对其进行更新。
输入
输出
参数名称
基本类型
说明
connectorName
字符串
提供第三方服务的连接器名称。
随后会返回一条消息,表明已成功完成或在服务执行期间出错。
ValidateFlowSetup
运行此服务以验证 ThingWorx 是否能够与 ThingWorx Flow 服务进行通信。
输入
输出
参数名称
基本类型
说明
随后会返回一条消息,表明已成功完成或在服务执行期间出错。
ThingWorxThingWorx Flow 服务之间出现连接问题,则会显示以下错误代码和消息。
错误代码
错误消息
[FLOW-CONFIG-01]
ThingWorx Flow is not enabled.Add the OrchestrationSettings section to the platform-settings.json file to enable ThingWorx Flow.
[FLOW-RABBIT-01]
Failed to connect to RabbitMQ.Check whether the RabbitMQ service is running and is accessible.
[FLOW-API-01]
Failed to connect to ThingWorx Flow.Check ThingWorx logs for more detail.
[FLOW-API-02]
Failed to connect to ThingWorx Flow.Make sure that you are accessing ThingWorx over the ThingWorx Flow hostname and port once ThingWorx Flow has been installed. Otherwise, ThingWorx Flow and ThingWorx will not be able to communicate with each other.
[FLOW-KEY-01]
OAuth admin key not found in the ThingWorx KeyStore.
[FLOW-KEY-02]
Exchange admin key not found in the ThingWorx KeyStore.
[FLOW-KEY-03]
Failed to get ThingWorx Flow keys from the ThingWorx KeyStore.
[FLOW-KEY-04]
Failed to get ThingWorx Flow keys from the ThingWorx KeyStore.
[FLOW-EXCHANGE-01]
Failed to connect to ThingWorx Flow exchange service.Check ThingWorx logs for more details.
[FLOW-EXCHANGE-02]
Failed to connect to ThingWorx Flow exchange service.Check whether ThingWorx Flow exchange service is up and running.
[FLOW-OAUTH-01]
Failed to connect to ThingWorx Flow OAuth service.Check ThingWorx logs for more details.
[FLOW-OAUTH-02]
Failed to connect to ThingWorx Flow OAuth service.Check whether ThingWorx Flow OAuth service is up and running.
这对您有帮助吗?