Synopsis
This article outlines the necessary steps to deploy an existing Maven-based BWCE application on the TIBCO platform. Fortunately, the process requires only minor modifications to the pom file and the addition of a few extra files to your project.
If you don't have an existing BWCE project with Maven, following the instructions in this article isn't necessary. For guidance on mavenizing a BWCE project, refer to the "Steps for TIBCO ActiveMatrix BusinessWorks" on the BW Plugin wiki page, ensuring the project type is set to 'platform'.
Minimum BWCE Version: 2.9.1
Minimum Plugin Version: 2.9.8
STEP 1 - Update Plugin Version
Update the Application POM file, BW maven plugin version to 2.9.8 or higher.
<plugins> <plugin> <groupId>com.tibco.plugins</groupId> <artifactId>bw6-maven-plugin</artifactId> <version>2.9.8</version> <extensions>true</extensions> </plugin> </plugins>
STEP 2 - Add Platform Properties To POM File
There are some additional properties that are used by the maven plugin when working with the TIBCO platform. The table below details the properties section and their relevance to TIBCO platform.
Property |
Description |
Example value |
Specific to platform |
project.type |
Defines the deployment type for the BWCE application |
platform |
Value must be set to platform |
buildName |
The name of the build as seen on TIBCO Platform |
http-request-response |
Platform specific |
platformConfigFile |
The configuration file includes system properties, dependencies, resource limits, and application tags |
../httpRequestResponse/platform_config.json</platformConfigFile |
Platform Specific |
bw.Home |
The location of BWCE Home |
/bwce/2.9 |
Must be set in order to generate the manifest and process diagrams using maven |
replicas |
The amount of replicas the application should scale to |
1 |
Platform specific |
profile |
The profile to be used when deploying the application |
default.substvar |
Generic applies to all types of BW applications |
eula |
Used to confirm the EULA |
true |
Platform specific, must be true. |
enableAutoScaling |
When set to true then the auto scaling feature of TIBCO platform will be enabled |
false |
Platform specific |
failIfNoTests |
If true then the build will stop if no unit tests are defined in the project |
false |
Generic applies to all types of BW applications |
enableServiceMesh |
Used when deploying the application to TIBCO Platform to tell the platform that this application will be service mesh enabled |
false |
Platform specific |
tibco.Home |
The location where BWCE is installed on the developer machines |
D:/BWCE292 |
Must be set in order to generate the manifest and process diagrams using maven |
Example
<properties> <project.type>Platform</project.type> <buildName>http-client-build</buildName> <platformConfigFile>../httpRequestResponse/platform_config.json</platformConfigFile> <bw.Home>/bwce/2.9</bw.Home> <appName>http-request-response-app</appName> <replicas>1</replicas> <profile>default.substvar</profile> <eula>false</eula> <enableAutoScaling>false</enableAutoScaling> <failIfNoTests>false</failIfNoTests> <enableServiceMesh>false</enableServiceMesh> <skipTests>false</skipTests> <tibco.Home>D:/BWCE292</tibco.Home> </properties>
STEP 3 - Create manifest-bwce.json File
Check if your application project has a manifest-bwce.json file.
If the project lacks a manifest file, you can generate one using the bw maven plugin's bwdesignUtility command `generate_manifest_json`.
Make sure to reconfigure your POM file as outlined in step 2, specifying the tibco.Home and bw.Home properties.
Execute the Maven command below to construct the manifest.
mvn com.tibco.plugins:bw6-maven-plugin:bwdesignUtility -DcommandName=gen_diagrams - f <location of your BWCE parent project>
Example
mvn com.tibco.plugins:bw6-maven-plugin:bwdesignUtility -DcommandName=generate_manifest_json -f D:\projects\demo-area\platform\http-requestresponse\src\httpRequestResponse.parent
The bwdesign utility can be used directly without Maven. For more information, please consult the 'Using the BWDesign Utility' section in the TIBCO ActiveMatrix BusinessWorks Application Development documentation, which is included with the BusinessWorks documentation.
Note: To execute this through a CI/CD pipeline, Business Studio must be installed on the machine where the maven command is being run. The pom file should either specify the location or be configured to use properties, allowing it to be executed across various machines and operating systems.
STEP 4 - Create platform_config.json File
Check that your application project includes a platform_config file.
If the file is not present in the project, use the template provided below to create it. Afterward, modify it to align with the design application's configuration.
platform_config.json template
{
"platformConfig":[
{
"appProperties":[
]
},
{
"systemProperties":[
{
"name":"BW_ENGINE_STEPCOUNT",
"value":"-1",
"type":"integer"
},
{
"name":"BW_ENGINE_THREADCOUNT",
"value":"8",
"type":"integer"
},
{
"name":"BW_LOGGER_OVERRIDES",
"value":"ROOT=ERROR",
"type":"string"
},
{
"name":"BW_OTEL_TRACES_ENABLED",
"value":"false",
"type":"boolean"
}
]
},
{
"dependencies":[
]
},
{
"resourceLimits":{
"limits":{
"cpu":"1",
"memory":"4Gi"
},
"requests":{
"cpu":"250m",
"memory":"1Gi"
}
}
},
{
"autoscalingConfig":{
"minReplicas":1,
"maxReplicas":3,
"hpaMetrics":{
"cpuUtilization":{
"enabled":true,
"averageCpuUtilization":70
},
"memoryUtilization":{
"enabled":true,
"averageMemoryUtilization":70
}
}
}
},
{
"networkPolicies":{
"egressNetworkPolicies":{
"internetWeb":"enable",
"internetAll":"enable"
},
"ingressNetworkPolicies":{
}
}
},
{
"tags":[
"tag1",
"tag2"
]
}
]
}
STEP 5 - Configure Build Properties
Modifications have been made to the build properties for platform compatibility. Please update your build properties to match the section below.
<build> <plugins> <plugin> <groupId>com.tibco.plugins</groupId> <artifactId>bw6-maven-plugin</artifactId> <version>2.9.9</version> <extensions>true</extensions> <configuration> <buildName>${buildName}</buildName> <appName>${appName}</appName> <profile>${profile}</profile> <replicas>${replicas}</replicas> <enableAutoScaling>${enableAutoScaling}</enableAutoScaling> <enableServiceMesh>${enableServiceMesh}</enableServiceMesh> <eula>${eula}</eula> </configuration> </plugin> </plugins> </build>
STEP 6 - Process Diagrams
It is necessary to include process diagrams in your EAR file, as they are a requirement for the platform's user interface.
Process diagrams are not required for BWCE applications deployed natively on Kubernetes, which implies that you may not have created one for your project.
Process diagrams can be generated using Business Studio, BW Design Utility, or BW Design Utility with Maven. Once the process diagrams are generated, it is crucial to check them into your source control system to ensure they are included in the build process of your CI/CD pipeline.
Business Studio Approach
Right click on the application module and clicking on the Generate Process Diagrams menu option
BW Design Utility with Maven
Execute the Maven command below, ensuring that you have configured the tibco.Home and bw.Home properties as outlined in step 2.
mvn com.tibco.plugins:bw6-maven-plugin:bwdesignUtility -DcommandName=gen_diagrams - f <locaion of your BWCE parent project>
Example
mvn com.tibco.plugins:bw6-maven-plugin:bwdesignUtility -DcommandName=gen_diagrams -f D:\projects\demo-area\platform\http-requestresponse\src\httpRequestResponse.parent
Files to check into source control
The file extension for a process diagram is .bwd and these are the files that should be checked into source control.
Caution: The process of generating diagrams may result in the creation of some meta data files. These files are not required and should be excluded from your version control system.
.com.tibco.bw.rad/ .metadata/.bw/ .metadata
Consider adding them to your source control ignore file as it will be necessary to update your process diagrams if you change your process flow.
STEP 7 - Test the build process
Run maven with the clean and package targets
mvn clean package - f <location of your BWCE parent project>
Example
mvn clean package -f httpRequestResponse.parent
You will see a warning about the target about being platform dependent... If you do not then it is likely something is wrong.
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
Additionally, verify that the generated EAR includes the necessary manifest file.
Make sure your application contains the process diagrams and the .bwd files, which should be placed in the resources folder.
If the EAR file includes the manifest and BWD files, then it is ready for deployment. The ear can be deployed using the Maven plugin, through the platform's graphical user interface, or through the platform APIs.
For further information regarding the BW Maven Plugin, consider exploring the following resources:
- The GitHub repository for the plugin's code, which includes a README file with installation instructions and prerequisites.
- TIBCO's official documentation, providing detailed guidance on installing the Maven plugin, post-installation tasks, and usage tips.
- Apache Maven's guide to configuring plugins, which offers insights into the types of plugins and their configuration.
- 1
- 1
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now