When you configure the Rule Execution Server environment
on a domain with multiple servers, you can define which Rule Execution Server instances
are used to execute rule tests.
Before you begin
- Package all your executable object models (XOMs) into the ssp.war archive.
For more information, see Making the XOM accessible by repackaging
the SSP.
- Make sure that the archive is deployed on each server along with
a XU connection factory and the appropriate data source definition.
About this task
You create a custom resolver to define which
Rule Execution Server instances
are used to run rule tests.
Procedure
- Implement the IlrSSPResolver interface.
For a simple implementation, you can use the server name
to return a specific server URL. For example, you can have two servers
that are defined in
Decision
Center:
- testingServer1: http://host1:9080/res
- testingServer2: http://host1:9080/res
And your resolver can evaluate the
testing URL as follows: if ( serverName.equals("testingServer1") )
{
return ( new URL( "http://server1:9080/testing" ) );
}
else if ( serverName.equals("testingServer2") )
{
return ( new URL( "http://server2:9080/testing" );
}
else
return( new URL( "http://host1:9080/testing" ));
- Add your class to the teamserver.war archive.
- Set the teamserver.defaultSSPResolver.class property
to that class.
Results
When you run a rule test, the execution is directed by the
server that you choose.
What to do next
For a better implementation, you can set a dependency on
the project that is being tested so that you can distribute the test
execution according to that project.
ManagerBean bean = ManagerBean.getInstance() ;
IlrSession session = bean.getSession();
IlrRuleProject project = session.getWorkingBaseline().getProject();
String pname = project.getName();