Friday, April 25, 2014

Use SAR to Monitor CPU Utilization

SAR (System Activity Reporting) is a common *nix utiliy that can be used to track cpu utilization, memory utilization etc.
 
A common scenario is the need capture cpu statistics during some kind of load testing and then later report on those.  To capture cpu statistics with SAR you can do the following:
 
  1. Logon to the host in question and make sure that sar is installed (run sar from the command line).
  2. To capture statistics every 2 seconds to a file called "mystats.sar" in your home directory, you would execute the following command: sar -o ~/mystats.sar -u 2 0 >/dev/null 2>&1.  Note that this will keep gathering statistics until you kill it using ctrl-c.
  3. To run that same command in the background add an "&" to the end.  You can also "nohup" it so that it keeps running after you logoff - but don't forget to turn it off.  If you background it, then you can find it by typing in "jobs" and it will show you all processes you have put in the background.  You can then kill it with "kill %<jobnum>".  Or you can put it in the foreground "fg %<jobnum>" and then kill it with ctrl-c.
  4. Now you have a file that contains sar statistics, you can retrieve the contents of the file using something like: sar -f ~/mystats.sar.  If you want to just take a timeslice from the file, then you can use the -s hh:mm:ss and -e hh:mm:ss parameters.
See the sar manual page (man sar) for more details.
On Production, SAR are being generated under this directory: /var/log/sa/

Wednesday, April 16, 2014

No edit privilege on a newly imported toolkit

Problem Statement

No edit privilege on a newly imported toolkit. Even though I have listed myself to have read-write permission, I'm not able to edit any artifact in the toolkit. The toolkit was imported recently into the process-center.

Solution

For any toolkit imported into the a process-center, from another process-center, the option "Allow users to update toolkit" is disabled by default. This check-box can be found in the "Manage" tab for the toolkit. This option is only available to the "Admins" of the toolkit. Check that option and restart your process-designer, you will be able to modify toolkit artifacts now.

Tuesday, April 8, 2014

Configuring Apache Load balancer URL

Problem Statement :

You have a clustered environment with 2 or more nodes or you have an Apache layer between the user and your application servers. The users access your application interfaces through the Apache layer, which is responsible for load-balancing, SSO, etc. But when you load the portal or admin console you find that some resources are directly referenced from the application server nodes instead of going through Apache.

Resolution :

Put the following into a file (101CustomLoadBalancer.xml) and place it at

/app/websphere/<DMGR_PROFILE>/config/cells/<CELL>/nodes/<NODE>/servers/<APP_TARGET_JVM>/process-<center/server>/config

<properties>
    <authoring-environment merge="mergeChildren">
        <images-prefix merge="replace">https://<APACHE URL>/teamworks</images-prefix>
        <portal-prefix merge="replace">https://<APACHE URL>/portal</portal-prefix>
        <servlet-prefix merge="replace">https://<APACHE URL>/teamworks</servlet-prefix>
        <webapi-prefix merge="replace">https://<APACHE URL>/webapi</webapi-prefix>
        <repository-prefix merge="replace">https://<APACHE URL>/ProcessCenter</repository-prefix>
        <process-help-wiki-url-view merge="replace">https://<APACHE URL>/processhelp/en/%TITLE%?teamworksTitle=%TEAMWORKS_TITLE%</process-help-wiki-url-view>
        <process-help-wiki-url-edit merge="replace">https://<APACHE URL>/processhelp/en/Special:Edit?topic=%TITLE%&amp;teamworksTitle=%TEAMWORKS_TITLE%</process-help-wiki-url-edit>
    </authoring-environment>
    <common merge="mergeChildren">
        <portal-prefix merge="replace">https://<APACHE URL>/portal</portal-prefix>
        <process-admin-prefix merge="replace">https://<APACHE URL>/ProcessAdmin</process-admin-prefix>
        <!-- Disable for Process Center -->
        <teamworks-webapp-prefix merge="replace">https://<APACHE URL>/teamworks</teamworks-webapp-prefix>
        <coach-designer-xsl-url merge="replace">https://<APACHE URL>/teamworks/coachdesigner/transform/CoachDesigner.xsl</coach-designer-xsl-url>
       
        <webservices merge="mergeChildren">
            <base-url merge="replace">https://<APACHE URL>/teamworks/webservices</base-url>
        </webservices>
        <xml-serialization merge="mergeChildren">
            <default-namespace-uri merge="replace">https://<APACHE URL>/schema/</default-namespace-uri>
        </xml-serialization>
    </common>
    <server merge="mergeChildren">
        <repository-server-url merge="replace">https://<APACHE URL>/ProcessCenter</repository-server-url>
        <email merge="mergeChildren">
            <mail-template merge="mergeChildren">
                <client-link merge="replace">https://<APACHE URL>/teamworks</client-link>
            </mail-template>
        </email>
    </server>
