Configuring Workflows in a Cluster

If you are working in a clustered API Manager setup with the Developer Portal, Publisher, Gateway and Key Manager in separate servers, do the workflow configurations that are discussed in the previous topics in the Developer Portal node . In addition, do the following configurations.

In this guide, you access the Admin Portal ( https://:9443/admin ) Web application using the same node as the API Publisher. This is recommended because workflow management is an administrative task and is meant to reside within a private network as the Publisher. Typically, the Admin Portal from the same user store as the API Manager. Therefore, you can use the Admin Portal residing in the Publisher node instead of having it separately. This eliminates the need for a dedicated workflow management node. You need a dedicated node if the Admin Portal users reside in a separate user store.

  1. If you want to change the user roles that can access the Admin Portal, open the <API-M_HOME>/repository/deployment/server/jaggeryapps/admin/site/conf/site.json file that is in the node from where you access the Admin Portal (the API Publisher node in this example) and change its Allowed Roles parameter. You can add multiple user roles as a comma-separated list.

  2. By default, workflow related configuration files have the port of the Business Process Server with an offset of 2. If you set up the BPS with a different port offset, change the workflow server URLs in the site.json file accordingly.

  3. Point the uri-template sub element of the <endpoint> element to the node where the Admin Portal is enabled (preferably the Publisher node) in the <API-M_HOME>/repository/deployment/server/synapse-configs/default/proxy-services/WorkflowCallbackService.xml file of the Developer Portal node.

            <send>
                <endpoint>
                    <http method="POST"
                          uri-template="https://<PUBLISHER_IP>:9443/api/am/admin/v0.16/workflows/update-workflow-status?workflowReferenceId={uri.var.workflowRef}"/>
                </endpoint>
            </send>
  4. Add the IP address and the port of the Developer Portal to the <Address> element of the .epr file of the workflow that you configure. You can find the .epr file by the name of the workflow in the <API-M_HOME>/business-processes/epr folder.

  5. Go to the <API-M_HOME>/business-processes/<workflow name>/BPEL folder and unzip the file that is there by the name of the workflow. For example, <API-M_HOME>/business-processes/user-signup/BPEL/UserSignupApprovalProcess_1.0.0.zip .

  6. Go inside the unzipped folder and do the following:

    Action Example
    Open the ApprovalTask WSDL file and point the address elements of the server where the BPEL runs.

    In the <APIM_HOME>/business-processes/user-signup/BPEL/UserSignupApprovalProcess_1.0.0/UserApprovalTask.wsdl file:

    <wsdl:service name="UserApprovalService">
       <wsdl:port name="UserApprovalPort" binding="tns:UserApprovalBinding">
          <soap:address location="http://localhost:9765/services/UserApprovalService" />
          </wsdl:port>
       </wsdl:service>
       <wsdl:service name="UserApprovalServiceCB">
          <wsdl:port name="UserApprovalPortCB" binding="tns:UserApprovalBindingCB">
             <soap:address location="http://localhost:9765/services/UserApprovalServiceCB" />
          </wsdl:port>
       </wsdl:service>
    </wsdl:service>
    !!! tip

    Note that all workflow process services of the BPS run on port 9765 because you changed its default port (9763) with an offset of 2.

    Open the CallbackService WSDL file and point the address elements to the Developer Portal node in NIO port.

    In the <APIM_HOME>/business-processes/user-signup/BPEL/UserSignupApprovalProcess_1.0.0/WorkflowCallbackService.wsdl file:

    <wsdl:service name="WorkflowCallbackService">
            <wsdl:port name="WorkflowCallbackServiceHttpsSoap11Endpoint" binding="ns:WorkflowCallbackServiceSoap11Binding">
                <soap:address location="https://localhost:8243/services/WorkflowCallbackService.WorkflowCallbackServiceHttpsSoap11Endpoint"/>
            </wsdl:port>
            <wsdl:port name="WorkflowCallbackServiceHttpSoap11Endpoint" binding="ns:WorkflowCallbackServiceSoap11Binding">
                <soap:address location="http://localhost:8280/services/WorkflowCallbackService.WorkflowCallbackServiceHttpSoap11Endpoint"/>
            </wsdl:port>       
    <wsdl:port name="WorkflowCallbackServiceHttpsSoap12Endpoint" binding="ns:WorkflowCallbackServiceSoap12Binding"> <soap12:address location="https://localhost:8243/services/WorkflowCallbackService.WorkflowCallbackServiceHttpsSoap12Endpoint"/> </wsdl:port> <wsdl:port name="WorkflowCallbackServiceHttpSoap12Endpoint" binding="ns:WorkflowCallbackServiceSoap12Binding"> <soap12:address location="http://localhost:8280/services/WorkflowCallbackService.WorkflowCallbackServiceHttpSoap12Endpoint"/> </wsdl:port> <wsdl:port name="WorkflowCallbackServiceHttpsEndpoint" binding="ns:WorkflowCallbackServiceHttpBinding"> <http:address location="https://localhost:8243/services/WorkflowCallbackService.WorkflowCallbackServiceHttpsEndpoint"/> </wsdl:port> <wsdl:port name="WorkflowCallbackServiceHttpEndpoint" binding="ns:WorkflowCallbackServiceHttpBinding"> <http:address location="http://localhost:8280/services/WorkflowCallbackService.WorkflowCallbackServiceHttpEndpoint"/> </wsdl:port> </wsdl:service>

  7. Go to the <APIM_HOME>/business-processes/<workflow name>/HumanTask folder and unzip the file that is there by the name of the workflow. For example, <APIM_HOME>/business-processes/user-signup/HumanTask/UserApprovalTask-1.0.0.zip .

  8. Go inside the unzipped folder and do the following:

    Action Example
    If you changed the default admin role, open the ApprovalTask HT file and apply the changes there.

    Change the admin instances in <APIM_HOME>/business-processes/user-signup/HumanTask/UserApprovalTask-1.0.0/UserApprovalTask.ht file. Here's an example, a ssuming that the new admin role is apimadmin .

    <htd:peopleAssignments>
       <htd:potentialOwners>
          <htd:from logicalPeopleGroup="admin">
              <htd:argument name="role">apimadmin</htd:argument>
          </htd:from>
       </htd:potentialOwners>            
    </htd:peopleAssignments>
    Open the ApprovalTask WSDL file and point the two address elements to the Business Process Server node.

    In the <APIM_HOME>/business-processes/user-signup/HumanTask/UserApprovalTask-1.0.0/UserApprovalTask.wsdl file:

    <wsdl:service name="UserApprovalService">
            <wsdl:port name="UserApprovalPort" binding="tns:UserApprovalBinding">
                <soap:address location="http://localhost:9765/services/UserApprovalService" />
            </wsdl:port>
    </wsdl:service>
    <wsdl:service name="UserApprovalServiceCB">
            <wsdl:port name="UserApprovalPortCB" binding="tns:UserApprovalBindingCB">
                <soap:address location="http://localhost:9765/services/UserApprovalServiceCB" />
            </wsdl:port>
    </wsdl:service> 
    !!! tip

    Note that all workflow process services of the BPS run on port 9765 because you changed its default port (9763) with an offset of 2.

Top