Skip navigation links
oracle.iam.platform.kernel.spi
Interface PreProcessHandler
- All Superinterfaces:
- oracle.iam.platform.kernel.spi.Cancellable, oracle.iam.platform.kernel.spi.Compensable, oracle.iam.platform.kernel.spi.EventHandler
-
public interface PreProcessHandler
- extends oracle.iam.platform.kernel.spi.EventHandler, oracle.iam.platform.kernel.spi.Compensable, oracle.iam.platform.kernel.spi.Cancellable
Pre Process
- Pre-process event handlers can be both synchronous and asynchronous.
- If a pre-process event cannot be executed, or pre-process event handler throws an exception, process is in "Failed" state.
- If the event handler is executed in synchronous mode, it must return an event result, if the event handler is executed in asynchronous mode, it must return null. If the event handler returns in other combination, we move the process to "Failed" state.
- When a process is in "Failed" state, the failed event handlers registered for the preprocess event will be executed. If no failed event handlers are provided, process will remain in failed until handleFailed is called.
- Pre-process event handler can return an Event Result that can perform the following:
- Set the veto Flag to indicate, the action cannot be performed and move the process to "Veto Stage".
- Set the restart flag to true, to cancel the current process, and start a new orchestration process. The new orchestration to be started will be identified in the event result. Current process moves to "Finalization stage", after the new orchestration is completed.
- Return a List of "immediate" Orchestrations to be performed before proceeding to the next event handler.
- Return a List of "deferred" Orchestrations to be performed if the entire change goes through normally.
- Return an event result that instructs none of this, and set the veto to false, and restart to false. (Indicates nothing to be done by the orchestration engine.)
- If there are no pre-process events to be performed, process is moved to "Action Stage".
- Process can be moved to "Cancelled Stage" by calling cancel.
- Event handlers will be notified by calling cancel, if the process is cancelled, and the event handler is currently in execution.
- Event handlers can implement compensate, to compensate for changes if the orchestration didn't go through.
- Once the process moves to a different stage, the rest of the event handlers in this stage are not executed.
Example event handler declaration :
<action-handler orch-target="oracle.iam.platform.kernel.vo.SampleOrchestrationTarget"
class="oracle.iam.platform.kernel.test.SamplePreProcessHandler" entity-type="oracle.iam.platform.kernel.impl.Address"
operation="X" name="samplePreprocess" order="FIRST" stage="preprocess" sync="FALSE" />
Method Summary |
boolean |
cancel(long processId, long eventId, AbstractGenericOrchestration orchestration)
Method containing the logic that need to be executed if the orchestration is cancelled. |
BulkEventResult |
execute(long processId, long eventId, BulkOrchestration orchestration)
Method containing the actual implementation of this pre process event handler for bulk orchestration |
EventResult |
execute(long processId, long eventId, Orchestration orchestration)
Method containing the actual implementation of this pre-process event handler |
Methods inherited from interface oracle.iam.platform.kernel.spi.EventHandler |
initialize |
Methods inherited from interface oracle.iam.platform.kernel.spi.Compensable |
compensate |
execute
EventResult execute(long processId,
long eventId,
Orchestration orchestration)
- Method containing the actual implementation of this pre-process event handler
-
- Parameters:
processId,
- Id of the orchestration process
eventId,
- Id of the orchestartion event
orchestration,
- Value object containing information such as orchestartion parameters, operation.
- Returns:
- Outcome of the event handler. If the event handler is defined to execute in a synchronous mode, it must return a result. If it is defined execute in asynchronous mode, it must return null.
execute
BulkEventResult execute(long processId,
long eventId,
BulkOrchestration orchestration)
- Method containing the actual implementation of this pre process event handler for bulk orchestration
-
- Parameters:
processId,
- Id of the orchestration process
eventId,
- Id of the orchestartion event
orchestration,
- Value object containing information such as orchestartion parameters, operation.
- Returns:
- Outcome of the event handler. If the event handler is defined to execute in a synchronous mode, it must return a result. If it is defined execute in asynchronous mode, it must return null.
cancel
boolean cancel(long processId,
long eventId,
AbstractGenericOrchestration orchestration)
- Method containing the logic that need to be executed if the orchestration is cancelled. This would be called only for asynchronous actions.
-
- Specified by:
cancel
in interface oracle.iam.platform.kernel.spi.Cancellable
-
- Parameters:
processId,
- Id of the orchestration process
eventId,
- Id of the orchestartion event
orchestration,
- Value object containing information such as orchestartion parameters, operation.
Skip navigation links
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.