public class WorkflowTransitionHelper extends Object implements WorkflowTransitionService
Trackable
entity promotion and persisting state after.Modifier and Type | Field and Description |
---|---|
static String |
LOCK_CONCEPT_KEY |
Constructor and Description |
---|
WorkflowTransitionHelper(TrackableRepository<Trackable> repository,
WorkflowMapper mapper,
CommonCatalogService<Catalog> catalogService,
com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?> resourceLockRepository,
com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager,
WorkflowRequestCompletionNotifier completionNotifier,
com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService,
com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper) |
WorkflowTransitionHelper(TrackableRepository<Trackable> repository,
WorkflowMapper mapper,
com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?> resourceLockRepository,
com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager,
WorkflowRequestCompletionNotifier completionNotifier,
com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService,
com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyDeployment(WorkflowDeployRequest request,
Trackable target,
Trackable original)
Apply changes from an "original" entity to a target production entity (if any).
|
protected void |
applyPromotion(WorkflowPromoteRequest request,
Trackable target,
Trackable original)
Apply changes from an "original" entity to a target sandbox entity (if any).
|
protected void |
applyReject(WorkflowRejectRequest request,
Trackable target,
Trackable original)
Apply one or more changes related to a promotion from an "original" entity to a target user
sandbox entity (if any).
|
void |
deploy(WorkflowDeployRequest request)
Perform the deployment, moving the requested item forward to production state.
|
protected TempOverrideMapResponse |
evaluateForTemporaryOverride(WorkflowDeployRequest request,
Trackable target,
Trackable original)
In the case where a change was propagated after deployment via
VendorSandboxPropagationHandler , temporary override state for an application can be
created. |
protected boolean |
handleRecordFailure(TransitionRequest request,
Exception e)
Handle failure to find the target record for the transition
|
protected void |
handleTransitionFailure(TransitionRequest request,
Trackable original,
Exception e)
Handle failure of a transition request and notify the messaging system of the failure
|
protected void |
notifyOfCompletion(Trackable domain)
Inform the system via a message of type
WorkflowRequestCompletionProducer.TYPE that
transition processing is complete. |
protected void |
notifyOfPersistence(Trackable domain)
Inform the system via a message of type
PersistenceProducer.TYPE that an entity has
been persisted. |
void |
promote(WorkflowPromoteRequest request)
Perform the promotion, moving the requested item forward in the workflow
|
protected void |
propagate(Trackable deployed,
String parentCatalog,
boolean isDelete,
String propagationId)
Deprecated.
Only supports
DefaultPropagationHandler . Use
propagate(Trackable, String, OperationType, String) instead for full
propagation support. propagate(Trackable, String, OperationType, String)
usage requires broadleaf.sandbox.propagation.enabled property be set to
true. |
protected void |
propagate(Trackable deployed,
String parentCatalog,
OperationType changeType,
String propagationId)
Given a deployed catalog discriminated change, recurse through versions of the entity in
child catalogs and transfer the deployed changes using the process defined implementations of
PropagationHandler . |
void |
rebase(WorkflowRebaseRequest request)
Perform the rebase, bringing an original item up-to-date with missing changes from the target
that were created by another user.
|
void |
reject(WorkflowRejectRequest request)
Perform the reversal, move the requested changes backward in the workflow to the originating
author's user state.
|
void |
revert(WorkflowRevertRequest request)
Perform the reversal, archiving the user state sandbox entity.
|
protected void |
updateCompletionState(Trackable originalTrackable,
Tracking advancedTracking,
TransitionRequest transitionRequest,
boolean success,
Exception e)
Setup the initial
NotificationState on a Trackable entity in regard to the
sending status of the WorkflowRequestCompletionProducer.TYPE message for transition
completion. |
protected void |
updatePersistenceState(Trackable trackable)
Setup the initial
NotificationState on a Trackable entity in regard to the
sending status of the PersistenceProducer.TYPE message for a persistence event. |
WorkflowTransitionHelper |
withPropagationManager(PropagationManager propagationManager) |
WorkflowTransitionHelper |
withSingleIndexRequestMessageFactory(SingleIndexRequestMessageFactory factory) |
WorkflowTransitionHelper |
withTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) |
public static final String LOCK_CONCEPT_KEY
public WorkflowTransitionHelper(TrackableRepository<Trackable> repository, WorkflowMapper mapper, CommonCatalogService<Catalog> catalogService, com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?> resourceLockRepository, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, WorkflowRequestCompletionNotifier completionNotifier, com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper)
public WorkflowTransitionHelper(TrackableRepository<Trackable> repository, WorkflowMapper mapper, com.broadleafcommerce.common.messaging.repository.ResourceLockRepository<?,?> resourceLockRepository, com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager, WorkflowRequestCompletionNotifier completionNotifier, com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService, com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper helper)
public WorkflowTransitionHelper withSingleIndexRequestMessageFactory(SingleIndexRequestMessageFactory factory)
public WorkflowTransitionHelper withPropagationManager(PropagationManager propagationManager)
public WorkflowTransitionHelper withTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
@SuppressNotification(value="SINGLE_INDEX_REQUEST") public void promote(WorkflowPromoteRequest request)
WorkflowTransitionService
promote
in interface WorkflowTransitionService
request
- The request for a Trackable
entity promotionprotected void updatePersistenceState(Trackable trackable)
NotificationState
on a Trackable
entity in regard to the
sending status of the PersistenceProducer.TYPE
message for a persistence event.trackable
- Trackable
the entity which experienced a persistence eventprotected void notifyOfPersistence(Trackable domain)
PersistenceProducer.TYPE
that an entity has
been persisted.domain
- the entity that was persisted@SuppressNotification(value="SINGLE_INDEX_REQUEST") public void rebase(WorkflowRebaseRequest request)
WorkflowTransitionService
rebase
in interface WorkflowTransitionService
request
- Perform the rebase, bringing an original item up-to-date with missing changes@SuppressNotification(value="SINGLE_INDEX_REQUEST") public void deploy(WorkflowDeployRequest request)
WorkflowTransitionService
deploy
in interface WorkflowTransitionService
request
- The request for a Trackable
entity deployment@SuppressNotification(value="SINGLE_INDEX_REQUEST") public void reject(WorkflowRejectRequest request)
WorkflowTransitionService
reject
in interface WorkflowTransitionService
request
- The request for a Trackable
entity change rejection@SuppressNotification(value="SINGLE_INDEX_REQUEST") public void revert(WorkflowRevertRequest request)
WorkflowTransitionService
revert
in interface WorkflowTransitionService
request
- The request for a Trackable
entity change reversionprotected void notifyOfCompletion(Trackable domain)
WorkflowRequestCompletionProducer.TYPE
that
transition processing is complete.domain
- The entity that was transitionedprotected void updateCompletionState(Trackable originalTrackable, Tracking advancedTracking, TransitionRequest transitionRequest, boolean success, @Nullable Exception e)
Setup the initial NotificationState
on a Trackable
entity in regard to the
sending status of the WorkflowRequestCompletionProducer.TYPE
message for transition
completion.
NotificationState
s are ack'ed on the originalTracking
.
originalTrackable
- The original item that was promoted in. This receives
NotificationStatesadvancedTracking
- the most updated Tracking
available. In the case of a
promotion, this represents the promoted state. In the case of rebases, this is the
same as originalTracking
. Can be null if not available (like in a
revert)transitionRequest
- The initial request driving the transitionsuccess
- Whether or not the transition was successful (or failed with an error)e
- The exception that caused a failed transition, if applicableprotected void handleTransitionFailure(TransitionRequest request, Trackable original, Exception e)
request
- The transition requestoriginal
- The entity targeted for transitione
- The exception that occurred during the transitionprotected void applyReject(WorkflowRejectRequest request, Trackable target, Trackable original)
request
- The request for a Trackable
entity rejectiontarget
- any available pre-existing target stateoriginal
- The entity containing changes to rejectprotected void applyPromotion(WorkflowPromoteRequest request, Trackable target, Trackable original)
Will emit PersistenceProducer.TYPE
and WorkflowRequestCompletionProducer.TYPE
messages after performing changes.
request
- The request for a Trackable
entity promotiontarget
- any available pre-existing target stateoriginal
- The entity containing changes to promoteprotected void applyDeployment(WorkflowDeployRequest request, Trackable target, Trackable original)
Will emit PersistenceProducer.TYPE
and WorkflowRequestCompletionProducer.TYPE
messages after performing changes.
request
- The request for a Trackable
entity deploymenttarget
- any available pre-existing target stateoriginal
- The entity to deployprotected TempOverrideMapResponse evaluateForTemporaryOverride(WorkflowDeployRequest request, Trackable target, Trackable original)
VendorSandboxPropagationHandler
, temporary override state for an application can be
created. During subsequent deployment of that propagated application state, it is necessary
to cleanup any temporary state that was introduced by
VendorSandboxPropagationHandler
. This method checks the request (specifically,
WorkflowDeployRequest.isRemoveTemporaryOverride()
, and also evaluates entity state to
make a final determination via TempOverrideMapResponse
.request
- The deployment requesttarget
- The state receiving deployment, if applicableoriginal
- The state being transitioned from earlier promoted statusprotected void propagate(Trackable deployed, String parentCatalog, OperationType changeType, String propagationId)
PropagationHandler
. PropagationHandler
instances are registered with Spring
and ordered. The first instance capable of handling is used and others are ignored. This
process is controlled by the PropagationManager
.deployed
- The deployed item containing changes to propagateparentCatalog
- The catalog whose children will be checked for propagation itemschangeType
- The type of operation to be propagated (CREATE,UPDATE,DELETE)propagationId
- An id that identifies changes as part of this propagation. See
ChangeDetail.getPropagationId()
.@Deprecated protected void propagate(Trackable deployed, String parentCatalog, boolean isDelete, String propagationId)
DefaultPropagationHandler
. Use
propagate(Trackable, String, OperationType, String)
instead for full
propagation support. propagate(Trackable, String, OperationType, String)
usage requires broadleaf.sandbox.propagation.enabled
property be set to
true.WorkflowMapper.propagateMap(Trackable, Trackable, boolean, String)
.deployed
- The deployed item containing changes to propagateparentCatalog
- The catalog whose children will be checked for propagation itemsisDelete
- Whether or not the change is a deletionpropagationId
- An id that identifies changes as part of this propagation. See
ChangeDetail.getPropagationId()
.protected boolean handleRecordFailure(TransitionRequest request, Exception e)
request
- The transition requeste
- The exception that occurred during the fetchCopyright © 2021. All rights reserved.