0% found this document useful (0 votes)
69 views1 page

Complex Hierarchy - Java

This document contains code for a rule engine that takes in a user's country, city, and address and outputs a hierarchical string with those details separated by semicolons. It first checks that the country, city, and address are not null, and if not null, concatenates them into a string separated by semicolons. If any of the inputs are null, it simply outputs "World".

Uploaded by

Kailas Padawale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views1 page

Complex Hierarchy - Java

This document contains code for a rule engine that takes in a user's country, city, and address and outputs a hierarchical string with those details separated by semicolons. It first checks that the country, city, and address are not null, and if not null, concatenates them into a string separated by semicolons. If any of the inputs are null, it simply outputs "World".

Uploaded by

Kailas Padawale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

/**

import [Link]
import [Link]
import [Link]
import [Link]
import [Link]._UserAction
import [Link];

global [Link] sql


global [Link].Log4JImpl logger
*/
when
userBean : UserBean( )
resultBean : ResultBean( )
then
/**
####################################
Name: Complex Hierarchy
Configuration Type: Advanced
Rule: COMPLEX_HIERARCHY
Value: Hierarchy
Separator Char: Semi-Colon (;)
####################################
World
- United Kingdom
- - Belfast
- - - 1 Main Street
- - London
- - - 2 High Street
- - - 3 Oxford Street
- - - 4 Piccadilly
- France
- - Paris
- - - 5 Rue de Provence
####################################
*/
/* Country>City>Office */
String country = [Link]();
String city = [Link]();
String office = [Link]();

if (country != null && city != null && office != null) {


[Link]("World;" + country + ";" + city + ";" + office);

} else {
[Link]("World");
}

You might also like