public class ContainsOperator extends Object implements CustomOperator, FunctionTypeService
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 and Description |
---|
ContainsOperator() |
Modifier and Type | Method and Description |
---|---|
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.
|
public ContainsOperator()
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 operandpublic Function loadFunction(FunctionDefinition functionDefinition)
loadFunction
in interface FunctionTypeService
functionDefinition
- FunctionDefinition
to create the Function
from.Copyright © 2005–2016 The Kuali Foundation. All rights reserved.