/** * @author Alexander Wert * */ @Rule public interface AnnotatedInterface { }
@Rule(name = "ProblemCauseRule") public class ProblemCauseRule {
/** * @author Alexander Wert * */ @Rule(name = "RuleA", description = "RuleADescription") public class RuleA { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "A") public String action() { return input + input; } }
/** * @author Alexander Wert * */ @Rule(name = "RuleA", description = "RuleADescription") public class RuleA { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "A") public String action() { return input + input; } }
/** * @author Alexander Wert * */ @Rule(name = "RuleB") public class RuleB { @TagValue(type = "A") String input; @Action(resultTag = "B") public int action() { return input.length(); } }
/** * @author Alexander Wert * */ @Rule(name = "RuleB") public class RuleB { @TagValue(type = "A") String input; @Action(resultTag = "B") public int action() { return input.length(); } }
/** * @author Alexander Wert * */ @Rule(name = "RuleE") public class RuleE { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "E") public String action() { return input + "E"; } }
/** * @author Alexander Wert * */ @Rule(name = "RuleD") public class RuleD { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "D") public int action() { throw new RuntimeException("Expected Rule exception"); } }
/** * @author Alexander Wert * */ @Rule(name = "RuleD") public class RuleD { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "D") public int action() { throw new RuntimeException("Expected Rule exception"); } }
/** * @author Alexander Wert * */ @Rule public class AnnotatedSuperClass { @TagValue(type = "Test") public int par3 = 1; /** * */ public AnnotatedSuperClass(int x) { par3 = x; } @Action(resultTag = "Test2") private void actionD() { } }
/** * @author Alexander Wert * */ @Rule(name = "RuleG") public class RuleG { @TagValue(type = "A") String input1; @Condition public boolean condition() { return false; } @Action(resultTag = "G") public String action() { return input1; } }
@Rule(name = "GlobalContextRule") public class GlobalContextRule {
@Rule(name = "CauseStructureRule") public class CauseStructureRule {
@Rule(name = "TimeWastingOperationsRule") public class TimeWastingOperationsRule {
/** * @author Alexander Wert * */ @Rule(name = "RuleC") public class RuleC { @TagValue(type = "A") String input; @TagValue(type = "B") int input2; @Action(resultTag = "C") public int action() { return input2 + 2; } }
/** * @author Alexander Wert * */ @Rule(name = "RuleWithSessionVariable") public class RuleWithSessionVariable { @TagValue(injectionStrategy = TagValue.InjectionStrategy.BY_VALUE, type = Tags.ROOT_TAG) String input; @SessionVariable(name = "sessionVar") String sessionVar; @Action(resultTag = "A") public String action() { return input + sessionVar; } }
/** * @author Alexander Wert * */ @Rule(name = "RuleC") public class RuleC { @TagValue(type = "A") String input; @TagValue(type = "B") int input2; @Action(resultTag = "C") public int action() { return input2 + 2; } }
/** * @author Alexander Wert * */ @Rule(name = "RuleF") public class RuleF { @TagValue(type = "A") String input1; @TagValue(type = "E") String input2; @Condition public boolean condition() { return true; } @Action(resultTag = "F") public String action() { return input1 + input2; } }
/** * @author Alexander Wert * */ @Rule public class TestClass extends NoDefaultConstructorClass { @TagValue(type = "Test") public int par1 = 1; @TagValue(type = "Test") public int par2 = 2; /** * @param x */ public TestClass() { super(2); } @Action(resultTag = "Test2") public void actionA() { } @Action(resultTag = "Test2") private void actionB() { } }
@Rule(name = "AnnotatedRule", description = "Description", fireCondition = { "T1", "T2" }) public static class ValidAndAnnotated { @SessionVariable(name = "baseline") private int baseline; @SessionVariable(name = "baseline2", optional = true) private int baseline2; @TagValue(type = "T1", injectionStrategy = TagValue.InjectionStrategy.BY_TAG) public Tag t1AsTag; @TagValue(type = "T2", injectionStrategy = TagValue.InjectionStrategy.BY_VALUE) public String t2TagValue; @Condition(name = "myCondition", hint = "No way out") public boolean condition() { return false; } @Action(resultTag = "T2") public String action() { return "executed"; } }