Installing workflow projects to an offline server by calling REST APIs

You can call REST APIs to export versions of workflow projects and then install them to any workflow server.

Before you begin

Before you export projects, ensure that you have Read permission or are a repository administrator.

Procedure

Complete the following steps:

  1. Go to IBM® BPM Explorer ops on https://host_name:port_number/ops/explorer. The server address must be the URL of the repository system. That is, Business Automation Studio.
  2. Under System, run the POST /system/login REST API with the login_request parameter by using the example values. For more information, see REST APIs
  3. Click Try it out to run the REST API.
  4. Under Container, create the installation package by using POST /std/bpm/containers/{container}/versions/{version}/offline_package. Ensure that you are using the ACCESS_TOKEN_HEADER and CSRF_TOKEN_HEADER for the Business Automation Studio server, for example:
    curl -X POST -H "$ACCESS_TOKEN_HEADER" -H "$CSRF_TOKEN_HEADER" -H 'Content-Type: 
    application/json' -H 'Accept: application/json' 
    'https://zen-front-door-hostname/instance_prefix/ops/std/bpm/containers/PA1/versions/1/offline_package?server=OffLn1
    External link opens a new window or tab'

    You get a response such as this:

    {"description":"Your request to create and install an offline package from the specified snapshot on the specified server was submitted. You can check the progress of the operation by calling the returned url.","url":"https://zen-front-door-hostname/instance_prefix/ops/system/queue/7?key=8b09658ae4fdb42ccfe33a20122265f4"}
  5. Check the status by using the URL that was returned in the previous step with GET /system/queue/{id}, for example:
    curl -X GET -H "$ACCESS_TOKEN_HEADER" -H "$CSRF_TOKEN_HEADER" -H 'Accept: 
    application/json' 
    'https://zen-front-door-hostname/instance_prefix/ops/system/queue/7?key=8b09658ae4fdb42ccfe33a20122265f4
    External link opens a new window or tab'

    You get a response such as this:

    {"state":"success","result":{"container":"PA1","server":"OffLn1","version":"SN03"},"last_modified":"2022-01-18T22:11:25.367Z"}
  6. Export the installation package by using GET /std/bpm/containers/{container}/versions/{version}/install_package, for example:
    curl -X GET -H "$ACCESS_TOKEN_HEADER" -H "$CSRF_TOKEN_HEADER" -H 'Accept: 
    application/octet-stream' 
    'https://zen-front-door-hostname/instance_prefix/ops/std/bpm/containers/PA1/versions/1/install_package?server=OffLn1
    External link opens a new window or tab' 
    -o /c/MyExportPkg.zip

    Note the location and name of the file that you exported.

  7. On the offline workflow server, install the application version that you exported by using POST /std/bpm/containers/install. Ensure that you are using the ACCESS_TOKEN_HEADER and CSRF_TOKEN_HEADER for the offline server, for example:
    curl -X POST -H "$ACCESS_TOKEN_HEADER" -H "$CSRF_TOKEN_HEADER" -H 'Content-Type: 
    multipart/form-data' -H 'Accept: application/json' -F 'install_file=@C:\MyFiles\PA1 - 1.zip' 
    {"type":"formData"}' 
    'https://zen-front-door-hostname/instance_prefix/ops/std/bpm/containers/install?inactive=false&caseOverwrite=false
    External link opens a new window or tab'

    You get a response such as this:

    {"description":"Your request to import the specified file was submitted. You can check the progress of the import in the system log or by calling the returned url.","url":"https://zen-front-door-hostname/instance_prefix/ops/system/queue/9?key=d2772760f7bd30006e877164ba8a6ee9"}
  8. As described in step 7, you can check the status by using the URL in the response, for example:
    curl -X GET -H "$ACCESS_TOKEN_HEADER" -H "$CSRF_TOKEN_HEADER" -H 'Accept: 
    application/json' 
    'https://zen-front-door-hostname/instance_prefix/ops/system/queue/9?key=d2772760f7bd30006e877164ba8a6ee9
    External link opens a new window or tab'
    

    You get a response such as this:

    {"state":"success","result":{"details":""},"last_modified":"2022-01-19T14:46:16.979Z"}

    Your project is now installed on the offline server.

Results

Your project is now installed on the offline server.