Document Builder: Available input in rule condition part

96 阅读1分钟

Created by Jerry Wang, last modified on Jul 11, 2014

For convenient purpose, I call the part of a given rule which contains all kinds of condition evaluation such as IF <variable> = 'XXX' combined with OR, AND etc as "condition part".

 

clipboard1

 

 

 

The common usage case in condition part is the evaluation on the content of given variables, see above example.

 

 

IS_ELEMENT_EXCLUDED & IS_ELEMENT_INCLUDED

 

 

these two functions are very ituitive, just pass in the element ID, it will return true if the element is currently excluded ( included ) in the document.

clipboard2

 

 

IS_PRECONDITION_VALID

 

 

See example above:

clipboard3

 

 

It means if rule ZCR_RULE_TEST is executed, then ZCR_FOOTER must be included as optional, or else as mandatory.

 

 

I assign this rule to element ZCR_NAME.

 

 

The precondition rule ZCR_RULE_TEST looks like below:

clipboard4

 

 

Based on these two rules we could have the following assumptions:

 

 

1. If ZFIRST = X, then ZCR_NAME will be mandatory, and ZCR_FOOTER will be optional.

 

2. If ZFIRST <> X, then ZCR_NAME will be recommended, and ZCR_FOOTER will still be optional.

 

 

Test in UI, working as expected:

clipboard5

 

 

clipboard6

 

 

 

When will the precondition not valid?

 

 

Have a look at the method of class /IPRO/CL_RULE_ENGINE below:

clipboard7

 

it just check whether the column RESULT for rule ZCR_RULE_TEST has value X or not.

 

clipboard8

 

 

 

TODO: Jerry willl have further investigation on how is this RESULT column filled.

 

 

IS_VALUE_IN_TABLE

 

 

First parameter: technical name of table variable name

 

Second parameter: technical name of table column

 

Third parameter: value which you would like to evaluate

clipboard9