public RuleFlowProcess getProcess() { return getRuleFlowProcess(); } }
public RuleFlowProcessFactory global(String name, String type) { Map<String, String> globals = getRuleFlowProcess().getGlobals(); if (globals == null) { globals = new HashMap<String, String>(); getRuleFlowProcess().setGlobals(globals); } globals.put(name, type); return this; }
public RuleFlowProcessFactory name(String name) { getRuleFlowProcess().setName(name); return this; }
public RuleFlowProcessFactory version(String version) { getRuleFlowProcess().setVersion(version); return this; }
public RuleFlowProcessFactory imports(String... imports) { getRuleFlowProcess().setImports(new HashSet<String>(Arrays.asList(imports))); return this; }
public RuleFlowProcessFactory functionImports(String... functionImports) { getRuleFlowProcess().setFunctionImports(Arrays.asList(functionImports)); return this; }
public RuleFlowProcessFactory globals(Map<String, String> globals) { getRuleFlowProcess().setGlobals(globals); return this; }
public RuleFlowProcessFactory packageName(String packageName) { getRuleFlowProcess().setPackageName(packageName); return this; }
public RuleFlowProcessFactory dynamic(boolean dynamic) { getRuleFlowProcess().setDynamic(dynamic); return this; }
public RuleFlowProcessFactory validate() { ProcessValidationError[] errors = RuleFlowProcessValidator.getInstance().validateProcess(getRuleFlowProcess()); for (ProcessValidationError error : errors) { logger.error(error.toString()); } if (errors.length > 0) { throw new RuntimeException("Process could not be validated !"); } return this; }
public RuleFlowProcessFactory exceptionHandler(String exception, ExceptionHandler exceptionHandler) { getRuleFlowProcess().getExceptionScope().setExceptionHandler(exception, exceptionHandler); return this; }
public RuleFlowProcessFactory swimlane(String name) { Swimlane swimlane = new Swimlane(); swimlane.setName(name); getRuleFlowProcess().getSwimlaneContext().addSwimlane(swimlane); return this; }
public RuleFlowProcessFactory variable(String name, DataType type, Object value, String metaDataName, Object metaDataValue) { Variable variable = new Variable(); variable.setName(name); variable.setType(type); variable.setValue(value); if (metaDataName != null && metaDataValue != null) { variable.setMetaData(metaDataName, metaDataValue); } getRuleFlowProcess().getVariableScope().getVariables().add(variable); return this; }
public RuleFlowProcessFactory dynamic(boolean dynamic) { getRuleFlowProcess().setDynamic(dynamic); return this; }
public RuleFlowProcessFactory functionImports(String... functionImports) { getRuleFlowProcess().setFunctionImports(Arrays.asList(functionImports)); return this; }
public RuleFlowProcessFactory global(String name, String type) { Map<String, String> globals = getRuleFlowProcess().getGlobals(); if (globals == null) { globals = new HashMap<String, String>(); getRuleFlowProcess().setGlobals(globals); } globals.put(name, type); return this; }
public RuleFlowProcessFactory version(String version) { getRuleFlowProcess().setVersion(version); return this; }
public RuleFlowProcessFactory validate() { ProcessValidationError[] errors = RuleFlowProcessValidator.getInstance().validateProcess(getRuleFlowProcess()); for (ProcessValidationError error : errors) { logger.error(error.toString()); } if (errors.length > 0) { throw new RuntimeException("Process could not be validated !"); } return this; }
public RuleFlowProcessFactory swimlane(String name) { Swimlane swimlane = new Swimlane(); swimlane.setName(name); getRuleFlowProcess().getSwimlaneContext().addSwimlane(swimlane); return this; }
public RuleFlowProcessFactory variable(String name, DataType type, Object value, String metaDataName, Object metaDataValue) { Variable variable = new Variable(); variable.setName(name); variable.setType(type); variable.setValue(value); if (metaDataName != null && metaDataValue != null) { variable.setMetaData(metaDataName, metaDataValue); } getRuleFlowProcess().getVariableScope().getVariables().add(variable); return this; }