|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sampleu.krms.impl.ContainsOperator
public class ContainsOperator
An example CustomOperator to demonstrate this functionality in of the KRMS UI and engine.
This one also does the FunctionTypeService duties to produce the engine executable, though that responsibility could be extracted to a separate class if desired, though that would require more wiring and database configuration.
This implementation cheats a bit for easy configuration by persisting the FunctionDefinition on first access. The only prerequisite configuration to use it: 1) add a KRMS type with namespace "KR-SAP", name "contains operator", and the serviceName "sampleAppContainsOperatorService". 2) add a type relation of type 'A' (usage allowed) from your KRMS type to the context type you want to use it with.
This service implementation is wired up in Spring and exported to the service bus.
Constructor Summary | |
---|---|
ContainsOperator()
|
Method Summary | |
---|---|
FunctionDefinition |
getOperatorFunctionDefinition()
Returns the FunctionDefinition for the custom function the executable portion of this CustomOperator will call. |
Function |
loadFunction(FunctionDefinition functionDefinition)
Loads the Function object that the KRMS engine can execute during rule evaluation |
List<RemotableAttributeError> |
validateOperandClasses(String lhsClassName,
String rhsClassName)
Validate the argument types. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContainsOperator()
Method Detail |
---|
public FunctionDefinition getOperatorFunctionDefinition()
If the FunctionDefinition hasn't been persisted yet, this method will persist it and then return it.
Note that having the KRMS type for this
getOperatorFunctionDefinition
in interface CustomOperator
public List<RemotableAttributeError> validateOperandClasses(String lhsClassName, String rhsClassName)
validateOperandClasses
in interface CustomOperator
lhsClassName
- the class name for the left hand side operandrhsClassName
- the class name for the right hand side operand
public Function loadFunction(FunctionDefinition functionDefinition)
loadFunction
in interface FunctionTypeService
functionDefinition
- FunctionDefinition
to create the Function
from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |