Example Scenario for copyPFUComponents

This section demonstrates the usage of the copyPFUComponents action with a comprehensive example.

As shown in Figure 1, the TIBCO ActiveMatrix BPM user Application com.example.userapplicationupgrade is deployed on the BPM Node BPMNode, and has been upgraded several times. Since each of the past versions 4.0.0, 5.0.0 and 6.0.0 has one or more pending Work Item(s), the Components from those versions are in the 'Preparing For Undeploy (PFU)' state. For instance, the UserApplicationUpgradeProcessFlow Component of all three versions are in the PFU state.

Figure 1: View of a Component in PFU state across multiple versions of a BPM user Application

It is typical for BPM setups to contain many Applications that have Components in PFU state for many versions of the Application.

At this point, if the BPM user decides to add a new BPM Node BPMNode2 to this Environment, then all the existing Applications in their current version is added to the new BPM Node, except the PFU Components in BPMNode.

In Figure 2, the newly added BPM Node is shown as the part of amx.bpm.app Application's redistribution.

Figure 2:'amx.bpm.app' Application's redistribution on newly created BPM Node 'BPMNode2'

Due to symmetric nature of BPM Nodes (achieved by using 'Product Application' distribution strategy), the BPM User Application com.example.userapplicationupgrade is redistributed on BPMNode2 as well. All the components of the latest version (i.e. 7.0) of this Application have been mapped to BPMNode2 as shown in Figure 3.

Figure 3: Components of the latest version of the Application 'com.example.userapplicationupgrade' mapped to 'BPMNode2'

As seen in Figure 4, the PFU Component UserApplicationUpgradeProcessFlow (Versions 4.0.0, 5.0.0 and 6.0.0) are not available on BPMNode2 node.

Figure 4: PFU Component 'UserApplicationUpgradeProcessFlow' not available on BPMNode2.

If the BPM User tries to open/finish these PFU Components (or Work Items) from BPMNode2, an error message is displayed indicating that the Work Item isn't available, as shown in Figure 5.

Figure 5: Error accessing Work Item corresponding to a PFU Component

In order to fix this issue, the BPM User run the copyPFUComponents CLI script, to export the PFU Component UserApplicationUpgradeProcessFlow from BPMNode to BPMNode2 in the BPMEnvironment.

In terms of the Input Data file, the following values will have to be specified in the CONFIG_HOME/admin/<enterpriseName>/samples/exportImport_PfuComponents_data.xml:

  1. AMX Environment name: BPMEnvironment
  2. Source Node: BPMNode
  3. Target Node: BPMNode2

After modifying the exportImport_PfuComponents_data.xml data file, the user can run the CONFIG_HOME/admin/<enterpriseName>/samples/exportImport_PfuComponents_build script, first in the dryRun mode:

$ ant -f exportImport_PfuComponents_build.xml
Buildfile:  config.home/admin/<enterpriseName>/samples/exportImport_PfuComponents_build.xml
copy.components.dryRun:
[AMXAdminTask] 12 Nov 2015 14:39:07  INFO - Initializing JSSE's crypto provider class com.sun.net.ssl.internal.ssl.Provider in default mode
[AMXAdminTask] 12 Nov 2015 14:39:07  INFO - Connecting to AMX Admin server at 'http://10.108.80.130:8120' as user 'root'.
[AMXAdminTask] 12 Nov 2015 14:39:07  INFO - Executing action 'copyPFUComponents' for 1 objects from data file '/opt/tibco/sniff/config.home/admin/dev-enterprise/samples/exportImport_PfuComponents_data.xml'
[AMXAdminTask] 12 Nov 2015 14:39:08  INFO - [dryRun]Starting to copy 'preparing for undeploy' components from source Node ['BPMNode'] to target Node ['BPMNode2'] , action tracked in logs with (operationID: root_20151112143908)...
[AMXAdminTask] 12 Nov 2015 14:39:08  INFO - [dryRun]Exporting 'preparing for undeploy' components from source node 'BPMNode' and enabling required features on target node 'BPMNode2'...
[AMXAdminTask] 12 Nov 2015 14:39:51  INFO - TIBCO-AMX-ADMIN-012655: The version(s) '6.0.0,5.0.0,4.0.0' of application 'com.example.userapplicationupgrade' were exported.
[AMXAdminTask] 12 Nov 2015 14:39:51  INFO - [dryRun]The features 'com.example.userapplicationupgrade:6.0.0,com.example.userapplicationupgrade:5.0.0,com.example.userapplicationupgrade:4.0.0' will be enabled on target node 'BPMNode2'.
[AMXAdminTask] 12 Nov 2015 14:39:51  INFO - [dryRun]Exported 'preparing for undeploy' components from source node 'BPMNode' successfully.
[AMXAdminTask] 12 Nov 2015 14:39:52  INFO - [dryRun]Importing 'preparing for undeploy' components to target node 'BPMNode2' ...
[AMXAdminTask] 12 Nov 2015 14:40:17  INFO - TIBCO-AMX-ADMIN-012663: The version(s) '4.0.0,6.0.0,5.0.0' of application 'com.example.userapplicationupgrade' were imported.
[AMXAdminTask] 12 Nov 2015 14:40:17  INFO - [dryRun]Successfully copied 'preparing for undeploy' components from node 'BPMNode' to node 'BPMNode2' (operationID: root_20151112143908).
[AMXAdminTask] 12 Nov 2015 14:40:17  INFO - Action finished at 11/12/15 2:40 PM in 69.302 seconds

