ilog.rules.res.session.rawdata
Class RawDataRuleServiceFactory
- java.lang.Object
-
- ilog.rules.res.session.rawdata.RawDataRuleServiceFactory
-
public class RawDataRuleServiceFactory extends java.lang.Object
RawDataRuleServiceFactory
represent a factory class to createRawDataRuleService
.Code example:
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); }
-
-
Field Summary
Fields Modifier and Type Field and Description static int
COBOL_DATA
For COBOL data supportstatic int
PLI_DATA
For PL/I data support
-
Constructor Summary
Constructors Constructor and Description RawDataRuleServiceFactory()
-
Method Summary
Methods 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.
-
-
-
Field Detail
-
COBOL_DATA
public static final int COBOL_DATA
For COBOL data support- See Also:
- Constant Field Values
-
PLI_DATA
public static final int PLI_DATA
For PL/I data support- See Also:
- Constant Field Values
-
-
Method Detail
-
createService
public RawDataRuleService createService(int type) throws IlrSessionCreationException
Return a raw data rule service using J2SE session factory.- Throws:
IlrSessionCreationException
- if an error occurred when trying to create a rule session using the default J2SE session factory.- Parameters:
type
- the service type, should be one of:- Returns:
- A new raw data rule service using J2SE session factory.
-
createService
public RawDataRuleService createService(int type, IlrSessionFactory factory)
Return a raw data rule service using provided session factory.- Parameters:
type
- the service type, should be one of:factory
- rule session factory- Returns:
- A new raw data rule service using provided session factory.
-
unregister
public void unregister(RawDataRuleService service, IlrSessionFactory factory)
Declare the RawDataRuleService does not use the IlrSessionFactory anymore.- Parameters:
service
- RawDataRuleService to be unregisteredfactory
- rule session factory
-
close
public void close()
Stop the XU.
-
-