</properties>

Friday, March 14, 2014

CSS Override causing validation errors during migration from 6.2 to 7.5



Problem Statement

When you import any process artifact from Teamworks 6.2 into IBM BPM 7.5, that has coach(s) containing CSS override, it creates a validation error. The error is marked on an empty web-app file that looks similar to “&lt;#=tw.local.css#&gt;”.

Why is this problem encountered

In Teamworks 6.2, you could provide CSS overrides by providing path to the CSS file in the “CSS Override” field. Often this path was fetched from an EPV, local variable or localization resources. The value was passed using the “<#= #>” notation. An illustration of is shown below:




Whereas in IBM BPM 7.5, you cannot use variables (EPV, Localization or Local) to specify the CSS override. You select one of the “Managed Files” as your CSS override. This is outlined below :



Therefore, when you import a service with a coach from 6.2 and import it into 7.5, it tries to fetch the contents of the CSS file by using the contents inside the CSS override box. But, instead of evaluating the variable’s value, it uses it literally as it is. Hence, it cannot find the CSS file’s contents and ends up creating an empty managed file, with a pointer to that empty file in the coach.

 Using approach taken by IBM BPM 7.5 may not be preferable because of one or more of the following reasons:
  1. Your CSS files are not maintained as managed files. Instead they are kept on the web-server or some content management system.
  2. You want the flexibility of using different CSS files based upon the user preferences (Themes).
  3. You want the look and feel to be uniform and easily customizable (hence you choose to store the CSS override file’s location in an EPV)

How to resolve the issue

The simplest way to resolve this is as follows.
  1. Delete the empty file created through the import.
  2. Note down the variable used for CSS override. For example “tw.epv.UAM.PNCCSS”.
  3. Go to the CSS tab for the coach and use the @import syntax as shown below@import url('<#= tw.epv.UAM.PNCCSS + "" #>')
  4. Remove the link to the empty file in CSS Override.

Monday, January 27, 2014

How to get Snapshot ID of the current context

Use the call "tw.system.model.processAppSnapshot.id" to fetch the ID of the currently execution snapshot.

Wednesday, January 15, 2014

BPM 7.5 PO Type Codes


CODE TABLE NAME Common Name 1 Common Name 2
1  "LSW_PROCESS"  "process"  "Service"
2  "LSW_IC"  "integrationComponent"  "IC"
3  "LSW_CONNECTOR"  "connector"  "Connector"
4  "LSW_UCA"  "underCoverAgent"  "UCA"
7  "LSW_WEB_SERVICE"  "webService"  "WebService"
8  null  "webScript"  "WebScript"
11  "LSW_REPORT"  "report"  "Report"
12  "LSW_CLASS"  "twClass"  "VariableType"
13  "LSW_SCBD"  "scoreboard"  "Scoreboard"
14  "LSW_TRACKING_GROUP"  "trackingGroup"  "TrackingGroup"
15  "LSW_TIMING_INTERVAL"  "timingInterval"  "TimingInterval"
16  "LSW_TRACKING_POINT"    
17  "LSW_TRACKED_VARIABLE"    
20  "LSW_LAYOUT"  "layout"  "Layout"
21  "LSW_EPV"  "epv"  "EPV"
22  null  "globalVariable"  "GlobalVariable"
24  "LSW_PARTICIPANT"  "participant"  "Participant"
25  "LSW_BPD"  "bpd"  "BPD"
30  "LSW_PRIORITY"  "priority"  "Priority"
31  null  "calendar"  "Calendar"
40  null  "customStatus"  "CustomStatus"
42  null  "alertSeverity"  "AlertSeverity"
43  "LSW_INFOPATH_FORM"  "infoPathForm"  "InfoPathForm"
47  "LSW_SLA"  "sla"  "SLA"
49  "LSW_METRIC"  "metric"  "Metric"
50  "LSW_RESOURCE_BUNDLE_GROUP"  "resourceBundleGroup"  "ResourceBundleGroup"
51  "LSW_USER_ATTRIBUTE_DEF"  "userAttributeDefinition"  "UserAttributeDefinition"
52  "LSW_SIM_SCENARIO"  "simulationScenario"  "SimulationScenario"
53  "LSW_HIST_SCENARIO"  "historicalScenario"  "HistoricalScenario"
54  "LSW_ORG_CHART"  "orgChart"  "OrgChart"
60  "LSW_EXTERNAL_ACTIVITY"  "externalActivity"  "ExternalActivity"
61  "LSW_MANAGED_ASSET"  "managedAsset"  "ManagedAsset"
62  "LSW_ENV_VAR_SET"  "environmentVariableSet"  "EnvironmentVariableSet"
63  "LSW_PROJECT_DEFAULTS"  "projectDefaults"  "ProjectDefaults"
2001  null  "alertType"  "AlertType"
2005  "LSW_BREAKPOINT"    
2006  "LSW_BPD_EVENT"    
2007  "LSW_BPD_PARAMETER"    
2013  "LSW_EPV_VAR"    
2014  "LSW_EPV_VAR_VALUE"    
2015  "LSW_FAVORITE"    
2018  "LSW_IC_INPUT_PROPERTY"    
2019  "LSW_IC_OUTPUT_PROPERTY"    
2020  "LSW_TIMING_INTERVAL_BOUND"    
2022  "LSW_LAUNCHER"    
2023  "LSW_LAYOUT_PARAM"    
2025  "LSW_PROCESS_ITEM"    
2027  "LSW_PROCESS_LINK"    
2028  "LSW_PROCESS_LABEL"    
2029  "LSW_PROCESS_ITEM_PRE_POST"    
2030  "LSW_REPORT_PAGE"    
2031  "LSW_REPORT_CHART"    
2032  "LSW_REPORT_DATASOURCE"    
2033  "LSW_REPORT_DATASOURCE_IC_LINK"    
2034  "LSW_REPORT_DS_LAYOUT_LINK"    
2035  "LSW_REPORT_VARIABLES"    
2036  "LSW_REPORT_EPV_LINK"    
2037  "LSW_REPORT_TG_LINK"    
2038  "LSW_RESOURCE_BUNDLE"    
2039  "LSW_RESOURCE_BUNDLE_KEY"    
2040  "LSW_SAVED_SEARCHES"    
2041  "LSW_SCBD_RPT_LINK"    
2044  "LSW_UCA_SYNC_QUEUE"    
2045  "LSW_UCA_BLACKOUT"    
2046  "LSW_UCA_PARM"    
2047  "LSW_USR"    
2048  "LSW_USR_XREF"    
2049  "LSW_USR_ATTR"    
2050  "LSW_USER_ATTR_DEF_VALUES"    
2052  "LSW_WEB_SERVICE_OP"    
2054  "LSW_PARAMETER_MAPPING"    
2055  "LSW_PROCESS_PARAMETER"    
2056  "LSW_PROCESS_VARIABLE"    
2058  "LSW_EPV_PROCESS_LINK"    
2059  "LSW_RESOURCE_PROCESS_LINK"    
2060  "LSW_EXTACT_PARAMETER"    
2061  "LSW_EXTACT_PROPERTY"    
2063  "LSW_BRANCH"    
2064  "LSW_SNAPSHOT"    
2065  "LSW_DEPLOYMENT"    
2066  "LSW_PROJECT" "Process App" "Process App"
2068  "LSW_SERVER"    
2069  "LSW_PROJECT_DEPENDENCY" "toolkit" "toolkit"
2072  "LSW_BPD_INSTANCE"    
2073  "LSW_BPD_INSTANCE_DATA"    
2075  "LSW_USR_GRP_XREF"    
2076  "LSW_RELEASE"    
2077  "LSW_ENV_VAR_VAL"    
2078  "LSW_TASK"    
2079  "LSW_USER_FAVORITE"    
2080  "LSW_FILE"    
2081  "LSW_TASK_NARR"    
2082  "LSW_TASK_ADDR"    
2084  "LSW_TASK_EXECUTION_CONTEXT"    
2085  "LSW_TASK_IPF_DATA"    
2086  "LSW_TASK_EXTACT_DATA"    
2087  "LSW_USR_ASSUME"    
2089  "LSW_BPD_NOTIFICATION"    
2090  "LSW_DEP_PATH"    
2091  "LSW_PO_REFERENCE"    
2092  "LSW_ENV_VAR_DEFAULT"  "environmentDefault"  "EnvironmentDefault"
2093  "LSW_ENV_TYPE"    
2094  "LSW_ENV_VAR"  "environmentVariable"  "EnvironmentVariable"
2095  "LSW_RT_REFERENCE"    
2096  "LSW_REPOSITORY_HISTORY"    
2097  "LSW_TIME_PERIOD"    
2098  "LSW_TIME_SCHEDULE"    
2099  "LSW_HOLIDAY_SCHEDULE"    
2100  "LSW_ACL_ENTRY"    
2101  "LSW_SMART_FOLDER"  "SmartFolder"  null
2102  "LSW_REPORT_DATASOURCE_SRV_LINK"    
2103  "LSW_INSTALLATION"    
2104  "LSW_BLUEPRINT_SUBSCRIPTION"    
2105  "LSW_REPORT_RBG_LINK"    
2106  "LSW_ENV_VAR_TYPE"    
2107  "LSW_SERVER_CAPABILITY"    
2108  "LSW_CAPABILITY_TYPE"    
6001  "BPM_CONTRIBUTION"  "contribution"  "Contribution"
6002  "BPM_CTRB_PROPERTY"    
6004  "BPM_CTRB_DEPENDENCY"    
6003  "BPM_ARTIFACT"  "artifact"  "Artifact"
6005  "BPM_PROC_ARTIFACT_REF"    
6006  "BPM_CLS_ARTIFACT_REF"    
6007  "BPM_BPD_ARTIFACT_REF"    
6008  "BPM_MON_MODEL_DATA"    

Fetch Duplicate Artifacts in BPM 7.5

Get a list a artifacts duplicated across Process-App or Toolkits (Oracle 11g and up only)


WITH po AS ( 
    SELECT distinct
      ver.PO_NAME,
      ver.PO_TYPE,
    /*  snap.is_default,
      snap.name AS "Snapshot Name",
      snap.acronym AS "Snapshot Acronym",
      snap.is_archived AS "Is Snapshot Archived",
      proj.name AS "Process App",
    */ --LISTAGG(TO_CHAR(proj.short_name), '; ') within group( order by proj.short_name) AS "PROCESS APP ACRONYM",
    TO_CHAR(proj.short_name) AS short_name
    FROM bpi_procc_shr_shr.lsw_branch brnch,
      bpi_procc_shr_shr.lsw_po_versions ver,
      bpi_procc_shr_shr.lsw_snapshot snap,
      bpi_procc_shr_shr.lsw_project proj
    WHERE ver.branch_id       = brnch.branch_id
    AND brnch.tip_snapshot_id = snap.snapshot_id
    AND snap.project_id       = proj.project_id
    AND proj.short_name     NOT IN ('TWSYS', 'TWP', 'HSS', 'LSWPSC', 'SACOMMC', 'BDS2', 'SAPAPPS', 'OF_DEM')
    AND ver.PO_NAME IS NOT NULL
    AND snap.name IS NOT NULL
    AND
      -- ver.po_name like 'Submit Requisition' and
      snap.is_archived = 'F'-- and
      -- ver.end_seq_num is null
    ORDER BY ver.PO_NAME
    --group by ver.PO_NAME
)
select
  po.PO_NAME,
  po.PO_TYPE,
  LISTAGG(po.short_name, '; ') within group(order by po.short_name) AS "APP_LIST",
  count(1) "DUPLICATE COUNT"
--  po.short_name
from po
group by po.PO_NAME, po.PO_TYPE
having count(1) > 1
;