TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Customizing workflows in WSO2 API Manager
1. Customizing Workflows in
Vijayaratha Vijayasingam, Lakmali Baminiwatta
WSO2
WSO2 API Manager
October, 2014
2. *
About the Presenter(s)
Lakamali joined WSO2 in September 2011. She is
a senior software engineer in the WSO2 API
Manager team where she mainly focuses on the
development of the product.
Ratha joined WSO2 in June 2008. She is a Senior
Software engineer in the WSO2 API Manager
team. In addition to her product development
efforts she has also been a part of several onsite
customer engagements.
3. *
About WSO2
๏ Global enterprise, founded in 2005 by
acknowledged leaders in XML, web
services technologies, standards and
open source
๏ Provides only open source platform-as-a-
service for private, public and hybrid
cloud deployments
๏ All WSO2 products are 100% open
source and released under the Apache
License Version 2.0.
๏ Is an Active Member of OASIS, Cloud
Security Alliance, OSGi Alliance, AMQP
Working Group, OpenID Foundation
and W3C.
๏ Driven by Innovation
๏ Launched first open source API
Management solution in 2012
๏ Launched App Factory in 2Q 2013
๏ Launched Enterprise Store and
first open source Mobile solution
in 4Q 2013
5. *
Agenda
๏ API Management - Introduction
๏ Workflow extensions. Why are they important?
๏ Workflow integration capabilities in WSO2APIManager
๏ Workflow support for multi tenants
๏ Customizing workflows
๏ Customizing the workflow executor
๏ Future enhancements
๏ Demo
7. *
API Management
A Managed API is:
๏ Actively advertised and subscribe-able
๏ Available with SLAs
๏ Secured, authenticated, authorized and protected
๏ Monitored and monetized with analytics
9. *
Workflow extensions. Why are
they important?
Workflow - Describes the tasks, procedural steps, organizations or
people involved, required input/output , and tools needed for each
step in a business process.
๏ Governance
๏ Auditing
๏ Extensions
10. *
Workflow integration in WSO2
API Manager 1.7.0
๏ User Sign-Up
๏ Application Creation
๏ Application Registration
๏ API Subscription
12. *
Workflow trigger action
๏ workflowExternalRef - A unique ID which maps the
internal workflow reference to the external workflow
instance.
๏ callbackURL - Where to call back when the workflow
completes.
13. *
Workflow complete action
๏ Supports both SOAP and REST
๏ Secured through HTTP Basic Authentication
๏
๏ Expected parameters -
๏ workflowReference
๏ status - APPROVED/REJECTED
๏ description - Human Readable Description
16. *
Workflow support for multi
tenants
๏ Allows different tenants to define their own custom
workflows.
๏ Allows to define tenant specific human tasks.
17. *
Customizing workflows - When
to do What?
๏ Customizing the Workflow Executor
๏ When you need to change the workflow logic
๏ When you need to change the Data Formats
๏ Customizing the Business Process
๏ When you are happy with the Data Formats
and need to change only the business flow
18. *
Customizing the Workflow
Executor
/**
* This is the class that should be extended by each
workflow executor implementation.
*/
public abstract class WorkflowExecutor {
/**
* The Application Registration Web Service Executor.
*/
public class ApplicationRegistrationWSWorkflowExecutor
extends WorkflowExecutor{
19. *
Customizing the Workflow
Executor - Methods to Override
//Logic to execute the workflow
public void execute(WorkflowDTO workflowDTO).. { ..
//Logic to complete the workflow
public void complete(WorkflowDTO workflowDTO)..{ ..
//Returns the workflow type - ex: WF_TYPE_AM_USER_SIGNUP
public String getWorkflowType() { ..
//Used to get workflow details
public List<WorkflowDTO> getWorkflowDetails(String
workflowStatus) .. { ..
20. *
Customizing the Workflow
Executor
Send an email to Administrator for approval
Send Email to Administrator
21. *
Sending an email to Administrator upon
Application Registration
๏ Write a new executor extending
ApplicationRegistrationWSWorkflowExecutor
public class AppRegistrationEmailSender extends
ApplicationRegistrationWSWorkflowExecutor {
๏ Add private String attributes and public getters and setters for email
properties (adminEmail, emailAddress, emailPassword)
๏ Override execute(WorkflowDTO workflowDTO) method and implement
email sending logic. Finally invoke super.execute(workflowDTO).
public void execute(WorkflowDTO workflowDTO) {
sendEmail(adminEmail, emailAddress, emailPassword);
super.execute(workflowDTO);
}
24. *
Customizing the Business Process
๏ WSO2 Developer Studio - Business Process Editor
Subscription Creation
Default Flow
Subscription Creation
Custom Flow