Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 2 Composition of a Rule : Components of a Rule

Components of a Rule
What are the Components?
A rule is divided into four components:
Illustration of the Component Parts of a Rule
Using the following sample rule, this chapter explains the components of a TIBCO Object Service Broker rule.

 
RULE EDITOR ===> SCROLL: P
EMPLOYEES_RAISE(JOBTITLE, REGION); Declaration
_ LOCAL RAISE, RATE;
_ ------------------------------------------------------------------------
_ JOBTITLE = 'SENIOR ANALYST'; Conditions | Y N N
_ JOBTITLE = 'ANALYST'; | Y N
_ ------------------------------------------------------------+-----------
_ RATE = 0.1; | 1
_ RATE = 0.05; Actions | 1
_ RATE = 0.02; | 1
_ GET EMPLOYEES(REGION) WHERE POSITION = JOBTITLE; | 2
_ FORALL EMPLOYEES.SALARY * RATE; | 2 2 3
_ EMPLOYEES.SALARY = EMPLOYEES.SALARY + RAISE; |
_ CALL REPLACE_SALARY(REGION); |
_ CALL MSGLOG(EMPLOYEES.LNAME || ‘ NOW EARNS ‘ || |
_ EMPLOYEES.SALARY); |
_ END; |
_ -------------------------------------------------------------------------
ON GETFAIL: Exception Handlers
CALL ENDMSG('POSITION IS INVALID');
 
 
PFKEYS: 1=HELP 3=END 12=CANCEL 13=PRINT 14=EXPAND 2=DOCUMENT 22=DELETE

 
Information about Syntax
For an explanation of the syntax of these components, refer to Chapter 8, Using Expressions and Operators and Syntax of Rules.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved