Simulation
- java.lang.Object
-
- com.fico.xpress.simulation.Simulation
-
@EnableCaching @SpringBootApplication public class Simulation extends Object
Main entry point of the Simulation Service Spring Boot application. This singleton object can be used to execute plugins.
-
-
Method Summary
Modifier and Type Method Description static Stringexecute(String payload, String type, String resource)Static function API for MosJvm: Invoke a synchronous call to the rule execution server with the given string payload and get the response string upon success.static Future<String>executeAsync(String payload, String type, String resource)Static function API for MosJvm: Invoke an asynchronous call to the rule execution server with the given string payload and get a Future object as response.static StringextractResponse(Future<String> future)Static function API for MosJvm: Extract the response from a future object.static StringgetServices()List the registered pluginsstatic StringgetStatus()Static function API for MosJvm: Get a status string that represents the current state of the JVM and rule service.static StringgetVersion()Return the version.static voidmain(String[] args)Start spring application if it has not been started yet.static voidshutdown()Static function API for MosJvm: Shut down spring application if it has not been closed already.
-
-
-
Method Detail
-
main
public static void main(String[] args) throws Exception
Start spring application if it has not been started yet. Options:- noWeb disable web service.
- Parameters:
-
args- Options. Argument cannot be null because the `SprintApplication.run` function call expects args not to be null... -D - Throws:
-
Exception- Exceptions
-
getServices
public static String getServices()
List the registered plugins- Returns:
- A comma separate list of class names
-
getStatus
@Unstable public static String getStatus()
Static function API for MosJvm: Get a status string that represents the current state of the JVM and rule service.- Returns:
- A status string.
-
getVersion
public static String getVersion()
Return the version. The version is returned from the property `build.version`.- Returns:
- The version of the library.
-
executeAsync
public static Future<String> executeAsync(String payload, String type, String resource) throws SimulationException
Static function API for MosJvm: Invoke an asynchronous call to the rule execution server with the given string payload and get a Future object as response. Use `extractResponse` to extract the actual response.- Parameters:
-
payload- The input data format ("xml", "json", ...) -
type- The plugin type ("HealthCheck", "Blaze", ...) -
resource- The resource that is loaded into the plugin (filename, JSON configuration, ...) - Returns:
- Future object representing the output
- Throws:
-
SimulationException- Exception are thrown by the actual services
-
execute
public static String execute(String payload, String type, String resource) throws SimulationException
Static function API for MosJvm: Invoke a synchronous call to the rule execution server with the given string payload and get the response string upon success.- Parameters:
-
payload- The loan application data (XML, JSON, ...) -
type- The type of execution engine ("HealthCheck", "Blaze", ...) -
resource- The resource to execute (ADB file, workspace file, ...) - Returns:
- Rule server response (i.e., processed loan application XML string).
- Throws:
-
SimulationException- Exceptions are thrown by the actual services
-
extractResponse
public static String extractResponse(Future<String> future)
Static function API for MosJvm: Extract the response from a future object.- Parameters:
-
future- The future object used in the asynchronous rule execution. - Returns:
- Rule server response (i.e., processed loan application XML string).
-
shutdown
public static void shutdown()
Static function API for MosJvm: Shut down spring application if it has not been closed already. This method will clear all resources that were allocated by the spring application. After the call to this method it is no longer possible to use any of the method of the RuleServiceApplication, even the "init" or "main" method will lead to unpredictable behavior.
-
-
© 2001-2023 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.
