Sterling Managed File Transfer

Sterling Managed File Transfer

Come for answers, stay for best practices. All we're missing is you.

 View Only

Determine BP Usage Stats via Command Line Tool in IBM Sterling B2B Integrator and Sterling File Gateway

By Tanvi Kakodkar posted Thu January 23, 2020 08:59 AM

  
Originally updated on December 2, 2014 by VinceTkac

The attached file is a small utility to show the state of BPs in the system.  This is the same data available on the troubleshooter / BP usage page.

 
Instructions for installation:
  1. Download and extract the utility from the zip file:  showWFState.zip
  2. Copy the showstates.jar to the install/jar directory
  3. Edit install/properties/dynamicclasspath.cfg.in and add a line pointing to the jar
  4. Copy showWorkflowStates.sh.in to install/bin and run setupfiles

Run the tool as:
sh showWorkflowStates.sh [-list]

With no options, you get the counts.
With the -list option you get the workflow IDs.


To recompile the source, use:
 javac -d . -classpath /install/jar/platform_ifcbase/1_3/platform_ifcbase.jar:/install/jar/platform_asi/1_3/platform_asi.jar ShowWorkflowStates.java
 jar cf /install/jar/showstates.jar com
 
Sample Output
tkac@localhost %) ./showWorkflowStates.sh
ASYNC_QUEUED: 0
HALTED_SOFTSTOP: 0
ACTIVE: 22
HALTED: 2290
HALTING: 0
WAITING: 2
WAITING_ON_IO: 0
INTERRUPTED_MAN: 0
INTERRUPTED_AUTO: 0

tkac@localhost %) ./showWorkflowStates.sh -list
ASYNC_QUEUED: []
HALTED_SOFTSTOP: []
ACTIVE: [3310, 4307, 7539, 8040, 9107, 10138, 11095, 12031, 47850, 50431, 51104, 52112, 53141, 54028, 55567, 56051, 78176, 100229, 100253, 110001, 111501, 111502]
HALTED: [667, 2510, 6671, 14987, 18138, 19225, 19235, 19245, 19256, 19279, 19290, 19300, 19318, 19328, 19339, 19351, 19361, 19371, 19381, 19404, 19412, 19422, 19440, 19450, 19461, 19473, 19483, 19493, 19503, 19526, 19535, 19545, 19563, 19573, 19584, 19596, 19606, 19616, 19626, 19649, 19657, 19667, 19685, 19704, 19725, 19744, 19763, 19785, 19804, 19814, 19825, 19837, 19847, 19857, 19867, 19877, 19887, 19907, 19926, 19936, 19947, 19967, 19977, 19987, 20006, 20019, 20038, 20057, 20078, 20089, 20099, 20109, 20119, 20129, 20141, 20159, 20169, 20180, 20200, 20211, 20221, 20231, 20241, 20251, 20264, 20282, 20292, 20303, 20323, 20334, 20344, 20354, 20364, 20374, 20386, 20404, 20414, 20425, 20445, 20456, 20466, 20476, 20486, 20496, 20517, 20527, 20538, 20548, 20568, 20579, 20589, 20599, 20609, 20619, 20639, 20649, 20659, 20670, 20690, 20701, 20711, 20729, 20739, 20753, 20764, 20774, 20784, 20802, 20814, 20833, 20843, 20862, 20874, 20893, 20903, 20913, 20934, 20944, 20954, 20973, 20983, 20996, 21015, 21034, 21055, 21074, 21084, 21103, 21115, 21126, 21136, 21154, 21164, 21177, 21187, 21197, 21203, 21209, 21227, 21240, 21251, 21261, 21267, 21281, 21291, 21304, 21314, 21324, 21335, 21353, 21365, 21376, 21394, 21404, 21414, 21427, 21437, 21447, 21458, 21476, 21489, 21500, 21518, 21528, 21538, 21551, 21561, 21571, 21581, 21599, 21611, 21622, 21640, 21650, 21661, 21673, 21691, 21701, 21712, 21722, 21735, 21753, 21763, 21773, 21784, 21796, 21814, 21824, 21835, 21845, 21857, 21875, 21885, 21904, 21916, 21926, 21945, 21964, 21986, 22005, 22024, 22036, 22046, 22057, 22067, 22077, 22087, 22107, 22117, 22127, 22146, 22158, 22168, 22179, 22189, 22199, 22209, 22232, 22242, 22252, 22271, 22283, 22293, 22304, 22314, 22324, 22344, 22354, 22364, 22374, 22393, 22405, 22415, 22426, 22444, 22454, 22467, 22477, 22487, 22498, 22516, 22528, 22538, 22549, 22567, 22577, 22589, 22599, 22609, 22620, 22638, 22650, 22660, 22671, 22689, 22699, 22712, 22722, 22733, 22751, 22761, 22773, 22784, 22802, 22812, 22822, 22834, 22845, 22855, 22873, 22883, 22895, 22906, 22924, 22934, 22944, 22957, 22968, 22978, 22996, 23006, 23018, 23029, 23047, 23057, 23067, 23079, 23090, 23100, 23118, 23128, 23140, 23151, 23169, 23179, 23189, 23202, 23221, 23231, 23241, 23251, 23263, 23274, 23292, 23302, 23312, 23324, 23343, 23353, 23363, 23373, 23394, 23413, 23432, 23445, 23464, 23474, 23493, 23514, 23533, 23552, 23564, 23574, 23593, 23612, 23624, 23634, 23644, 23654, 23664, 23674, 23696, 23706, 23717, 23735, 23747, 23757, 23768, 23778, 23788]
HALTING: []
WAITING: [78169, 111500]
WAITING_ON_IO: []
INTERRUPTED_MAN: []
INTERRUPTED_AUTO: []
 
Source
The utility uses a reporting API which has not been classified as public and may change in the future:

package com.sterlingcommerce.woodstock.workflow;

import java.util.Vector;
import java.util.ArrayList;
import java.util.Hashtable;
import java.sql.Connection;

import com.sterlingcommerce.woodstock.workflow.WorkFlowMonitor;
import com.sterlingcommerce.woodstock.workflow.services.WFUtil;

public class ShowWorkflowStates {
   public static void main(String args[]) throws Exception {
      boolean list = false;
      if (args.length > 0) {
         if (args[0].equalsIgnoreCase("-list")) { list = true; }
      }
      WorkFlowMonitor wfm = new WorkFlowMonitor();
      ArrayList tmpList = wfm.getAllIdsWithState(null);
      if (tmpList !=null && tmpList.size()>0) {
         for (int i=0; i< tmpList.size();i++) {
            Hashtable tMap=(Hashtable) tmpList.get(i);
            String state = WFUtil.getState(((Integer) tMap.get("STATE")).intValue(),false);
            ArrayList ids = (ArrayList)tMap.get("IDS");
            if (list) {
               System.out.println(state + ": " + ids);
            } else {
               System.out.println(state + ": " + ids.size());
            }
         }
      } else {
         System.out.println("No results -- maybe you need to run the index BP.");
      }
   }
}
 

#DataExchange
#IBMSterlingB2BIntegratorandIBMSterlingFileGatewayDevelopers
0 comments
28 views

Permalink