> > > Create Ruleset Formulas in Clarify 4.6+

Create Ruleset Formulas in Clarify 4.6+

22nd January 2017

In an earlier post we review Old and New Formulas in Clarify

Below we will review how to create a formula in Clarify 4.6 and above.

With a few simple steps users can create a new formula. In our example we will build a formula from start to finish.

STEP 1: Identify Project

Below we will use the core.zexample project

Cleo Clarify 4.6 project

STEP 2: Create JAVA Class

Cleo Clarify 4.6 create Java Class

STEP 3: Name new JAVA Class

Cleo Clarify 4.6 name Java Class

STEP 4: Update Source Code

Update Cleo Clarify Java source Code

When the new basic cource code is created, we will want to update the code with the source below

Example Code

package com.zexample;

import com.extol.ebi.lang.annotations.EbiName;
import com.extol.ebi.reactor.lib.AbstractAction;
import com.extol.ebi.reactor.lib.actions.string.Normalize;

@EbiName(“String Equals Normalized 2”)
public class Normalize2x extends AbstractAction {

public com.extol.ebi.ruleset.lang.core.Boolean execute(
@EbiName(“input”) com.extol.ebi.ruleset.lang.core.String input,
@EbiName(“input2”) com.extol.ebi.ruleset.lang.core.String input2,
@EbiName(“value”) com.extol.ebi.ruleset.lang.core.String value
){
input = new Normalize().execute(input);
input2 = new Normalize().execute(input2);
value = new Normalize().execute(value);

boolean result1 = input == null ? value == null : input.asJavaString().equals(asJavaString(value));
boolean result2 = input2 == null ? value == null : input2.asJavaString().equals(asJavaString(value));

return asBoolean(result1 || result2);
}
}


By: on