Tuesday, June 2, 2015

IBM BPM - Operations


1. Good practice – Have a plan for regularly upgrading IBM BPM

Like all software, IBM® Business Process Manager (BPM) is constantly improving. Every so often IBM “rolls up” (consolidates) all fixes into a new fourth digit fix pack or third digit modification release. These releases typically contain many critical fixes.
To avoid experiencing a serious issue that a fix was made available for in the last, say, 10 or 12 months, have a regular plan for updating your IBM BPM software within its current release. For example, you might have a plan that checks for the latest service level every six months and schedules an upgrade if one is available. If a new fix pack or modification release is not available at that time, you can apply the latest recommended fixes for your release instead. You can search for the list of fixes that IBM recommends for a given release on Fix Central.
Applicable editions: Express, Standard, and Advanced
Applicable releases: All

2. Good practice – Monitor the Process Federation Server embedded Elasticsearch service by using the Head utility

You can use the open source Head utility to browse your Elasticsearch cluster, view the status and topology of the Elasticsearch cluster, and perform index- and node-level operations. You can also use the Head utility to call the Elasticsearch RESTful API. The Head utility has been tested successfully on Firefox and Internet Explorer browsers in this configuration. Some issues have been seen in Chrome with requests other than HTTP GETs.

Viewing Elasticsearch health and topology

In the Overview tab, you see the status of the cluster, the nodes, and the indexes. Here, you see the primary shards and the replicas for each node, the size of each index on the node, and the number of documents that have been indexed.
 Elasticsearch Health and topology Good practice   Monitor the Process Federation Server embedded Elasticsearch service by using the Head utility

Checking index status

To see more in-depth information about the index, click Info and select Index Status.
Elasticsearch  Checking index status Good practice   Monitor the Process Federation Server embedded Elasticsearch service by using the Head utility

Viewing index data

Select the Browser tab to view index documents and their data. To see the details and field values for a specific document, select an index to restrict the tabular view to show only documents from one index and then select a document within the tabular view.
Elasticsearch  Viewing index data Good practice   Monitor the Process Federation Server embedded Elasticsearch service by using the Head utility

Making REST calls

You can make Elasticsearch REST calls in the Any Request tab, which you do to verify the queries that the Process Federation Server made.
Elasticsearch Making REST calls Good practice   Monitor the Process Federation Server embedded Elasticsearch service by using the Head utility

The forwarder application

The Elasticsearch Head utility can work with the HTTP port of the Elasticsearch service. However, because some browsers do not support mixed content on the same page and that the HTTP port does not support authentication, authorization, or secure communications, keep the Elasticsearch HTTP port disabled (the default configuration). As a secure alternative to the Elasticsearch HTTP port, Process Federation Server provides an application, called the forwarder application, that securely forwards REST requests to the Elasticsearch service, acting like a proxy server. However, the forwarder application forwards the requests internally only to the Elasticsearch process that runs on the same server. Before the forwarder application accepts Elasticsearch HTTP requests, it checks the authorization of the user who sent the request.
Note: For single sign-on to work correctly, the host name and port in the URL must be the same for both the Head utility and the forwarder application.

Ensuring security credentials can be shared

To ensure that security credentials can be shared across the Elasticsearch Head utility and the forwarder application, run the Elasticsearch Head utility from the Process Federation Server that also hosts the forwarder application. To run the Head utility from your Process Federation Server Liberty server installation, download the Head utility and then repackage it into a deployable web application archive (WAR file) that can be run on the Process Federation Server Liberty server.
For more information about the Elasticsearch Head utility, see https://github.com/mobz/elasticsearch-head.

Packaging the Head utility

  1. On https://github.com/mobz/elasticsearch-head, click Download ZIP to download the elasticsearch-head-master.zip file.
       2. The files contained within the zip file have a directory structure that looks like this:
            -elasticsearch-head-master
                    – index.html
                    – dist
                    – …
            Copy the contents of the extracted zip file under elasticsearch-head-master directory into c:\temp\eshead\ directory. The structure will look like this:
             – eshead
                      – index.html
                      – dist
                      – …
         Notice that all the files under the elasticsearch-head-master directory are now under the new eshead directory.
      3. Create a  c:\temp\eshead\WEB-INF directory:
            – eshead
                – index.html
               – WEB-INF
               – dist
               – …
       4. Create a web.xml file in the c:\temp\eshead\WEB-INF directory:
           – eshead
               – index.html
               – WEB-INF
                    -web.xml
              – dist
                    – …
        5. Edit the web.xml file and copy the following text into the file:

    ESHead
    ESHead
    
        ESHead
        
            UIContent
            /*
        
        
            esadmin
        
        
            CONFIDENTIAL
        
    
    
        BASIC
    
    
        esadmin
    
    
        index.html
    

        6. Create a .zip file of the c:\temp\eshead\ directory and call it ESHead.war. The zip file will have the following structure:
           – index.html
            – WEB-INF
                     -web.xml
            – dist
                     – …
            Notice that the structure does not have the elasticsearch-head-master directory.

Setting up the Head utility

To configure Process Federation Server Liberty, complete the following steps:
  1. Edit the server.xml file.
  2. Ensure that the forwarder application feature is enabled in the section:
    ibmPfs:federatedForwarder-1.0
  3. Ensure that the Elasticsearch port is disabled by updating the attributes of  the section:
    http.enabled=”false”
  4. Add authorized users, groups, or special subjects in the element. For example, to allow all logged-in users to administer, monitor, and search the Elasticsearch data, use the following configuration:
    
            
                
            
            
                
            
            
                
            
    
  5. Copy the ESHead.war file into the pfs_install_root/usr/shared/apps directory on your  Process Federation Server Liberty server.
  6. Add the following sections to the server.xml file. Note that the location is the name of the .zip file that you created previously; the default directory is \usr\shared\apps directory. The security role that you define must be the same as the role that is defined in the web.xml file (in this example it is “esadmin”). You can also authorize a group or special subject instead of a user.
         
            
                              
                  
               
            
         
  7. Ensure the user, group, or special subject is in the bpmadmin and bpmmonitor security roles of the com.ibm.bpm.federated.forwarder.authorization authorization role, as previously described. In this example, all authenticated users have access to the forwarder application, but only the admin user has access to the Head utility.
  8. Restart Process Federation Server Liberty.

Accessing the Head utility

  1. Go to https://:/ESHead.
  2. In the Head utility, enter the location of the administrative forwarder application, for example https://localhost:9443/elasticsearch-admin/

 Source : IBM

 

IBM BPM - Methodology

1. Good practice – Ensure business processes have a business owner

Business process management can only succeed when there is a close partnership between IT and business. This collaboration is most critical when it comes to designing the processes themselves, both capturing today’s as-is information and tomorrow’s to-be information. Ensure that all business processes have a business owner who is the subject matter expert for that process. This process owner should attend all playbacks and have a final signoff on the process model.
Applicable editions: Express, Standard and Advanced
Applicable releases: All


2. Good practice – Plan for and perform non-functional testing

Before going into production, ensure that you planned for and tested non-functional aspects of your process, including response time of the user interface, throughput, and scalability. Allot adequate time for this phase before going to production. The test environment should match the target production system as closely as possible, and the use cases should represent both typical and stress scenarios that are anticipated in production. All systems should be tuned according to the IBM BPM Performance Tuning redpaper guidelines before you perform the non-functional tests.
Applicable editions: Express, Standard and Advanced
Applicable releases: All

  
3. Good practice – Plan for disaster recovery

Many factors, ranging from human error to natural disasters, could compromise the capability of the hardware infrastructure that runs your IBM® Business Process Manager (BPM) system. To preserve business continuity when an entire data center is lost, it is important to have a disaster recovery plan. This plan describes the operational procedures that must be followed to regularly replicate the configuration data and the runtime data that comprise your IBM BPM system as well as the operational procedures that must be followed when restoring the replicated data to an alternate data center.
There are several options available to IBM BPM administrators who want to design this type of replication strategy. One such option is described in detail in Storing transaction and compensation logs in a relational database for high availability and disaster recovery in IBM Business Process Manager. But consider other strategies as well.
For more information, see Disaster recovery and Disaster recovery guidance for IBM Business Process Manager: An updated approach for IBM BPM V8.x.
Applicable editions: Express, Standard, and Advanced
Applicable releases: All


4. Good-practice resource – Learn about IBM BPM from an expert

Neil Kolban is an IBM employee who focuses on the IBM Business Process Manager and related products. Over time, he has built and collected information related to the use of this product that he has found to be of value and has bundled this information into a book that is available as a PDF document that you can download. The book is released once a month (normally on the 1st day of the month), so it is a good practice to bookmark this page and reference it as required.
Although Neil is an IBM employee, please note that any words, concepts or content may not necessarily represent the views of IBM. This book does not replace the information center for official product documentation
Applicable editions: Express, Standard, Advanced
Applicable releases: All


5. Good-practice resource – Learn about troubleshooting IBM Business Process Manager

Troubleshooting IBM® BPM issues can be complex without the correct tools and techniques. Troubleshooting IBM Business Process Manager describes a set of tools and techniques that the IBM BPM team suggests to help you with problem determination.
Applicable editions: Express, Standard, Advanced
Applicable releases: All

6. Good-practice resource – New to IBM BPM? Start with the Hiring tutorial

If you are new to IBM Business Process Manager (BPM) and on V8.5 or later, check out the new Hiring tutorial.
After you complete the tutorial, you will be able to do the following tasks:
  • Model a process that is based on process requirements.
  • Implement a process, including data variables and services that are required by the process.
  • Create the user interface for the process.
  • Conduct playbacks to validate the work that you completed.
  • Run and review the process.
The Hiring Tutorial covers everything that you need to know to re-create the Hiring Sample process application that is packaged with IBM BPM. As you go though the tutorial, you create the My Hiring Sample process application that has a few enhancements from the packaged Hiring Sample process application. The “Comparison with the packaged Hiring Sample” topic covers the differences between this process application that you create in the tutorial and the packaged Hiring Sample process application.
Applicable editions: Express, Standard, and Advanced
Applicable releases: All


7. Good-practice resource – Read the coaches IBM Redbooks publication

If you use IBM® Business Process Manager (BPM) next-generation coaches, which were introduced in IBM BPM V8.0, read the Leveraging the IBM BPM Coach Framework in Your Organization IBM Redbooks (SG24-8210-00) publication that focuses on this subject to learn about how to develop coaches and find out about the various tips and good practices.
Applicable editions: Express, Standard, and Advanced
Applicable releases: V8.0 and later

8. Good-practice resource – Use the IBM BPM Center of Excellence and Program to Project Redbooks

To succeed with IBM® Business Process Manager (BPM) beyond your first project, ensure that you are prepared and organized for success. For example, do you have the proper buy-in and participation from the organization?
The following timeless resources will help you expand your first project into an ongoing program:
Applicable editions: Express, Standard, and Advanced
Applicable releases: all


9. Good-practice resource – Tune your IBM BPM performance

It is imperative to your success that you read and follow the advice in the appropriate IBM Redpaper™ for your release:
Applicable editions: Express, Standard, and Advanced
Applicable releases: All

Source : IBM

 


 


 


 


 



 





 

IBM BPM - Maintainability

1. Good practice – Avoid mutually dependent toolkits

In IBM® Business Process Manager, design toolkit hierarchies to avoid mutual dependencies by factoring out common content into its own toolkit so that the other toolkits can refer to it independently.
If you update the dependency on a child toolkit, you need to take a new snapshot of that parent toolkit for the change to be effective for whoever uses that toolkit, which can lead to a race situation with mutually dependent toolkits. For example, when you snapshot toolkit A, you now need to update the dependency and snapshot toolkit B, which means that you need to update the dependency and snapshot toolkit A. And that means that you need to update the dependency and snapshot toolkit B. And so on.
Applicable editions: Express, Standard, and Advanced
Applicable releases: All

 

2. Good practice – Back up your IBM BPM data regularly

Back up your IBM® Business Process Manager (BPM) data regularly, particularly after you make discrete configuration changes, such as installing a new system, applying interim fixes, deploying applications, and changing the topology, which you would do for vertical or horizontal scaling. It is also especially important before purging any data. The more recent your data backup, the less work will be lost if restoring it becomes necessary.
To do the back up, shut down the cell, make sure no transaction is pending in the databases, and then back up the IBM BPM databases (and your relevant application databases).
Applicable editions: Express, Standard, and Advanced
Applicable releases: All
Source: IBM

 

IBM BPM - High-Quality Processes

1. Good practice – Diligently deal with faults when invoking external services


Well-designed external and Advanced Integration services have modeled faults for business exceptions such as “insufficient funds” and often have unmodeled faults for technical exceptions such as “network failure” issues. When you are invoking services from a process, design your process to deal with both types of faults. Typically, a business exception can be handled in the process flow, such as by returning to a previous step or engaging the user, whereas a system fault might result in retrying the service or engaging a process administrator.
To learn more about how to model fault handling in Business Process Modeling Notation (BPMN), search the IBM® Business Process Manager (BPM) documentation for your release for “Handling errors in services”.
Also, see the following resources:
To learn more about how to model fault handling in Business Process Execution Language (BPEL), search the IBM BPM documentation for your release for “Fault handling in BPEL“.
Also, see these developerWorks articles:

2. Good practice – Do not use IBM BPM as a system of record

Business processes naturally use business data in the form of variables to represent the process state and affect the process flow. However, do not consider this data a system of record (SOR). IBM® Business Process Manager should always work with external systems of record to access and update data. Use the business data in a process only for the purpose of that process; do not expose that data as an SOR for other purposes.
A proper SOR is architected and designed for transactional, efficient, and safe reading and writing and reporting by one or more users and producers. The business data in a process is merely a temporary stateful representation of that data to affect the process flow and user interactions. Process variables and their underlying IBM BPM persistent data store are not designed to be used outside of that process. Considering these process variables as the single source of truth for that data eventually causes issues and requests for typical transactional CRUD access to that data that is not possible or recommended on top of the IBM BPM internal database.
Applicable editions: Express, Standard and Advanced
Applicable releases: All


3. Good practice – Ensure the health of your BPMN processes by using the JavaScript loop detector and process monitor

There are tools in IBM® Business Process Manager (BPM) that help you ensure the health of your Business process Modeling Notation (BPMN) processes:
JavaScript loop detector: This tool is in IBM BPM V8.5.5 and available as an interim fix (see APAR JR48395) for V8.0.1.1, V8.0.1.2, and V8.5.0.1. With this tool installed and enabled, the engine identifies what appear to be infinite loops in individual server-side JavaScript steps when you perform playbacks in Process Center. If potential infinite loops are detected, you are given an opportunity to terminate that JavaScript step without having to restart Process Center.
Process monitor: From this page on the Process Admin Console, you can proactively and reactively detect processes and services that are acting errantly. For more information, see Monitoring processes and services in the Process Admin Console for IBM Business Process Manager (BPM).
Applicable editions: Express, Standard, and Advanced
Applicable releases: All


4. Good practice – Mark system tasks for deletion when you create them

For system tasks in your business process definitions (BPDs), select the Delete task on completion check box on the Implementation tab of the properties in IBM Process Designer. With this option selected, tasks are automatically deleted when they complete, which can save a significant amount of data from being persisted. Note that the default setting for this check box was changed to selected as of IBM Business Process Manager V8.5.5.0 for newly created system tasks.
For user tasks in your BPDs, make a conscious decision about the Clean State check box on the Implementation tab of the BPD’s properties. By default, this option is not selected, but selecting it automatically cleans up the context (such as variables) for the user task when it completes. If the state is not required to be persisted and this option is selected, you can save a significant about of database space and even speed the migration of snapshot instances.
Applicable editions: Express, Standard, and Advanced
Applicable releases: All

5.Good practice – Turn off auto-tracking in BPDs if it is not required

Auto-tracking in IBM® WebSphere Lombardi Edition and IBM Business Process Manager is important for many business process definitions (BPDs) because it helps you gather, track, and report key business metrics. However, an additional cost comes with auto-tracking because these events are processed by the Performance Data Warehouse and persisted in the database.
Because of that cost, disable the default auto-tracking capability for BPDs if you do not need to track and report on their business metrics so that you can lower your costs​. Also, consider creating tracking groups to track only key business events, and then disable auto-tracking. This approach ensures that the events that are persisted are only those that are required for your business metrics.
Applicable editions: Express, Standard, and Advanced
Applicable releases: All


6.Good practice – Use governance processes for snapshot installations

As of IBM Business Process Manager (BPM) V8.0, Process Center supports a special type of process called a governance process. This process is installed and runs in Process Center to detect and react when a snapshot changes status or a request is made to install a snapshot.
To ensure that there is visibility regarding the installation of new snapshots, it’s a good practice to have a governance process. For example, your governance process could ensure that the architect and test lead both approved installing the new snapshot before it is installed into a production environment.
For information about governance processes, see Applying governance to a process application.
Applicable editions: Express, Standard, and Advanced
Applicable releases: All


7. Good practice – Use IBM BPM Advanced, an enterprise service bus, or both to expose services to your business processes that use BPMN

 Business processes orchestrate services and people. Most business processes require services, such as web services or REST services, to perform their business functions. However, because IBM® Business Process Manager (BPM) Standard is intended for the business developer more so than the integration developer, there is limited support in IBM BPM Standard for accessing services across different protocols. The type system is based on JavaScript rather than XML schema to reduce the complexity.
Therefore, to expose services to your business processes that use Business Process Modeling Notation (BPMN) and have business-friendly user interfaces and protocols, use IBM BPM Advanced, an enterprise service bus (ESB) such as IBM Integration Bus, or both. These products allow for the complexity of integrating with enterprise systems. They also keep dealing with various protocols and qualities of service out of the BPMN business processes that are developed by integration developers who use more powerful integration tools, such as IBM Integration Designer or IBM Integration Toolkit.
Applicable editions: Express, Standard, and Advanced
Applicable releases: All


8.Good practice – Use the facade pattern for Advanced Integration services

When you use Advanced Integration services in IBM® Business Process Manager (BPM) Advanced, a copy of the EAR file for the implementation of each Advanced Integration service is created for each process app that uses it.
For large implementations, these EAR file copies take a lot of space. To avoid wasting space, deploy that implementation EAR file once as part of one dedicated process app, and have a very small facade Advanced Integration service that invokes the process app. This facade pattern is documented in Implementing the facade pattern using IBM Business Process Manager Advanced V7.5. This IBM developerWorks article also applies to IBM BPM V8.0 through V8.5.5.
This pattern is built into IBM BPM v8.5.6.
Applicable editions: Advanced
Applicable releases: All


9.Good practice – Use the right process for the job

It is important to use the right type of process for your requirements. You can determine the right type of process by following these guidelines:
  • For human and case centric processes, use BPMN or business process definitions (BPDs).
  • If you have IBM Business Process Manager (BPM) Advanced, for straight-through processes that contain no human tasks, use BPEL. These processes are more efficient and can use the advanced qualities of services and integration capability.
    • For straight-through processes that do not need to wait on asynchronous services, use BPEL microflows, which are very efficient. The entire process runs in one transaction.
    • For straight-through processes that might span a longer period of time, perhaps because they must wait on an asynchronous response, use BPEL long-running flows. If only a portion of the solution requires long-running processes, separate it into both microflows and long-running processes to maximize the use of microflows. For more information, see Transactional behavior of BPEL processes.
  • If you have only IBM BPM Express or Standard, for straight-through processes use the BPD option (new in V8.5.5) to optimize the process for latency. For more information, see Optimizing BPD execution for latency.
For more information about BPEL microflows versus long-running flows, see the topics BPEL process types and Choosing between a microflow and a long-running process.
Applicable editions: Express, Standard, and Advanced
Applicable releases: All


10. Good practice – Use the sync-over-async invocation pattern with caution

When you develop advanced IBM® Business Process Manager (BPM) applications using IBM Integration Designer, use caution when you invoke an asynchronous component or import using a synchronous invocation style.
Invoking an asynchronous component or import using a synchronous invocation style causes the infrastructure underneath to switch from synchronous to asynchronous, often with unintended consequences including a new transaction boundary, use of threads to wait on the asynchronous response, and specific retry behavior if the invocation fails. This now infamous “Sync Over Async” situation is considered an anti-pattern because of the issues it can cause.
Applicable editions: Advanced
Applicable releases: All

 Source: IBM

 






IBM BPM Good Practices - Tips & Tricks

These good practices, representing the collective wisdom from IBM® Business Process Manager (BPM) development, practitioners, business partners, and other IBMers, apply to all IBM BPM editions.
Good practice Category Editions Applies to IBM BPM on cloud Y/N
Avoid excessive use of server-side JavaScript Performance All Y
Avoid large business objects in a process or service Performance All Y
Avoid multiple sequential system lane activities Performance All Y
Avoid mutually dependent toolkits Maintainability All Y
Back up your IBM BPM data regularly Maintainability All  
Diligently deal with faults when invoking external services High-Quality Processes All Y
Divide the labor when you author custom coach views Separation of Concerns All Y
Do not use IBM BPM as a system of record High-Quality Processes All Y
Ensure business processes have a business owner Methodology All Y
Ensure the health of your BPMN processes by using the JavaScript loop detector and process monitor High-Quality Processes All  
Have a plan for regularly upgrading IBM BPM Operations All Y
Mark system tasks for deletion when you create them High-Quality Processes All Y
Monitor the Process Federation Server embedded Elasticsearch service by using the Head utility Operations Adv, Std N
Place Process Center near where your Process Designer users are physically located Performance    
Plan for and perform non-functional testing Methodology All  
Plan for disaster recovery Methodology All  
Plan your release-to-release migration Security, Topology, Installation, Configuration, and Migration All  
Purge data regularly Performance All  
Specify configuration values in 100Custom.xml Security, Topology, Installation, Configuration, and Migration All  
Turn off auto-tracking in BPDs if it is not required High-Quality Processes All Y
Use an offline process server for production Security, Topology, Installation, Configuration, and Migration All  
Use efficient SQL statements Performance All Y
Use governance processes for snapshot installations High-Quality Processes All Y
Use IBM BPM Advanced, an enterprise service bus, or both to expose services to your business processes that use BPMN High-Quality Processes All  
Use query tables for BPEL processes Performance Advanced Y
Use the facade pattern for Advanced Integration services High-Quality Processes Advanced Y
Use the right process for the job High-Quality Processes Advanced Y
Use the rolling upgrade option when you update IBM BPM Security, Topology, Installation, Configuration, and Migration All N
Use the sync-over-async invocation pattern with caution High-Quality Processes Advanced Y
Implement the appropriate IBM BPM production topology Security, Topology, Installation, Configuration, and Migration All N
Learn about IBM BPM from an expert Methodology All Y
Learn about troubleshooting IBM Business Process Manager Methodology All Y
New to IBM BPM? Start with the Hiring tutorial Methodology All Y
Read the coaches IBM Redbooks publication Methodology All Y
Secure your IBM BPM environment Security, Topology, Installation, Configuration, and Migration All  
Use the IBM BPM Center of Excellence and Program to Project Redbooks Methodology All Y
Use the IBM Business Process Manager Interactive Installation and Configuration Guide or the Interactive Migration Guide Security, Topology, Installation, Configuration, and Migration All  
Tune your IBM BPM performance Methodology All   

Saturday, May 23, 2015

Migrating process instances in IBM Business Process Manager V8

Introduction
Over time processes need to be refined, modified and changed, which leads to the need to deploy new versions of the process applications that encapsulate the new business processes. This presents challenges for businesses in dealing with long-running processes and deciding how to handle processes that are using the previous process application version. IBM Business Process Manager V8 (IBM BPM) provides three options for managing the migration of running process instances:
  • The Leave option means that the version is not updated and the process will run until it completes as determined by the originally deployed process.
  • The Migrate in-flight instances option migrates currently running instances to the version of the selected snapshot. Wherever the running instances are in the flow of the process or service, the new version is implemented for the next item or step. This function allows processes to be modified "in-flight" and to adapt to process changes during runtime. Process owners can open and edit in-flight processes as they are running, change process data, dynamically activate and cancel tasks, trigger escalations, and trigger events.
  • The Delete option, available only on development servers, removes all instances of the old process without completing them.
This article focuses on the migrate option and provides guidance on managing the migration, as well as insight into the rationale for choosing the migration option.
Migrating process instances scenario
Migrating a process is the most complicated of the three options because it requires an understanding of the impact of the process change. This article provides a step-by-step example of a migration process, and describes what happens to running instances when the process flow has changed and left dangling or orphaned navigation steps. Figure 1 illustrates the concept of migration and shows at a high level what we are trying to achieve in choosing the migrate option for upgrading the process.

Figure 1. Migrating a process instance to new version
Migrating process a                    instance to new version 
The versioning of processes in IBM BPM V8 is governed by the following characteristics:
  • Native version control of the process
  • Snapshots to allow you to go back in time to view, deploy and run the previous version of the process application
  • Migration of processes between instances
  • In-flight modification to adopt changes
Migrating in-flight process instances involves updating running processes from the original process to the new version of the process so that they complete as if they were started as the new version, The migration complexity occurs when the new version modifies process flows and activities in the steps that the running instance has not yet completed.
The business scenario
The migration example we'll use in this article leverages the Standard HR Open New Position process from the quick-start tutorial included with the IBM BPM V8 installation. The Hiring Sample process application contains a single business process definition called Standard HR Open New Position. The Open New Position process captures the steps and decision points for submitting and processing a request to fill a position. Figure 2 shows the business process diagram:

Figure 2. HR Open New Position Process
HR Open New Position                     Process 
HR open new position process activities summary
  1. A hiring manager submits a requisition either to fill a new position or to replace a departing employee in an existing position.
  2. The hiring manager determines the position requirements and prepares a requisition for submission to the Human Resources (HR) department.
  3. If the request is to fill an existing position, the requisition is routed directly from the hiring manager to HR, which can then search for job candidates.
  4. If the request is to fill a new position, the requisition is routed to the General Manager (GM) for approval. The GM evaluates the requisition and either approves it or rejects it.
  5. If the GM approves the requisition, it is routed to HR, which can then search for job candidates. If the GM rejects the requisition, the hiring manager is notified and the requisition is terminated.
Preparing the example application
In order to prepare the example application to demonstrate the migration of running process instances, you need to first ensure that the business process definition (BPD) is exposed. You need to expose the BPD to particular participant groups to establish who can:
  • Start instances of the process in Process Portal.
  • View data for instances of the process in reports in Process Portal.
To define this, complete the following steps:
  1. In the IBM Process Center console, click the Process Apps tab.
  2. Select Open in Designer.
  3. In the Designer library, click Processes to view a list of available process definitions.
  4. From the list, double-click the Standard HR Open New Position BPD to display the process diagram.
  5. In the IBM Process Designer view, open the BPD that you want to expose.
  6. Click the Overview tab.
  7. In the Exposing section, shown in Figure 3, configure the exposure settings to expose different aspects of the process to specific groups of users, then click Ctrl+S to save. The example enables all users to start the process instance in IBM Process Portal.

    Figure 3. Exposing business process definitions
    Exposing business                     process definitions in Overview tab
Table 1 shows the settings that can be enabled in the Exposing section.

Table 1. Settings that can be enabled in the Exposing section
Exposure settingAction
Expose to startClick Select to choose the participant group whose members can start instances of this process in Process Portal. Members of the selected participant group can start instances of the process from the Launch tab in Process Portal.
Expose business dataClick Select to choose the participant group whose members can view ad hoc reports that include data for this process in Process Portal.
Expose performance metricsClick Select to choose the participant group whose members can view data for this process in the Process Performance dashboard in Process Portal.
Starting the process instance
Run the Standard HR Open New Position process in the Process Designer Inspector to see a step-by-step execution of a process model.
The Hiring Sample process application contains a single business process definition called Standard HR Open New Position. In Process Designer, in the Diagram tab of the Standard HR Open New Position, follow the steps below to start the process instance:
  1. Click the Standard HR Open New Position process diagram to ensure that it is selected.
  2. Click the run icon, shown in Figure 4, to launch an instance of the process.

    Figure 4. HR Open New Position process diagram
    HR Open New Position                     process diagram
  3. When you are prompted to switch to the Inspector, click Yes. The process diagram displays in the Inspector.
  4. Run the process from the Inspector as follows:
    1. Click the active instance in the left pane to display the new Submit job requisition task in the right pane of the Process Instances view.
    2. Click the run icon in the toolbar to start the task, as shown in Figure 5.

      Figure 5. HR Open New Position process diagram in Inspector
      HR Open New Position                     process diagram in Inspector

    The Submit job requisition task generates the Create Job Requisition Coach in a web browser. In IBM BPM V8, the Coaches are completely redesigned to contain Coach Views. Coach Views are reusable user interfaces that you can create and customize.
  5. Acting as the hiring manager, complete the requisition information, as shown in Figure 6, and click Submit.

    Figure 6. Fill in job requisition information
    Job                             requisition data dialog
  6. Set the Position Type to New.
  7. Click Next.
  8. Acting as the hiring manager, review the information in the Confirm Position Details Coach, shown in Figure 7, and clickSubmit.

    Figure 7. Hiring manager reviews and confirms requisition
    Hiring manager review                             and confirmation and requisition data
  9. Click the refresh icon refresh icon on the toolbar to update the Process Instances view. You can see that the Submit job requisition task is now closed. Because the hiring manager submitted a request to fill a new position, the General Manager must approve the requisition before it is routed to HR. Thus, the process instance moves to the next activity, and generates the Approve or reject requisition task for the General Manager, as shown in Figure 8.

    Figure 8. HR Open New Position process diagram showing process received
    HR Open New Position                             process diagram showing process received
  10. Click the run icon. In some cases, you may be prompted for a user account or a password to run the task.
  11. Select Approved, add a comment if desired, then click Submit.

    Figure 9. Final approval and submission of HR Open New Position 
    Final approval and                             submission of HR Open New Position
  12. You can also run the process from Process Portal. The BPM Process Portal has been redesigned to provide a highly collaborative work experience with increased social capabilities. To test the process in Process Portal, do the following:
    1. Select Start => All Programs => IBM => BPM Advanced 8.0 => Profiles => ProcCtr01 => Process Portal.
    2. Log on to Process Portal at http://localhost:9080/portal using administrator credentials (user ID and password of admin.
    3. Click the name of the process to create an instance of the BPD, in this case Standard HR Open New Position orStandard Hiring Sample, as shown in Figure 10.

      Figure 10. My Task list is Portal
      My Task list                                     is Portal

      The Submit requisition task opens.
    4. Acting as the hiring manager, complete the requisition information.
    5. Set the Position Type to New and click Next.
    6. Because the hiring manager submitted a request to fill a new position, the General Manager must approve the requisition before it is routed to HR, as shown in Figure 11.

      Figure 11. Approve or reject requisition
      Approve or                                     reject requisition and submit

      The process instance moves to the next activity, and generates the Submit requisition task, as shown in Figure 12.


      Figure 12. Submit requisition in My Tasks list
      Submit requisition in My Tasks list
Creating a snapshot
Snapshots record the state of library items in a process application or track at a specific point in time. A developer can capture a BPD at a specific point during development, for example to capture development milestones.
You can create new snapshots for process applications or toolkits from the Designer view and from the Process Center console. Snapshot management, such as installing, exporting, and archiving, is performed in the Process Center console. Here, you'll create a snapshot of the Standard HR Open New Position Process in IBM Process Designer, which will serve as a means to control the iteration of the process. In our example, the snapshot is called V1 because it is the first iteration of the process instance.
  1. Select Snapshot to take a snapshot of the process as shown in Figure 13.

    Figure 13. Create a snapshot
    Create a                     snapshot
  2. Click the plus sign next to Create New Snapshot.
  3. Give the snapshot a name, an acronym and a description, and click Create.
  4. Once the snapshot is created, you can view it in the Process Apps under Snapshots, as shown in Figure 14. Notice that it is not yet deployed.

    Figure 14. Current process on Process Server
    Current process on                             Process Server
  5. You can deploy process application snapshots to connected process servers or to offline process servers using the standard deployment service that is created for each process application. You can also customize the deployment service to add calls and scripts that perform specific functions when a process application is deployed on a server in another environment. Table 2 describes the various server environments.

Table 2. Process Server environment
EnvironmentDescription
DevelopmentBuild and refine your process applications in IBM Process Designer. Create your process models and implement the steps in those models using the Designer. Using the Inspector, demonstrate your development progress in playback sessions so that you can quickly evaluate and refine your prototype. Using the Process Center console, deploy your process applications in test and production environments.
TestUsing the Process Center console, deploy your process applications on the Process Server in your test environment to implement formal quality assurance tests. You can use the Inspector to help verify and resolve issues.
ProductionWhen all issues reported from formal testing are resolved, use the Process Center console to deploy your process applications on the Process Server in your production environment. You can use the Inspector to investigate and resolve any issues reported in your production environment.

  1. On the Process Apps tab, click the process application you want to deploy, and then click Snapshots.
  2. The Snapshots list displays all available snapshots and the status of each. Click Install next to the snapshot you want to deploy.
  3. In the Install Snapshot to Server dialog box, select the server or servers to which you want to deploy the snapshot and then click Install, as shown in Figure 15. In our example, we'll deploy to WS (IBMBPM).

    Figure 15. Install snapshot to WS (IBMBPM) server
    Select to install snapshot to                     WS (IBMBPM) server
  4. As shown in Figure 16, the V1 snapshot is now installed on WS (IBMBPM).

    Figure 16. V1 snapshot installed on WS (IBMBPM) server
    V1 snapshot                     installed on WS (IBMBPM) server
The V1 snapshot instance is now installed on the WS (IBMBPM) Process Server instance. It currently has no instances. The next step is to create instances to test the latest snapshot version on the runtime server.
Creating process instances
Next we want to create some process instances using the Authoring Environment Inspector. For example, Figure 17 shows four process instances deployed on the WS test process server with the V1 snapshot.

Figure 17. Process instances in V1 snapshot
Process instances                     in V1 snapshot 
The four process instances are visible in the V1 snapshot on the WS (IBMBPM)server in the Process Apps Snapshots tab, as shown in Figure 18.

Figure 18. Process instances in V1 snapshot on Process Apps Snapshots tab
Process instances in V1                     snapshot on Process Apps Snapshots tab 
You can also view the process instances in the Process Portal, as shown in Figure 19.

Figure 19. V1 snapshot viewed in the Process Portal
V1 snapshot viewed in the Process Portal 
Creating and deploying a new version
To differentiate snapshot V1 from V2, we've simplified the process in V2 by removing the General Manager approval, making this process simple and subject to orphaned tokens.
Repeat the steps in Creating a snapshot to create a V2 process instance, or snapshot, as shown in Figure 20. Figure 20 illustrates a greatly simplified version of the process that will help illustrate the problem of orphaned tokens. A token becomes orphaned when its associated activity is removed from a BPD of a migrated snapshot. The easiest way to identify and manage orphaned tokens is to generate a policy file and use it to specify whether each potential orphaned token should be moved or deleted during instance migration. We'll cover this in Managing orphaned tokens.

Figure 20. Simplified Standard HR Open New Position without GM approval
Simplified Standard                     HR Open New Position without GM approval 
Table 3 shows the migration options for the new snapshot.

Table 3. Migration options for installed snapshot
Online migration optionOffline migration optionDescription
Leave running instances on current version of the snapshotLeaveThe instances currently running continue to completion using the previously deployed version of the snapshot.
Migrate running instances to new version of the snapshotMigrateCurrently running instances are migrated to the new snapshot you are deploying. Wherever the running instances are in the flow of the process, the new version is implemented for the next item or step.
Delete running instances of current version of the snapshotDeleteThe instances currently running are immediately stopped and do not continue to completion. All records of the running instances are removed from the process server.
Note: Delete is not available on production servers.

When deploying the V2 snapshot, select the Leave option, as shown in Figure 21, so that the active instances continue to run using the old V1 snapshot. Then click Install. Later, you can go to the Process Admin console to perform the instance migration and specify the orphan token policy file.

Figure 21. Select Leave option and install snapshot
Install snapshot                     dialog showing Leave selection 
As you can see in Figure 22, the new snapshot has no instances yet.

Figure 22. V2 snapshot on WS server with no process instances 
V2 snapshot on WS server with                     no process instances 
Figure 23 shows the V1 snapshot with six process instances; two are already completed and four are active.

Figure 23. V1 process instances on WS server
V1 process instances 
Figure 24 shows three currently active process instances on the V2 snapshot.

Figure 24. V2 active process instances
V2 active process instances 
As depicted on Figure 25 shows the V1 and V2 snapshots deployed on WS (IBMBPM) with three active instances on V2 and 4 active instances on V1.

Figure 25. V2 process instances
V2 process instances 
Select Server details for more information on the WS (IBMBPM) server, as shown in Figure 26.

Figure 26. Server details
WS (IBMBPM) server                     details 
Figure 27 shows a the Hiring Sample on server WS (IBMBPM) with the two snapshots, V1 and V2. Click Configure Server to open the Process Admin Console of the WS Server. You can use the Process Admin Console to administer and configure runtime settings for snapshots that are installed on a process server.

Figure 27. Hiring Sample instances for V1 and V2
Hiring Sample instances for V1                     and V2 
In Figure 28, you can see that the server is WS and there are three processes started. Click Process Inspector.

Figure 28. Process Admin Console of WS (IBMBPM) server
Process Admin                     Console of WS (IBMBPM) server 
When you click Installed Apps in the Process Admin Console, you can see the list of snapshots of process applications that have been installed on the current Process Server. In each process application snapshot, only the processes that have been exposed are shown. For each process, you can see the number of instances currently running. As you can see in Figure 29, V1 is the active and default snapshot and V2 is simply shown as active.

Figure 29. V1 and V2 process instances on WS (IBMBPM)
V1 and V2 process instances                      on WS (IBMBPM) 
On a process server, the first snapshot you install is considered the default version. This means that the items in it run when an event or other trigger that applies to more than one version of a process or service is received. When you install subsequent snapshots, you can use the Make Default Version option, shown in Figure 30, in the Process Admin Console to ensure that the snapshot you want to run is the default. Note that this option is available only if you have more than one snapshot on the server.

Figure 30. Make Hiring Sample (HSS) – V2 (Active) the default version
Make Hiring Sample (HSS) – V2                     (Active) the default version 
V2 is now the active and default snapshot, as shown in Figure 31.

Figure 31. Hiring Sample (HSS) – V2 on WS (IBMBPM) shown as Active and Default
Activating HSS – V2 on WS                     (IBMBPM) shown as active and default 
Deactivating an installed application
Use the Process Admin Console to deactivate and, if necessary, stop snapshots that are installed on a process server. All installed snapshots except the default version can be deactivated.
Verify that the Hiring Sample (HSS) – V1 is active and click Deactivate Application, as shown in Figure 32, to deactivate the V1 snapshot. This deactivates the snapshot, allowing all currently running instances to complete. Deactivated snapshots remain installed, but you cannot start a new instance of the exposed processes or services.

Figure 32. Deactivate an installed application
Deactivate                     an installed application 
Managing orphaned tokens
IBM BPM V8 provides a new set of capabilities for managing orphan tokens, which result from migration of in-flight process instances to a new process application snapshot that does not have some of the activities that existed in the previous snapshot. The new capabilities include analysis of two snapshots to identify steps that can potentially result in orphan tokens, as well as the ability to define orphan token handling policies and a set of REST APIs for moving or deleting orphan tokens.
An orphaned token is a pointer that is associated with an activity that was removed from a business process definition (BPD). You can use a policy file, a REST API, or the Process Inspector to manage orphaned tokens.
Some examples of changes between snapshots are:
  • Cosmetic, such as formatting to a Coach (human service)
  • Changes in business variables
  • Modification of flow, such as gateways or swim lanes
  • Changes to undercover agents (UCAs) on the default snapshot
Always compare snapshots before instances are migrated to identify the potential locations of orphaned tokens.
Table 4 shows the options for where to move orphan tokens when installing version two of a snapshot.

Table 4. Where to move orphan tokens
Source Activity LocationTarget in Same ProcessTarget in Parent ProcessTarget in Child SubprocessTarget in Child Event SubprocessTarget in Child Linked Process
ProcessYesN/AYesNoNo
SubprocessYesYesYesNoNo
Event subprocessYesNoYesNoNo
Linked processYesNoYesNoNo

You can run the wsadmin command as shown in Listing 1 to get a list that you can use to spot potential migration problems so that when you migrate to the new version of the snapshot, you have some confidence that it will work. When the file is generated, it will identify all the potential orphaned tokens. Go through the file and identify how you want to handle each token. During migration, if a policy file is specified, the migration uses that file to determine whether to delete or move orphaned tokens.

Listing 1. wsadmin scripting command to sign into the process application
wsadmin -conntype SOAP -port 8880 -host localhost -user admin 
-password admin -lang jython

In the example in Listing 1, localhost is the name of the host in the wsadmin.properties file that is specified by thecom.ibm.ws.scripting.port property. Make sure to substitute your own port, host name, user name, and password when creating a connection and don't forget to specify the language (jython, in this example).
The following example illustrates how to establish a SOAP connection to the Process Center server and then generate an orphaned token policy file for a process application with acronym HSS, which is the acronym that comes from the default Standard HR Open New Position process.
All wsadmin commands for managing process applications must be run in connected mode and the server must be running. Use the -contype argument to indicate what connection type you want to use (SOAP or RMI).

Listing 2. wsadmin scripting command for checking orphan tokens
AdminTask.BPMCheckOrphanTokens('[-processAppAcronym HSS 
-sourceSnapshotName "V1" -targetSnapshotName "V2" -outputFile 
C:\TokenPolicyFile_HSS_V1_to_V2.xml]')

In Listing 2, the BPMCheckOrphanTokens command compares two snapshots and detects the possibility of orphaned tokens before installing a new snapshot and then identifies whether to delete or move each token. The parameters used are as follows:
  • processAppAcronym: A required parameter that identifies the process application that is to be installed; in this case, HSS.
  • sourceSnapshotName: A required parameter that provides the snapshot name from which instances will be migrated (the old version); in this case, V1.
  • targetSnapshotName: A required parameter that provides the snapshot name to which instances will be migrated (the new version); in this case, V2.
  • outputFile: A required parameter that provides the file path to the directory where the orphan token policy file will be generated and a name for that file; in this case, C:\TokenPolicyFile_HSS_V1_to_V2.xml. Use this XML file during the migration of active process instances.
Figure 33 shows the outcome of the wsadmin command that generated the policy file, extracted from the C:\TokenPolicyFile_HSS_V1_to_V2.xml.

Figure 33. Check orphan tokens
Check orphan                     tokens - XML file snippet 
Migrating the in-flight instances
The deployment process checks to see whether the target server is currently running any instances of the BPDs business process definitions included in the deployed snapshot. If it detects one or more running instances on the target server, you are asked whether you want to migrate those running instances to the new snapshot.
  1. From the Process Admin Console, select Installed Apps.
  2. From the list of snapshots, select the one to which you are migrating data, and click Migrate Inflight Data, as shown in Figure 34, then select the snapshot from which you want to migrate data.
    You can lessen the risk that your instance will not complete by carefully managing tokens that are associated with actions that have been deleted. If you are using a policy file to manage potential orphaned tokens, provide the path to that policy file before you click Migrate.


    Figure 34. Migrate in-flight data
    Select to migrate                     in-flight data
The next section shows migration of a very simple process that is used for generation of user tasks.
Migrating in-flight data from a snapshot
You can use the Process Admin Console to migrate in-flight data to a snapshot. After you install a new snapshot that replaces a snapshot with instances that are still running, you might want to migrate the currently running instances to the new snapshot. To do this, use the Migrate Inflight Data dialog to migrate currently running instances to the new version of the selected snapshot. Wherever the running instances are in the flow of the process or service, the new version is implemented for the next item or step.
  1. Click on the V1 snapshot to mark this as the snapshot from which to migrate data.
  2. Select the policy file created in the last section (C:\TokenPolicyFile_HSS_V1_to_V2.xml and click Migrate to migrate to V2, as shown in Figure 35.

    Figure 35. Migrate In-flight data from snapshot
    Migrate In-flight                     data dialog
  3. If the migration does not produce any orphaned tokens, the file is used but no error tokens are generated. Figure 36 shows the migration summary in this case. You can see that the Process Application, Process Instance Migration and Orphan Token Policy generated no errors. Click Close after verifying that the results showed no errors. In the next section, we'll give you an example where orphan tokens are identified and describe possible actions.

    Figure 36. Process instance migration summary
    Process instance                     migration summary
  4. Verify that the processes have been migrated to V2. In Figure 37, you see that there are 6 process instances, with 3 completed and 3 still active.

    Figure 37. V2 process instances on WS server
    V2 process instances on WS                     server
Handling orphaned tokens
Remember that orphan tokens result from migration of in-flight instances to a new BPD snapshot. They are pointers associated with an activity that is no longer a part of the BPD.
You can only delete or move a token that is a leaf node in the execution tree; any parent orphaned tokens will be handled implicitly. For example, suppose an activity implemented as a subprocess is deleted in a new snapshot. Deleting an orphaned token in the subprocess will also delete the orphaned token on the parent activity.
For a parallel gateway, both branches must complete to complete the process successfully. Therefore, if you choose to delete an orphaned token on one branch of a parallel gateway, the process using the parallel gateway will never be able to complete.
When you move a token, you are actually deleting it from one activity and creating a new copy of it attached to a different activity. This behavior creates a limitation if you are using multiple instances of nested business objects. For example, if you have an activity that has three tokens associated with it and you move those tokens to a second activity, only one token is created on the second activity.
Figure 38 shows an example of failed tokens that can't be activated.

Figure 38. Failed token error in process
Failed token error in process 
Figure 39 shows an example of a failed BPDIBD token from a generated XML file.

Figure 39. Failed token extracted from XML file
Failed token extracted                     from XML file 
Conclusion
Running processes can be modified to include new actions and steps, as well as have these actions affect any future processes. Users can choose whether to apply changes to the individual processes or update the process model, which forces other processes to also adopt the change. In this article, you learned about two features in Business Process Manager V8: migrating in-flight process instances and orphaned token management that can help you deal with managing process migration complexities for long-running processes.