How Do We Get the Instance & Task Information for a Particular Snapshot?
YuanShang 27000723E1 Visits (6786)
We often get this question in Business Process Manager (BPM) support: "How do we get a list of bpd instances or tasks for a particular snapshot?" When it comes to application and snapshot management, it’s a very common question that each BPM system administrator may encounter. Therefore, a tool or method which can be used to simply query and customize the results, is always one of the top requirements we have received from our clients. In this article, we will cover some basic tools and steps that we recommend you use when it’s necessary to figure out the number of BPD instances and tasks for a snapshot or a process application.
Approach I: REST API
For all supported BPM versions (from BPM 8.5.0 to BPM 8.6.0), except for the traditional SQL query against to the table LSW_BPD_INSTANCE, we would recommend that you could utilize the function of BPM REST API Tester here as well.
Using BPM REST API Tester, please run the query below under Search API category to find out all the instances and their statuses for a particular snapshot.
Where %2C is ,(comma), %7C is |, and the condition instanceSnapshot followed with the Snapshot name you would like to check.
Here is the screen image from REST API Tester for your reference:
[Figure 1: REST API Tester (click image to enlarge)]
You will get a detailed list of instances for this particular snapshot including the instance ID, instance Name, instance status as well as the related task assigned to the user you are currently logged in with.
Here is a part of sample result list:
[Figure 2: REST API Result (click image to enlarge)]
Again it’s worth mentioning that this approach can be used from BPM 18.104.22.168 to BPM 8.6.0 no matter which version your environment is. Besides, as the REST API above is actually constructing a database query as we normally do against BPMDB, also there are some offset and size parameters for paging, please use it with extra care for your Production environment in case it might bring up some performance issues when there is a large result.
Approach II: Saved Search Defined at Responsive Portal
For BPM 8.5.7 and later versions, you will have one more alternative option to construct your own queries between snapshot, instances, tasks, and processes by customizing your own saved search at BPM Responsive Portal. Since BPM 8.5.7 you can define various saved searches at Portal rather than Process Admin Console we used before. Choose the different search criteria and columns of searching result as shown in the following steps, construct your unique queries using your own new saved search.
Step 1: Create a new Saved Search and Name it.
[Figure 3: New Saved Search (click image to enlarge)]
Step 2: Customize your own query by selecting the Filter Criteria and editing the columns.
Click the "Add" button, and add criterion "Snapshot Equals to ‘TestSnapshot’"
[Figure 4: Filter Criteria (click image to enlarge)]
[Figure 5: Add Snapshot Name (click image to enlarge)]
Click "Edit Columns"
[Figure 6: Column Edit (click image to enlarge)]
Step 3: Save your search result, and you can customize how your result is displaying by selecting the "organization by" and the status of tasks.
[Figure 7: Customize the Display (click image to enlarge)]
[Figure 8: Display Result (click image to enlarge)]
Because Portal is mainly served to display and manage tasks for end users, at this point, you could manipulate all of the possible queries related to tasks and BPD. It does not show the instances’ information directly, but we could still use it as one of the cross references to figure out which instances belong to the specific snapshot. In addition, the new saved search allows users to construct as much task/process related queries as possible so that it does not limit to a particular snapshot, you could add as much criteria as necessary to come up with the data you need.
Finally, these two methods above can be used for system administrators who need to manage hundreds of process applications, snapshots, BPD instances and processes. And you could always verify the result with your DBA if there is any confusion caused by the query construction and REST API usage.