BUILD SUCCESSFUL
Total time: 1 minute 12 seconds

As shown in the CLI output, versions 4.0.0, 5.0.0 and 6.0.0 of Application com.example.userapplicationupgrade is exported from Source Node BPMNode and imported in Target Node BPMNode2. The features required to run the PFU Components is also enabled on Target Node BPMNode2.

So far, no changes have been persisted in the system. If the actual copyPFUComponents action is executed (without the dryRun option), the following CLI output will be seen:

$ ant -f exportImport_PfuComponents_build.xml copy.components
Buildfile:
config.home/admin/<enterpriseName>/samples/exportImport_PfuComponents_build.xml

copy.components:
[AMXAdminTask] 12 Nov 2015 15:17:45  INFO - Initializing JSSE's crypto provider class com.sun.net.ssl.internal.ssl.Provider in default mode
[AMXAdminTask] 12 Nov 2015 15:17:45  INFO - Connecting to AMX Admin server at 'http://10.108.80.130:8120' as user 'root'.
[AMXAdminTask] 12 Nov 2015 15:17:45  INFO - Executing action 'copyPFUComponents' for 1 objects from data file '/opt/tibco/sniff/config.home/admin/dev-enterprise/samples/exportImport_PfuComponents_data.xml'
[AMXAdminTask] 12 Nov 2015 15:17:47  INFO - Starting to copy 'preparing for undeploy' components from source Node ['BPMNode'] to target Node ['BPMNode2'] , action tracked in logs with (operationID: root_20151112151746)...
[AMXAdminTask] 12 Nov 2015 15:17:47  INFO - Stopping node 'BPMNode'...
[AMXAdminTask] 12 Nov 2015 15:17:52  INFO - .
[AMXAdminTask] 12 Nov 2015 15:17:57  INFO - .
[AMXAdminTask] 12 Nov 2015 15:18:02  INFO - .
[AMXAdminTask] 12 Nov 2015 15:18:07  INFO - .
[AMXAdminTask] 12 Nov 2015 15:18:12  INFO - .
[AMXAdminTask] 12 Nov 2015 15:18:12  INFO - Node 'BPMNode' was stopped successfully.
[AMXAdminTask] 12 Nov 2015 15:18:12  INFO - Starting node 'BPMNode2'...
[AMXAdminTask] 12 Nov 2015 15:18:17  INFO - .
[AMXAdminTask] 12 Nov 2015 15:18:17  INFO - Node 'BPMNode2' was started successfully.
[AMXAdminTask] 12 Nov 2015 15:18:17  INFO - Exporting 'preparing for undeploy' components from source node 'BPMNode' and enabling required features on target node 'BPMNode2'...
[AMXAdminTask] 12 Nov 2015 15:18:36  INFO - TIBCO-AMX-ADMIN-012655: The version(s) '6.0.0,5.0.0,4.0.0' of application 'com.example.userapplicationupgrade' were exported.
[AMXAdminTask] 12 Nov 2015 15:18:36  INFO - The features 'com.example.userapplicationupgrade:6.0.0,com.example.userapplicationupgrade:5.0.0,com.example.userapplicationupgrade:4.0.0' will be enabled on target node 'BPMNode2'.
[AMXAdminTask] 12 Nov 2015 15:18:41  INFO - .
[AMXAdminTask] 12 Nov 2015 15:18:41  INFO - Enabling features on target node 'BPMNode2' is done.
[AMXAdminTask] 12 Nov 2015 15:18:41  INFO - Exported 'preparing for undeploy' components from source node 'BPMNode' successfully.
[AMXAdminTask] 12 Nov 2015 15:18:41  INFO - Stopping node 'BPMNode2'...
[AMXAdminTask] 12 Nov 2015 15:18:46  INFO - .
[AMXAdminTask] 12 Nov 2015 15:18:51  INFO - .
[AMXAdminTask] 12 Nov 2015 15:18:56  INFO - .
[AMXAdminTask] 12 Nov 2015 15:19:01  INFO - .
[AMXAdminTask] 12 Nov 2015 15:19:06  INFO - .
[AMXAdminTask] 12 Nov 2015 15:19:12  INFO - .
[AMXAdminTask] 12 Nov 2015 15:19:12  INFO - Node 'BPMNode2' was stopped successfully.
[AMXAdminTask] 12 Nov 2015 15:19:12  INFO - Importing 'preparing for undeploy' components to target node 'BPMNode2' ...
[AMXAdminTask] 12 Nov 2015 15:19:37  INFO - TIBCO-AMX-ADMIN-012663: The version(s) '4.0.0,6.0.0,5.0.0' of application 'com.example.userapplicationupgrade' were imported.
[AMXAdminTask] 12 Nov 2015 15:19:37  INFO - Starting node 'BPMNode'...
[AMXAdminTask] 12 Nov 2015 15:19:42  INFO - .
[AMXAdminTask] 12 Nov 2015 15:19:47  INFO - .
[AMXAdminTask] 12 Nov 2015 15:19:52  INFO - .
[AMXAdminTask] 12 Nov 2015 15:19:57  INFO - .
[AMXAdminTask] 12 Nov 2015 15:20:02  INFO - .
[AMXAdminTask] 12 Nov 2015 15:20:02  INFO - Node 'BPMNode' was started successfully.
[AMXAdminTask] 12 Nov 2015 15:20:02  INFO - Starting node 'BPMNode2'...
[AMXAdminTask] 12 Nov 2015 15:20:07  INFO - .
[AMXAdminTask] 12 Nov 2015 15:20:12  INFO - .
[AMXAdminTask] 12 Nov 2015 15:20:17  INFO - .
[AMXAdminTask] 12 Nov 2015 15:20:17  INFO - Node 'BPMNode2' was started successfully.
[AMXAdminTask] 12 Nov 2015 15:20:17  INFO - Successfully copied 'preparing for undeploy' components from node 'BPMNode' to node 'BPMNode2' (operationID: root_20151112151746).
[AMXAdminTask] 12 Nov 2015 15:20:17  INFO - Action finished at 11/12/15 3:20 PM in 150.292 seconds

BUILD SUCCESSFUL
Total time: 2 minutes 34 seconds

As mentioned in the Understanding the CLI action copyPFUComponents, the TIBCO ActiveMatrix Administrator:

  1. Stopped the Source node BPMNode.
  2. Started Target node BPMNode2.
  3. Exported PFU Components from Source Node BPMNode'.
  4. Enabled necessary features that are required to run newly copied PFU Components to Target Node BPMNode2.
  5. Stopped Target node BPMNode2.
  6. Import PFU Components to Target Node BPMNode2.
  7. Restarted both Source Node BPMNode and Target Node BPMNode2.

After executing the copyPFUComponents action, the PFU Components are shown in the PFU state for both Source and Target Nodes, as seen in Figure 6.

Figure 6: PFU Components post-copyPFUComponents action on both Source and Target Nodes

The BPM User can now successful access Work Items from the new BPMNode BPMNode2 in order to finish the processing.