Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Log in to the APIM management console (https://<Server Host>:9443/carbon) and select Browse under Resources.
  2. Go to the /_system/governance/apimgt/applicationdata/workflow-extensions.xml resource, disable the Simple Workflow Executor and enable WS Workflow Executor. 

    Code Block
    languagehtml/xml
    <WorkFlowExtensions>
    	....
    	<!-- Publisher related workflows -->
    	<!--<APIStateChange executor="org.wso2.carbon.apimgt.impl.workflow.APIStateChangeSimpleWorkflowExecutor" />-->
    	<APIStateChange executor="org.wso2.carbon.apimgt.impl.workflow.APIStateChangeWSWorkflowExecutor">
        	<Property name="processDefinitionKey">APIStateChangeApprovalProcess</Property>
        	<Property name="stateList">Created:Publish,Published:Block</Property>   	 
    	</APIStateChange>
    	....
    </WorkFlowExtensions>

    You have now engaged the API WS Workflow. The default configuration is set for Created to Publish and Published to Block state changes. See Advanced Configurations for information on configuring more state changes. 

  3. Log in to the API Publisher (https://<Server Host>:9443/publisher) and publish an API. See Create and Publish an API. A message related to the publish workflow will be displayed because the workflow is enabled for Created to Publish state change.

    Info

    Note that the Save & Publish button will be disabled until the workflow task is completed or deleted.

  4. You can revoke the state change by clicking Delete Task in the Lifecycle tab.

  5. Log in to the Admin Portal (https://<Server Host>:9443/admin) and click API State Change to see the list of tasks awaiting approval. 
    Click Assign to Me to approve the taskSelect Approve and click Complete to resume and complete the API state change.

...

Code Block
titleWS WorkFlow
<APIStateChange executor="org.wso2.carbon.apimgt.impl.workflow.APIStateChangeWSWorkflowExecutor">
   	<Property name="processDefinitionKey">APIStateChangeApprovalProcess</Property>
   	<Property name="stateList">Created:Publish,Published:Block</Property>   	
</APIStateChange>

 


The elements of the above configuration are explained below.

 

Element Name

Mandatory/Optional

Description

processDefinitionKey

Mandatory

BPMN process definition id.  BPMN process provided with AM as default has ‘APIStateChangeApprovalProcess’ as the id

stateList

Mandatory

This is a comma separated list of the current state and intended action. For example, Created:Publish,Published:Block

serviceEndpoint

Optional

The URL of the BPMN process engine. This overrides the global <ServerUrl> value from the api-manager.xml file. This can be used to connect a separate workflow engine for a tenant.

username

Optional

Username for the external BPMN process engine. This overrides <ServerUser> defined in the api-manager.xml file for the tenant.

password

Optional

password for the external BPMN process engine. This overrides <ServerPassword> defined in the api-manager.xml file for the tenant.

 

...