private Object newCancelFact(KieSession ksession, boolean cancel) { FactType type = ksession.getKieBase().getFactType("org.jboss.qa.brms.agendafilter", "CancelFact"); Object instance = null; try { instance = type.newInstance(); type.set(instance, "cancel", cancel); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } return instance; }
@PropertyReactive public static interface Intf1 { public int getC(); public void setC(int c); public int getD(); public void setD(int d); public int getF(); public void setF(int f); public String getId(); }
public static class Foo2 { @Position(0) public int x; public Foo2() { } public Foo2( int x ) { this.x = x; } public int getX() { return x; } public void setX( int x ) { this.x = x; } }
@Modifies("fullName") public void setLastName(final String lastName) { this.lastName = lastName; }
@PropertyReactive public static class Shuttle { private StopOrHub destination; public StopOrHub getDestination() { return destination; } public Shuttle setDestination(final StopOrHub destination) { this.destination = destination; return this; } }
private Object createDRLStock(final String name, final Double value) throws IllegalAccessException, InstantiationException { final FactType stockType = kbase.getFactType(DRL_PACKAGE_NAME, DRL_FACT_NAME); final Object stock = stockType.newInstance(); stockType.set(stock, "name", name); stockType.set(stock, "value", value); return stock; } }
public abstract class Person { @Position(0) private String name; public Person() { super(); //To change body of overridden methods use File | Settings | File Templates. } public Person(String name) { this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
@Modifies("fullName") public void setName(final String name) { this.name = name; }
@PropertyReactive public static class BusStop implements StopOrHub { private boolean visitedByCoach; @Override public boolean isVisitedByCoach() { return visitedByCoach; } public BusStop setVisitedByCoach(final boolean visitedByCoach) { this.visitedByCoach = visitedByCoach; return this; } }
@PropertyReactive public interface StopOrHub { boolean isVisitedByCoach(); }
@PropertyReactive public static interface Intf2 { public int getD(); public void setD(int d); public int getE(); public void setE(int e); public String getId(); }
@PropertyReactive public interface DummyBeanInterface { boolean isActive(); void setActive(boolean active); }
@PropertyReactive public static class MoveCommand { private int move; public int getMove() { return move; } public void setMove(int move) { this.move = move; } @Override public String toString() { return "MoveCommand{" + "move=" + move + '}'; } }
@PropertyReactive public static class Init { }
@PropertyReactive public static class DataSample { private Map<Parameter, Double> values = new EnumMap<>(Parameter.class); public Map<Parameter, Double> getValues() { return values; } public void setValues( Map<Parameter, Double> values ) { this.values = values; } @Modifies({"values", "notEmpty"}) public void addValue( Parameter p, double value ) { this.values.put( p, value ); } public boolean isNotEmpty() { return !this.values.isEmpty(); } }
@PropertyReactive public static class MyClass { private String value; private String data; public String getValue() { return value; } public void setValue(final String value) { this.value = value; } public String getData() { return data; } public void setData(final String data) { this.data = data; } }
@PropertyReactive public static class Cell { private int col; private int row; public boolean hidden; public int getCol() { return col; } public void setCol(int col) { this.col = col; } public int getRow() { return row; } public void setRow(int row) { this.row = row; } }