IBM BPM, V8.0.1, All platforms > Manage assets in the Process Center repository > Manage the Process Center repository > Applying governance
Create a governance BPD that installs a snapshot when the status changes
You can call the Install Snapshot service from a governance process based on the Snapshot Status Change template. You can make use of that ability to create a custom governance process that installs a snapshot on a server when someone changes the status of the snapshot or creates a snapshot.
The System Governance toolkit (TWSYSG) contains the resources that you need to build a governance process. The toolkit has integration services for installation and snapshot status changes, templates that provide business process definitions for installation and snapshot status changes, and governance business objects.
When you create a snapshot or change its status, an instance of the default Snapshot Status Change BPD from the System Governance toolkit is started. You can create a custom governance process to replace the default process. Bind the custom process to the snapshot event for the process application and add a call to the Install Snapshot service. You can then use the governance process to install a snapshot on a server whenever someone changes the status.
For example, you can set up a governance process that installs snapshots to a test server as soon as the status is changed to Test. This implementation contributes to continuous integration.
In its simplest form, this custom governance process has a start event, an end event, and three activities. The first activity provides a list of available servers for the process application that is under this governance. The second activity initializes the required data in the ProcessAppInstallation object since the Installation Service expects this object. The third activity starts the installation request. However, this is a governance process, so make sure the governance goals are met. If your process installs a snapshot on a production server, you probably want an approval process as part of this snapshot governance process, so that it goes through proper review and approval before it is automatically installed.
Procedure
- In IBM Process Center, create a process application to use for governance. This process application contains your installation governance process.
You cannot create a governance process in a toolkit. Use process applications to create governance processes.
- In IBM Process Designer, add a dependency on the System Governance toolkit to your process application. The process application must have a direct dependency on the System Governance toolkit snapshot V8.0.1 to function as a governance process. Indirect dependencies are not supported.
- Create a BPD in the New Business Process Definition window using the Snapshot Status Change template. Click Finish.
The governance templates are available only when a dependency exists on the System Governance toolkit. After you save the BPD, the input variable, SnapshotStatusRequest, that was set by the template cannot be changed.
The governance process must be created using the template definition. You cannot manually create a variable of type SnapshotStatus and have your BPD work as a governance process.
- Using the template as a base, develop the BPD to meet your organization’s requirements. The following steps provide some suggestions.
- Create an activity that calls the Get All process Servers service from the System Governance toolkit. This service provides a list of the servers that can be used to install a snapshot of that process application.
- Create an activity that calls the Install Snapshot service from the System Governance toolkit. This service takes a ProcessAppInstallation object for input.
- Provide process application and snapshot parameters from the SnapshotStatusRequest process input object. For the server parameter, use a server object that is in the list of servers from the Get All Process Servers call.
- Optional: For the migrationInstructions parameter, create an empty migration instruction in this form: tw.object.listOf.MigrationInstructions(). For running instances, leave the data and migrate it later using the Process Inspector. You can leave the initiatedBy and dateInitiated parameters empty.
- When the governance process is complete, take a snapshot of the process application, label it, and set the status of the snapshot to "Released". Only a released snapshot of the governance process can be applied to a process application.
- Apply the new BPD as the Snapshot Status Change governance process for process applications that you want to govern. See the related link to instructions for that task.
Results
A new BPD instance of your governance process now starts whenever a new snapshot is created or the status of the snapshot is changed.
If a governance process is used to install a snapshot, process the InstallResponse returned by the Install Snapshot service to make sure installation is successful.
If the installation is not successful, use the Cancel Snapshot Installation service to cancel the previous installation request. This method of cancellation is required if the installation is triggered through a governance process which is associated with Snapshot Status Change event. Changing the Snapshot Status Change governance assignment to the default does not reset the status of failed installations.
Applying governance to a process application
Related tasks:
Applying a governance BPD to a process application or snapshot
Migrating a governance process from V8.0.0
Create a governance process for installing a process application
Create a governance process for the status of a snapshot
Changing a governance application
Testing a governance process
Export and importing a process application that uses customized governance
Recovering if a process application under governance fails to install
Related reference:
Governance services