简体   繁体   English

WSO2 API管理器-是否可以按API或层创建自定义工作流?

[英]WSO2 API Manager - Is it possible to create a custom workflow by API or tiers?

I'm trying to create custom workflow on Wso2 api manager. 我正在尝试在Wso2 api管理器上创建自定义工作流。 It's really easy and efficient. 这真的很容易而且有效。 So now, I would add a custom subscription workflow and define which API or tiers should use it. 因此,现在,我将添加一个自定义订阅工作流程,并定义应该使用它的API或层。

For example with different tiers: 例如,使用不同的层:

  1. I'm a developer and I choose api A with tiers Bronze : when I subscribe to the API, the workflow 1 is execute. 我是一名开发人员,我选择具有Bronze层的api A :当我订阅该API时, 工作流1已执行。
  2. I'm an other developer and I choose api A with tiers Silver : when I subscribe to the API, the workflow 2 is execute. 我是另一位开发人员,我选择具有Silver层的api A :当我订阅API时, 工作流2已执行。

I don't find documentation about it. 我找不到有关它的文档。 Is it possible ? 可能吗 ? Should I code a general custom workflow and use a switch case ? 我应该编写通用的自定义工作流程并使用开关盒吗?

Thank a lot 非常感谢

This can be possible with wso2 API Manager and BPS. 使用wso2 API Manager和BPS可以做到这一点。 When you are subscribe to an application it would execute the customized subscription flow. 订阅应用程序时,它将执行自定义的订阅流程。 To do that you should extend the subscription flow by extending SubscriptionCreationWSWorkflowExecutor.java class. 为此,您应该通过扩展SubscriptionCreationWSWorkflowExecutor.java类来扩展SubscriptionCreationWSWorkflowExecutor.java流程。 Override the complete() method. 重写complete()方法。 Create a jar file and add to the following path <APIM_HOME> /repository/components/lib. 创建一个jar文件并将其添加到以下路径<APIM_HOME> / repository / components / lib。 Start the apimanager server. 启动apimanager服务器。 Log in to APIM management console and select Browse under Resources . 登录到APIM管理控制台,然后在“资源”下选择“浏览”。 Go to /_system/governance/apimgt/applicationdata/workflow-extensions.xml resource, disable the Simple Workflow Executor and enable WS Workflow Executor. 转到/_system/governance/apimgt/applicationdata/workflow-extensions.xml资源,禁用简单工作流执行器,然后启用WS工作流执行器。 Then change the executor class to newly created class. 然后将执行程序类更改为新创建的类。

https://docs.wso2.com/display/AM190/Adding+an+API+Subscription+Workflow https://docs.wso2.com/display/AM191/Customizing+a+Workflow+Extension https://docs.wso2.com/display/AM190/Adding+an+API+Subscription+Workflow https://docs.wso2.com/display/AM191/Customizing+a+Workflow+Extension

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM