Datastore 2.3.0 User Guide Save PDF Selected topic Selected topic and subtopics All content Implement a custom operation To implement a custom operation, you must: Create a custom operation Define an operation Define rules Execute the custom operation Create a custom operation To create a custom operation, you must: Implement ExecuteOperation. For information on ExecuteOperation function, see ExecuteOperation function. Register the custom operation in your application. Implement ExecuteOperation To implement ExecuteOperation, create a java class that implements the Java interface com.axway.ais.evproc.api.ExecuteOperation and implement the following function: Event execute(Event event, Map<String, Object> arguments); Example package operations; … public class MyCustomOperation implements ExecuteOperation { @Override public Event execute(Event event, Map<String, Object> arguments) { … // System.out.println("Execute operation"); return EventBuilder.create(event).build(); } } Register the operation To register the operation in your web application: Navigate to the installation directory. Add the operation Java class to the war/WEB-INF/classes directory Register the operation as a bean XML element in the war/ WEB_INF/classes/ file as shown in the following example: <bean id="myCustomOperation" class="operation. MyCustomOperation"/> Note Save the identifier; it will be used as function identifier in the Designer. Define an operation To define an operation in Designer: Load the predefined interaction configuration:In the Designer, click Load configurationSelect the Base for Flow Management configuration Create a new collection of type Library. Enter a name and release version and choose a service type In the new library, create a new function. Enter a name for the new function. You must use this name in your rule definition. See Define rules. Use the function type Execute Operation. Only a Java implementation is available for this type. Enter the registered identifier custom operation for Function Implementation Id. In our example use functionName myCustomFunction and myCustomOperation as Function Implementation Id Define a list of arguments for you function. Define rules After you define a function in the Designer, you must create a rule to execute the operation. To define the rule: Create a new rule Update the rule details:In Rule Type, select Interact.Input a flow identifier. For example, flowId.In Object Type, select an event that will trigger the rule. For example, a TimeEvent.In Libraries, select the library that contains the function created in Define an operationCall the operation in the Body of the rule:do myCustomFunction() Deploy the configuration into the Interaction application. Execute a custom operation After you configure the rule that calls you custom operation in the Designer, you must configure a listener for your component in Administration. For details on how to configure a listener, see Manage listeners. Related topics Send events from custom exits to Event Processor Object Types Functions Rules Default flow configuration files Flow configuration Related Links
Implement a custom operation To implement a custom operation, you must: Create a custom operation Define an operation Define rules Execute the custom operation Create a custom operation To create a custom operation, you must: Implement ExecuteOperation. For information on ExecuteOperation function, see ExecuteOperation function. Register the custom operation in your application. Implement ExecuteOperation To implement ExecuteOperation, create a java class that implements the Java interface com.axway.ais.evproc.api.ExecuteOperation and implement the following function: Event execute(Event event, Map<String, Object> arguments); Example package operations; … public class MyCustomOperation implements ExecuteOperation { @Override public Event execute(Event event, Map<String, Object> arguments) { … // System.out.println("Execute operation"); return EventBuilder.create(event).build(); } } Register the operation To register the operation in your web application: Navigate to the installation directory. Add the operation Java class to the war/WEB-INF/classes directory Register the operation as a bean XML element in the war/ WEB_INF/classes/ file as shown in the following example: <bean id="myCustomOperation" class="operation. MyCustomOperation"/> Note Save the identifier; it will be used as function identifier in the Designer. Define an operation To define an operation in Designer: Load the predefined interaction configuration:In the Designer, click Load configurationSelect the Base for Flow Management configuration Create a new collection of type Library. Enter a name and release version and choose a service type In the new library, create a new function. Enter a name for the new function. You must use this name in your rule definition. See Define rules. Use the function type Execute Operation. Only a Java implementation is available for this type. Enter the registered identifier custom operation for Function Implementation Id. In our example use functionName myCustomFunction and myCustomOperation as Function Implementation Id Define a list of arguments for you function. Define rules After you define a function in the Designer, you must create a rule to execute the operation. To define the rule: Create a new rule Update the rule details:In Rule Type, select Interact.Input a flow identifier. For example, flowId.In Object Type, select an event that will trigger the rule. For example, a TimeEvent.In Libraries, select the library that contains the function created in Define an operationCall the operation in the Body of the rule:do myCustomFunction() Deploy the configuration into the Interaction application. Execute a custom operation After you configure the rule that calls you custom operation in the Designer, you must configure a listener for your component in Administration. For details on how to configure a listener, see Manage listeners. Related topics Send events from custom exits to Event Processor Object Types Functions Rules Default flow configuration files Flow configuration