Runtime components : Service components : Rule provider services : Extending the Java code rule provider service
  
Extending the Java code rule provider service
UNICOM® Digital Transformation Toolkit (UDTT™) provides an abstract service class--- JavaCodeRuleProviderService, and you can extend it for Remote ILog Service and Java Local Rule Service.
For Java Local Rule Service, you just need implement the abstract method checkRule() to do the rule judgment.
public class UserTransferRuleProviderExample extends JavaCodeRuleProviderService {
public Map<String, Object> checkRule(Map<String, Object> params) {
System.out.println("#######UserTransferRuleProviderExample checkRule for ruleID="+this.getRuleID());

if(getRuleID().equalsIgnoreCase("checkLimit")){
Double amount = (Double) params.get("amount");
Double limit = (Double) params.get("limit");

if(amount<=limit)
params.put("approve", new Boolean(true));
}
return null;
}
}
For Remote ILog Service, you need to implement the invoker process to the remote ILog server in checkRule() method.
Note When you connect to ILog server in J2EE module, you need to configure a resource-ref in Web project as following:
This graphic is described in the surrounding text.
See also
Rule provider services