Datastore 2.3.0 User Guide Save PDF Selected topic Selected topic and subtopics All content Send events from custom exits to Event Processor A custom exit can send an event to Event Processor to start an interaction. The following is an example of a custom action exit: public class StartInteractionAction implements ExecuteActionExit { @Autowired @Qualifier(EventProcessor.IMPLEMENTATION_ID) protected EventProcessor eventProcessor; @Override public ExecuteActionResult execute(Object currentEditedObject, List<Object> selectedObjects, SourceDatabaseExternal sourceDatabaseExternal, Map<String, Object> functionArguments) throws Exception { ExecuteActionResult result = new ExecuteActionResult(); result.setMessage("Interaction started"); // This will create an event object: Event event = EventBuilder.create() .setType("InteractionStart") .setHeader("collectionId", (BusinessCollection)currentEditedObject).getId()) .build(); // This will pass the event object to the Event Processor: eventProcessor.dispatch(event); return result; } } Related topics Implement a custom operation Object Types Functions Rules Default flow configuration files Flow configuration Related Links
Send events from custom exits to Event Processor A custom exit can send an event to Event Processor to start an interaction. The following is an example of a custom action exit: public class StartInteractionAction implements ExecuteActionExit { @Autowired @Qualifier(EventProcessor.IMPLEMENTATION_ID) protected EventProcessor eventProcessor; @Override public ExecuteActionResult execute(Object currentEditedObject, List<Object> selectedObjects, SourceDatabaseExternal sourceDatabaseExternal, Map<String, Object> functionArguments) throws Exception { ExecuteActionResult result = new ExecuteActionResult(); result.setMessage("Interaction started"); // This will create an event object: Event event = EventBuilder.create() .setType("InteractionStart") .setHeader("collectionId", (BusinessCollection)currentEditedObject).getId()) .build(); // This will pass the event object to the Event Processor: eventProcessor.dispatch(event); return result; } } Related topics Implement a custom operation Object Types Functions Rules Default flow configuration files Flow configuration