Interface CustomizedWorkflowRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
- Type Parameters:
D- The possibly extended type of JpaWorkflow
- All Known Subinterfaces:
JpaWorkflowRepository<D>,WorkflowRepository<D>
- All Known Implementing Classes:
JpaCustomizedWorkflowRepository
public interface CustomizedWorkflowRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
Specialized persistence handling for
JpaWorkflow.-
Method Summary
Modifier and TypeMethodDescriptionvoidPoll the database for any workflows that fail activity timeout boundaries and mark those workflows asWorkflowStatus.FAILED.org.springframework.data.domain.Page<D>findAll(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve all matching the RSQL filters.voidprune()Poll the database for any workflows whose creation date is older than a configured threshold and delete those records from the database.intupdateStatus(String workflowId, WorkflowStatus previousStatus, WorkflowStatus newStatus) Apply a status transition in a database synchronized way.intupdateStatusWithToken(String workflowId, WorkflowStatus previousStatus, WorkflowStatus newStatus, String launchToken) Similar toupdateStatus(String, WorkflowStatus, WorkflowStatus), but also include an optional launch token value as part of the update.intupdateStepValues(String workflowId, String lastStepName, Long lastStepTimeout) Update the last step name and timeout values for a workflow.
-
Method Details
-
findAll
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAll(@Nullable cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve all matching the RSQL filters.- Parameters:
filters- RSQL filters. Special support here for theJpaWorkflow.getContextValues()collection. A special selector (`contextValue`) may be used to find workflows with specific value matches for context params. For example,status=='PROCESSING';contextValue=='jeff'would find all processing workflows with an exact context value match for the name jeff. See RSQL spec for different operators supported.page- Paging configurationcontextInfo- Data tracking context information- Returns:
- A page of matching data
-
updateStatus
@Policy(operationTypes=UPDATE) int updateStatus(String workflowId, WorkflowStatus previousStatus, WorkflowStatus newStatus) Apply a status transition in a database synchronized way. If multiple processes request this operation on the same workflow, only one will win.- Parameters:
workflowId- primary keypreviousStatus- The current known statusnewStatus- The desired target status- Returns:
> 0if the operation was successful
-
updateStatusWithToken
@Policy(operationTypes=UPDATE) int updateStatusWithToken(String workflowId, WorkflowStatus previousStatus, WorkflowStatus newStatus, @Nullable String launchToken) Similar toupdateStatus(String, WorkflowStatus, WorkflowStatus), but also include an optional launch token value as part of the update.- Parameters:
workflowId- primary keypreviousStatus- The current known statusnewStatus- The desired target statuslaunchToken- Optional launch token. SeeInformational.getLaunchToken().- Returns:
> 0if the operation was successful
-
updateStepValues
@Policy(operationTypes=UPDATE) int updateStepValues(String workflowId, @Nullable String lastStepName, @Nullable Long lastStepTimeout) Update the last step name and timeout values for a workflow.- Parameters:
workflowId- The primary key for the workflow to update.lastStepName- The name of the last step executed.lastStepTimeout- The timeout value for the last step executed.- Returns:
> 0if the operation was successful
-
failTimeouts
@Policy(operationTypes=UPDATE) void failTimeouts()Poll the database for any workflows that fail activity timeout boundaries and mark those workflows asWorkflowStatus.FAILED. -
prune
@Policy(operationTypes=UPDATE) void prune()Poll the database for any workflows whose creation date is older than a configured threshold and delete those records from the database.
-