public class RawDataRuleServiceFactory
extends java.lang.Object
RawDataRuleServiceFactory represent a factory class to create
RawDataRuleService.
The following code show how to execute rules using COBOL raw data.
public IlrSessionResponse executeRulesOnCobolRawData(byte[] user, byte[] cart) throws RawDataRuleExecutionException, IlrSessionException {
RawDataRuleServiceFactory factory = new RawDataRuleServiceFactory();
RawDataRuleService service = factory.createService(RawDataRuleServiceFactory.COBOL_DATA);
IlrPath path = IlrPath.parsePath(rulesetPath);
List<RawDataRulesetParameter> params = new ArrayList<RawDataRulesetParameter>();
RawDataRulesetParameter customer = new RawDataRulesetParameter("customer", user);
params.add(customer);
RawDataRulesetParameter shoppingCart = new RawDataRulesetParameter("shoppingCart", cart);
params.add(shoppingCart);
return service.execute(path, params);
}
| Modifier and Type | Field and Description |
|---|---|
static int |
COBOL_DATA
For COBOL data support
|
static int |
PLI_DATA
For PL/I data support
|
| Constructor and Description |
|---|
RawDataRuleServiceFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stop the XU.
|
RawDataRuleService |
createService(int type)
Return a raw data rule service using J2SE session factory.
|
RawDataRuleService |
createService(int type,
IlrSessionFactory factory)
Return a raw data rule service using provided session factory.
|
void |
unregister(RawDataRuleService service,
IlrSessionFactory factory)
Declare the RawDataRuleService does not use the IlrSessionFactory anymore.
|
public static final int COBOL_DATA
public static final int PLI_DATA
public RawDataRuleService createService(int type) throws IlrSessionCreationException
IlrSessionCreationException - if an error occurred when trying to create a rule session using the default J2SE
session factory.type - the service type, should be one of:
public RawDataRuleService createService(int type, IlrSessionFactory factory)
type - the service type, should be one of:
factory - rule session factorypublic void unregister(RawDataRuleService service, IlrSessionFactory factory)
service - RawDataRuleService to be unregisteredfactory - rule session factorypublic void close()
© Copyright IBM Corp. 1987, 2017