public class LifecyclePolicyActionAdapter extends Object implements LifecyclePolicyAction
Modifier and Type | Field and Description |
---|---|
static String |
EVENT_BASED_PROPERTY
The name of the boolean property that indicates whether this action
supports event-based processing.
|
static String |
TIME_BASED_PROPERTY
The name of the boolean property that indicates whether this action
supports time-based processing.
|
Constructor and Description |
---|
LifecyclePolicyActionAdapter() |
Modifier and Type | Method and Description |
---|---|
LifecyclePolicyActionOutcome |
execute(LifecyclePolicyEntry lpe,
Document doc)
Execute the action for the specified document.
|
LifecyclePolicySearchCondition |
getSearchCondition(LifecyclePolicyEntry lpe)
Gets the search condition to be used to select documents eligible for
processing.
|
void |
initialize(LifecyclePolicyActionSpecification lpas)
Initialize this instance.
|
LifecyclePolicyActionOutcome |
notify(LifecyclePolicyEntry lpe,
Document doc)
Notify action that the specified document has advanced to the lifecycle
state as indicated by the specified LifecyclePolicyEntry.
|
public static final String TIME_BASED_PROPERTY
Used as the default way of determining the search condition. If the property is not specified, the corresponding setting defaults to true.
public static final String EVENT_BASED_PROPERTY
Used as the default way of determining whether or not the action
supports the notify
method. If the
property is not specified, the corresponding setting defaults to false.
public void initialize(LifecyclePolicyActionSpecification lpas) throws IfsException
Called immediately after construction (via the default constructor) and used so that the implementation can initialize session-independent state. Subsequent calls on this interface will often be called with a different session context than is specified in this method.
This instance may be used concurrently by multiple threads. Therefore if any state is sensitive to this, the implementer must properly synchronize.
initialize
in interface LifecyclePolicyAction
lpas
- the LifecyclePolicyActionSpecification that
references this actionIfsException
- if the operation failspublic LifecyclePolicySearchCondition getSearchCondition(LifecyclePolicyEntry lpe) throws IfsException
Implementation can return null, in which case the standard default
search condition will be used, namely:
where lifecycledate < ? and lifecyclepolicyentryid = ?
and lifecyclepolicy = ?
, where the date specified takes into
account the time period of the LifecyclePolicyEntry.
getSearchCondition
in interface LifecyclePolicyAction
lpe
- the entry that references the
LifecyclePolicyActionSpecification that indicates
this implementation of LifecyclePolicyActionIfsException
- if the operation failspublic LifecyclePolicyActionOutcome execute(LifecyclePolicyEntry lpe, Document doc) throws IfsException
The caller establishes a transaction context for the execution of this action. If the LifecyclePolicyActionOutcome indicates that the execution was successful, the transaction will be committed by the caller. Additionally, the LifecyclePolicyActionOutcome may indicate the nature of the updates performed on the document to indicate the new lifecycle state (if any) for the document. The standard behavior is to perform the following updates:
This implementation can decide not to execute the action based on custom logic, and indicates this by returning an appropriately constructed LifecyclePolicyActionOutcome. The caller will then abort the current transaction context. Similarly, if an exception is thrown, the caller will also abort the transaction, and log the exception information.
execute
in interface LifecyclePolicyAction
lpe
- the entry that references the
LifecyclePolicyActionSpecification that indicates
this implementation of LifecyclePolicyActiondoc
- the Document to processIfsException
- if the operation failspublic LifecyclePolicyActionOutcome notify(LifecyclePolicyEntry lpe, Document doc) throws IfsException
The caller indicates that the specified document will be updated to reflect the new state, as declared by the specified LifecyclePolicyEntry. The caller creates a transaction context before calling this method, and will perform the document lifecycle state update in this transaction.
The only way this implementation can affect the operation is by throwing an exception.
notify
in interface LifecyclePolicyAction
lpe
- the entry that references the
LifecyclePolicyActionSpecification that indicates
this implementation of LifecyclePolicyActiondoc
- the Document that is being updated to the state
indicated by the specified LifecyclePolicyEntryIfsException
- if the operation failsCopyright © 2023. All rights reserved.