com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

User Sign Up

With the introduction of workflows, when users try to sign up to the API Manager Store, their request for user accounts will go into an intermediary state where in which it will remain till approved by the workflow authorization administrator.

To enable User Sign Up workflow you will need to change the UserSign up executor from UserSignUpSimpleWorkflowExecutor to UserSignUpWSWorkflowExecutor in the <AM_HOME>/repository/conf/api-manager.xml (see below).

<!--UserSignUp executor="org.wso2.carbon.apimgt.impl.workflow.UserSignUpSimpleWorkflowExecutor"/-->
<UserSignUp executor="org.wso2.carbon.apimgt.impl.workflow.UserSignUpWSWorkflowExecutor">
     <Property name="serviceEndpoint">https://localhost:9444/services/UserSignUpWorkflowService</Property>
     <Property name="username">admin</Property>
     <Property name="password">admin</Property>
     <Property name="callbackURL">https://localhost:8243/services/WorkflowCallbackService</Property>
</UserSignUp>

When making this change you need to specify the service endpoint at which the Workflow Engine is hosted along with the credentials required to access said service via Basic Authentication (i.e., username and password). 

Note : If you wish to write your own logic for executing the BPEL workflow, you can do so by extending the WorkflowExecutor abstract class and overriding the execute() and complete() methods. After changing the configs, API Manager needs to be restarted for the changes to take effect.

By default API Manager is shipped with a sample BPEL and HumanTask for user-signup process.Additionally a jaggery based web application called 'workflow-admin' also ship with APIManager which provides a GUI for pending human tasks created by the default BPELs and Human Tasks in APIManager. To browse user-signup BPEL and Human Task, navigate to {AM_Home}/business-processes/user-signup.To get more information on running these BPELs,Human Tasks and the web application 'workflow-admin',follow the readme.txt which can be found from {AM_Home}/business-processes location.

Invoking the Workflow Engine

Once the UserSignUpWSWorkflowExecutor is engaged, whenever a user tries to sign up in API Manager Store, a request of the following format will be sent to the Workflow Endpoint (You may refer the WSDL here when implementing your custom Workflow Service) specified under serviceEndpoint in the api-manager.xml.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wor="http://workflow.subscription.apimgt.carbon.wso2.org">
   <soapenv:Header />
   <soapenv:Body>
      <wor:registerUser xmlns:wor="http://workflow.registeruser.apimgt.carbon.wso2.org">
         <wor:userName>sampleuser</wor:userName>
         <wor:tenantDomain>foo.com</wor:tenantDomain>
         <wor:workflowExternalRef>c0aad878-278c-4439-8d7e-712ee71d3f1c</wor:workflowExternalRef>
         <wor:callbackURL>https://localhost:8243/services/WorkflowCallbackService</wor:callBackURL>
      </wor:registerUser>
   </soapenv:Body>
</soapenv:Envelope>

A detailed explanation of each property is as follows. 

Property
Description
userName
The user name requested by the user
tenantDomainDomain to which said user belongs to
workflowExternalRefThe unique reference against which a workflow will be tracked. This will need to be sent back from the Workflow Engine to API Manager at the time of workflow completion.
callBackURL

At the time of workflow completion, this is URL to which the "Workflow completed" request will be sent to by the Workflow Engine. This property is configured under the "callBackURL" property in the api-manager.xml

(Can be either a SOAP or REST endpoint)

In addition to invoking the Workflow Engine, at the time of executing a Workflow an entry will be added to the AM_WORKFLOWS table in the API Manager Database, indicating the workflow status and workflow external reference along with a host of other information. This entry in turn will be used to track the progress of the workflow throughout its lifecycle. At a given time, the status of a workflow can be either 'CREATED', APPROVED' or 'REJECTED'. 'CREATED' is the default status of a workflow, it will get promoted to either 'APPROVED' or 'REJECTED' state based on the response from Workflow Engine.

Note : A user may maintain any number of states/steps for a workflow in between the CREATED and APPROVED / REJECTED states inside the Workflow Engine. API Manager will only acknowledge the CREATED and APPROVED / REJECTED states.

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.