Skip to main content
Version: 10.2.8

Deploy Asset Bundle

After creating an ODF 2 project from the Simple Archetype, deploy it to a Control Tower instance.

Publish Asset Bundle with Maven

A project created from the ODF 2 Archetype already includes bundle-maven-plugin. You can use the tool to automate packing Asset Bundles and building RESTful POST requests to deploy the Bundles to Control Tower.

There are four timeout parameters that can be configured for the underlying HTTP client. All parameters are set in milliseconds. The 0 value means no timeout. Otherwise, the value must be between 1 and Integer.MAX_VALUE:

  • readTimeout sets the read timeout for new connections. The default value is 0 that imposes no timeout.
  • writeTimeout sets the write timeout for new connections. The default value is 0 that imposes no timeout.
  • callTimeout sets the timeout for complete calls. The call timeout spans the entire call: resolving DNS, connecting, writing the request body, server processing, and reading the response body. The default value is 0 that imposes no timeout.
  • connectTimeout sets the connection timeout for new connections. The connect timeout is applied when connecting a TCP socket to the target host. The default value is 60 seconds.
  • importTimeout sets the timeout for importing Asset Bundles. The connect timeout is applied when posting an Asset Bundle zip to Control Tower. The default value is 10 minutes.

The Maven plugin is preconfigured in the pom.xml file of the package module as shown below:

<plugin>
<groupId>com.workfusion.odf</groupId>
<artifactId>bundle-maven-plugin</artifactId>
<configuration>
<server>
<id>${workfusion.server.id}</id>
<url>${workfusion.environment.url}</url>
<readTimeout>10000</readTimeout>
<writeTimeout>10000</writeTimeout>
<callTimeout>60000</callTimeout>
<connectTimeout>20000</connectTimeout>
<importTimeout>20000</importTimeout>
</server>
<metaInfoFile>src/main/resources/meta-info.json</metaInfoFile>
<bundle>target/${project.build.finalName}.zip</bundle>
</configuration>
</plugin>

Refer to Maven plugins for more details on bundle-maven-plugin.

Configure access to Control Tower

Before publishing Asset Bundles with the plugin, you need to configure Control Tower settings. For that, in your project generated with the ODF 2 Archetype, perform the following actions:

  1. Specify the Control Tower URL to publish Asset Bundles. For that, modify the project's root pom.xml:

    <profiles>
    <profile>
    <id>local</id>
    <activation>
    <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
    <workfusion.server.id>control-tower</workfusion.server.id>
    <workfusion.environment.url>http://localhost:15280</workfusion.environment.url>
    </properties>
    </profile>
    <profile>
    <id>remote</id>
    <activation>
    <activeByDefault>false</activeByDefault>
    </activation>
    <properties>
    <workfusion.server.id>remote-control-tower</workfusion.server.id>
    <workfusion.environment.url>https://ct.instance.workfusion.com</workfusion.environment.url>
    </properties>
    </profile>
    </profiles>

    You can also configure the URL when you start a project from an archetype.

    note

    There are two properties named workfusion.environment.url in the root pom.xml:

    • local points to the Control Tower instance from the Work.AI Developer installation
    • remote is for Control Tower on the remote server
  2. Specify the Control Tower user credentials. Modify the USER_HOME/.m2/settings.xml file as shown below. The role set up for the user must have the Export/Import and Advanced Package Import permissions in Control Tower. For details, refer to the Role management section.

    <!-- Control Tower user credentials -->  
    <server>
    <id>remote-control-tower</id>
    <username>username_value</username>
    <password>password_value</password>
    </server>
    note

    The id value in settings.xml must be the same as the id value of the profile configuration in the root pom.xml.

Deploy Asset Bundle to local Control Tower

bundle-maven-plugin features a Maven goal to publish an Asset Bundle to Control Tower.

To deploy an Asset Bundle to a local Control Tower, follow the instructions below:

  1. Open the Work.AI Developer's Launcher and start the Control Tower & WorkSpace group. Wait for the indicator to light up. This is essential to ensure Control Tower is launched since the service accepting and processing imported Asset Bundles starts with Control Tower.
  2. Run mvn clean package to build the project. The command creates a Bundle packed as a zip archive in the [ARTIFACT]-package/target directory. The build should complete with the [INFO] BUILD SUCCESS message.
  3. Go to the [ARTIFACT]-package module folder and run mvn bundle:import from it. When the operation is completed, there is the [INFO] BUILD SUCCESS message.
caution

Executing the mvn bundle:import command for the main pom.xml file in the root directory leads to the following error code: "No plugin found for prefix 'bundle' in the current project and the plugin groups".

Deploy Asset Bundle to remote Control Tower

To deploy an Asset Bundle to a remote Control Tower, follow the instructions below:

  1. Run mvn clean package to build the project. The command creates a Bundle packed as a zip archive in the [ARTIFACT]-package/target directory. The build should complete with the [INFO] BUILD SUCCESS message.

  2. Go to the [ARTIFACT]-package module folder and run mvn bundle:import -Premote from it. When the operation is completed, there is the [INFO] BUILD SUCCESS message.

    note

    To deploy to a remote Control Tower, add -Premote to your command. The parameter tells Maven to activate the remote profile. By default, the local profile is used.

  3. Open Control Tower and check your Business Processes. When deploying a project created from the Simple Archetype, you should see the Example Business Processes: