book
Article ID: KB0084859
calendar_today
Updated On:
Description
Resolution:
Trigger rules are a special type of event rule that can be defined for Object Service Broker (OSB) internal or external tables such as DB2, IDMS or IMS. Trigger rules can perform actions when specific types of accesses are made against the table using OSB. You can perform different actions for each type of access such as: get, insert, delete and etc. Trigger rules are useful to maintain a one-to-one relationship between two tables. However, when developing an application with trigger rules, you may encounter the error:
Trigger for table "table_name" failed
Unable to find rule "trigger_rule" in library
even though you have written a trigger rule.
Environment:
============
* TIBCO Object Service Broker
Symptoms:
=========
The messages:
Trigger for table "table_name" failed
Unable to find rule "trigger_rule" in library
are returned to your OSB session as part of an access failure via the OSB session INFORMATION LOG.
Cause:
======
This error may be raised for two reasons:
1. the name of the trigger rule defined in the table definition does not match the name of the actual trigger rule
2. the search path guiding OSB on how to find the trigger rule does not point to the library containing the trigger rule
Resolution:
===========
If the you have a mismatch between the trigger rule name in the table definition and the actual trigger rule name in the rule library, you must change one the names to achieve consistency.
If your failure is because the rule cannot be found successfully, then you should review the following information:
Object Service Broker keeps rules in three types of libraries:
1. Local -a library where you define your test rules for developing an application. Name is variable depending on your organization's naming convention. You can change the name by using the LIBRARY= (L=) Execution Environment (EE) parameter.
2. Installation -where your organization's final rules are kept for production. Usually this library is called SITE by default. You can change the name by using the INSTLIB= (I=) EE parameter.
3. System -the library where rules shipped with OSB reside. Usually this library is called COMMON by default. You can change the name by using the SYSLIB= (S=) EE parameter.
When you start a session, there is a parameter called SEARCH= (SEA=) that tells OSB how to search the above library structure. In production, you do not want to be searching various libraries unnecessarily when likely the rule would be in the SITE installation library. In a development environment, you would likely want to check your local library first and then the SITE; otherwise, the rule may not be found. So the value for SEARCH= is important. Probably you would use SEARCH=L for test which uses the following search order:
1. The local library, as specified by the LIBRARY parameter
2. The installation library, as specified by the INSTLIB parameter
3. The builtin library
4. The system library, as specified by the SYSLIB parameter
5. The external routines library that is contained in the ROUTINES table
(This is explained in the TIBCO® Object Service Broker Parameters manual.)
However the situation is a bit more complicated if you are using the Workbench, for instance, since the Workbench sets SEARCH=S while executing regardless of what value you have chosen for the SEARCH= parameter at logon time. This means that executing a trigger rule may fail if the trigger rule resides in your local or installation libraries since it only looks for the trigger rule in the COMMON library where it will never be found. There are some ways around this including use of STE or STEBROWSE tools. See TIBCO® Object Service Broker Managing Data which states:
- - -
Search Path
The search path for the application invoking the event rule determines the search path for the event rule. Because the Table Editor on the developer’s workbench has a search path of S (system library), when you are accessing the table from the workbench you must execute the shareable tools STEBROWSE or STE to browse or edit a table using an event rule. For more information about these tools, refer to TIBCO Object Service Broker Shareable Tools.
- - -
Alternatively, you could move your trigger rule into COMMON but this in not a good idea since you do not want to compromise the OSB product's integrity. Security may prevent you from updating COMMON since this is an action that is highly discouraged. (Modifying critical internal product objects in COMMON could cause a major product failure.)
If you are running your rules via the TIBCO BusinessWorks™ OSB Plug-in, there is a specification in the OSB Connection tab that allows you to specify the Library and Search path.
Review the location of your trigger rule and the library structure implemented for your EE and session, configuring your environment accordingly.
References:
===========
TIBCO BusinessWorks™ OSB Plug-in User’s Guide
TIBCO® Object Service Broker Application Administration
TIBCO® Object Service Broker Managing Data
TIBCO® Object Service Broker Programming in Rules
TIBCO® Object Service Broker Shareable Tools
Issue/Introduction
What causes the error: Unable to find rule "xxxxxxxxxxxxxx" in library?