Deploy Asset Bundle
After creating an ODF 2 project from the Full 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:
readTimeoutsets the read timeout for new connections. The default value is0that imposes no timeout.writeTimeoutsets the write timeout for new connections. The default value is0that imposes no timeout.callTimeoutsets 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 is0that imposes no timeout.connectTimeoutsets the connection timeout for new connections. The connect timeout is applied when connecting a TCP socket to the target host. The default value is60seconds.
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>
<version>${bundle-maven-plugin.version}</version>
<configuration>
<server>
<id>${workfusion.server.id}</id>
<url>${workfusion.environment.url}</url>
<readTimeout>10000</readTimeout>
<writeTimeout>10000</writeTimeout>
<callTimeout>60000</callTimeout>
<connectTimeout>20000</connectTimeout>
</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:
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.urlin the rootpom.xml:localpoints to the Control Tower instance from the IA Cloud Developer installationremoteis for Control Tower on the remote server
Specify the Control Tower user credentials. Modify the
USER_HOME/.m2/settings.xmlfile 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
idvalue insettings.xmlmust be the same as theidvalue of the profile configuration in the rootpom.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:
- Open the IA Cloud 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.
- Run
mvn clean packageto build the project. The command creates a Bundle packed as a zip archive in the[ARTIFACT]-package/targetdirectory. The build should complete with the[INFO] BUILD SUCCESSmessage. - Go to the [ARTIFACT]-package module folder and run
mvn bundle:importfrom it. When the operation is completed, there is the[INFO] BUILD SUCCESSmessage.
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:
Run
mvn clean packageto build the project. The command creates a Bundle packed as a zip archive in the[ARTIFACT]-package/targetdirectory. The build should complete with the[INFO] BUILD SUCCESSmessage.Go to the [ARTIFACT]-package module folder and run
mvn bundle:import -Premotefrom it. When the operation is completed, there is the[INFO] BUILD SUCCESSmessage.note
To deploy to a remote Control Tower, add
-Premoteto your command. The parameter tells Maven to activate the remote profile. By default, the local profile is used.Open Control Tower and check your Business Processes. When deploying a project created from the Full Archetype, you should see the following four Business Processes:
