Class RejectionWorkflowRequestErrorHandler
java.lang.Object
com.broadleafcommerce.sandbox.messaging.completion.error.RejectionWorkflowRequestErrorHandler
- All Implemented Interfaces:
WorkflowRequestErrorHandler
public class RejectionWorkflowRequestErrorHandler
extends Object
implements WorkflowRequestErrorHandler
- Author:
- Chad Harchar (charchar)
-
Constructor Summary
ConstructorsConstructorDescriptionRejectionWorkflowRequestErrorHandler
(ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryGroupService<ChangeSummaryGroup> groupService) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandle
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Determines if this handler can handle the givenWorkflowRequestCompletion
.protected ChangeSummaryGroupService<ChangeSummaryGroup>
protected ChangeSummaryService<ChangeSummary>
void
handle
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String groupId) Records errors reported by theWorkflowRequestCompletion
that occurred while a microservice attempted to perform a rejection of aChangeSummaryGroup
or one of itsChangeSummaries
and updates the group's and summary's statuses asChangeStatusType.ERROR_REJECT
protected void
recordGroupRejectionError
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String groupId) Records the exception encountered for a failed rejection onto theChangeSummaryGroup
indicated by theWorkflowRequestCompletion
and updates its status toChangeStatusType.ERROR_REJECT
.protected void
recordSummaryRejectionError
(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Records the exception encountered for a failed rejection onto theChangeSummary
indicated by theWorkflowRequestCompletion
and updates its status toChangeStatusType.ERROR_REJECT
.
-
Constructor Details
-
RejectionWorkflowRequestErrorHandler
public RejectionWorkflowRequestErrorHandler(ChangeSummaryService<ChangeSummary> summaryService, ChangeSummaryGroupService<ChangeSummaryGroup> groupService)
-
-
Method Details
-
canHandle
public boolean canHandle(@NonNull com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Description copied from interface:WorkflowRequestErrorHandler
Determines if this handler can handle the givenWorkflowRequestCompletion
. This is typically done by checking theWorkflowRequestCompletion.getRequestType()
.- Specified by:
canHandle
in interfaceWorkflowRequestErrorHandler
- Parameters:
completion
- aWorkflowRequestCompletion
received over theWorkflowRequestCompletionConsumer channel
or manually fromTransitionErrorEndpoint
- Returns:
- whether this handler can handle errors for the given
WorkflowRequestCompletion
-
handle
public void handle(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String groupId) Records errors reported by theWorkflowRequestCompletion
that occurred while a microservice attempted to perform a rejection of aChangeSummaryGroup
or one of itsChangeSummaries
and updates the group's and summary's statuses asChangeStatusType.ERROR_REJECT
- Specified by:
handle
in interfaceWorkflowRequestErrorHandler
- Parameters:
completion
- TheWorkflowRequestCompletion
indicating the group and summary that encountered errors while being rejectedgroupId
- The ID of the group gleaned from the completion message- Throws:
IllegalStateException
- Thrown if the summary's ID is missing from theWorkflowRequestCompletion.getTransferTypeIdMap()
.QualifiedStateException
- Thrown if either the group or summary encounters errors while being updated.
-
recordSummaryRejectionError
protected void recordSummaryRejectionError(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion) Records the exception encountered for a failed rejection onto theChangeSummary
indicated by theWorkflowRequestCompletion
and updates its status toChangeStatusType.ERROR_REJECT
.- Parameters:
completion
- TheWorkflowRequestCompletion
indicating the summary that encountered errors while being rejected- Throws:
QualifiedStateException
- Thrown if the summary encounters errors while being updated.
-
recordGroupRejectionError
protected void recordGroupRejectionError(com.broadleafcommerce.data.tracking.core.transition.WorkflowRequestCompletion completion, String groupId) Records the exception encountered for a failed rejection onto theChangeSummaryGroup
indicated by theWorkflowRequestCompletion
and updates its status toChangeStatusType.ERROR_REJECT
.- Parameters:
completion
- TheWorkflowRequestCompletion
indicating the group that encountered errors while being rejected- Throws:
QualifiedStateException
- Thrown if the group encounters errors while being updated.
-
getSummaryService
-
getGroupService
-