public abstract class InstanceTrigger extends Object
The trigger must be declared under the element
xs:annotation/xs:appinfo
:
where<osd:trigger class="com.foo.MyDataSetTrigger" />
com.foo.MyDataSetTrigger
is
the fully qualified name of the class implementing this interface.
It is also possible to set additional JavaBean properties:
where<osd:trigger class="com.foo.MyDataSetTrigger"> <param1>...</param1> <param2>...</param2> </osd:trigger>
param1
and param2
are JavaBean properties of the specified class.
For more information, see the JavaBean specification.
setParam1(...)
and
setParam2(...)
);setup(TriggerSetupContext)
is called on the new instance.handle...
are called each time the associated operation is executed.
If several operations are defined for the same dataset, they are not executed in any particular order.
Dataset triggers are not invoked in the following contexts:
ProcedureContext.setTriggerActivation(false)
.
ProcedureContext.doMergeToParent(com.onwbp.adaptation.AdaptationHome)
).
ProcedureContext.doImportArchive(ArchiveImportSpec)
).
ProcedureContext.doCopy(com.onwbp.adaptation.Adaptation)
).
Constructor and Description |
---|
InstanceTrigger() |
Modifier and Type | Method and Description |
---|---|
void |
handleAfterCreate(AfterCreateInstanceContext aContext)
This method is called after the creation of a dataset.
|
void |
handleAfterDelete(AfterDeleteInstanceContext aContext)
This method is called after the deletion of a dataset.
|
void |
handleBeforeCreate(BeforeCreateInstanceContext aContext)
This method is called before the creation of a dataset.
|
void |
handleBeforeDelete(BeforeDeleteInstanceContext aContext)
This method is called before the deletion of a dataset.
|
abstract void |
setup(TriggerSetupContext aContext)
Checks and prepares this instance when the data model is loaded.
|
public abstract void setup(TriggerSetupContext aContext)
public void handleBeforeCreate(BeforeCreateInstanceContext aContext) throws OperationException
Default implementation does nothing.
OperationException
- when an exception occurs or to prevent the execution of the
subsequent creation (guard role).
Warning: in the case of a mass update, the whole transaction is aborted.public void handleAfterCreate(AfterCreateInstanceContext aContext) throws OperationException
Default implementation does nothing.
OperationException
- when an exception occurs.
Warning: in the case of a mass update the whole transaction is aborted.public void handleBeforeDelete(BeforeDeleteInstanceContext aContext) throws OperationException
Default implementation does nothing.
OperationException
- when an exception occurs or to prevent the execution of the
subsequent deletion (guard role).
Warning: in the case of a mass update the whole transaction is aborted.public void handleAfterDelete(AfterDeleteInstanceContext aContext) throws OperationException
Default implementation does nothing.
OperationException
- when an exception occurs.
Warning: in the case of a mass update the whole transaction is aborted.