* @param timeoutInSeconds the timeout in seconds
* @param eventDefinitionParameter the event definition parameter to instantiate the EventDefinition actor
*/
public static void callEventDefinitionActor(ActorRef eventDefinitionActor, String uniqueFlowNodeId, Message message, long timeoutInSeconds, EventDefinitionParameter eventDefinitionParameter) {
final Timeout eventDefinitionTimeout = new Timeout(Duration.create(timeoutInSeconds, "seconds"));
// create an akka future which holds the commit message (if any) of the eventDefinitionActor
Future<Object> future = Patterns.ask(eventDefinitionActor, message, eventDefinitionTimeout);
try {
// make a synchronous ('Await.result') request ('Patterns.ask') to the event definition actor
Await.result(future, eventDefinitionTimeout.duration());
} catch (java.util.concurrent.TimeoutException timeout) {
LOG.error(String.format("Unhandled timeout while processing %s at EventDefintition:%s. Timeout was set to %s",
message.getClass().getSimpleName(), eventDefinitionActor, eventDefinitionTimeout.duration()));
} catch (Exception e) {
e.printStackTrace();
}
}