public static class MultipleActionMethodsDefined { @TagValue(type = "T1", injectionStrategy = TagValue.InjectionStrategy.BY_TAG) public Tag t; @Action(resultTag = "T1") public String execute() { return "executed"; } @Action(resultTag = "T2") public String execut2() { return "executed"; } }
public static class NoActionMethodDefined { @TagValue(type = "T1", injectionStrategy = TagValue.InjectionStrategy.BY_TAG) public Tag t; }
/** * @author Alexander Wert * */ public class NoDefaultConstructorClass { @TagValue(type = "Test") public int par3 = 1; @TagValue(type = "Test") protected int par4 = 2; /** * */ public NoDefaultConstructorClass(int x) { par3 = x; } @Action(resultTag = "Test2") public void actionC() { } @Action(resultTag = "Test2") private void actionD() { } }
public static class MissingAnnotation { @TagValue(type = "root", injectionStrategy = TagValue.InjectionStrategy.BY_TAG) private Tag rootTag; @TagValue(type = "T1") private String t1Value; @SessionVariable(name = "baseline", optional = false) private int baseline; @Action(resultTag = "T2") public String execute() { return "executed"; } }
/** * @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 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() { } }
/** * @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 = "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"; } }
/** * @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; } }