Class JpaCustomizedWorkflowRepository<D extends JpaWorkflow>
java.lang.Object
com.broadleafcommerce.workflow.provider.jpa.repository.JpaCustomizedWorkflowRepository<D>
- Type Parameters:
D
- The possibly extended type ofJpaWorkflow
- All Implemented Interfaces:
CustomizedWorkflowRepository<D>
,org.springframework.beans.factory.InitializingBean
public class JpaCustomizedWorkflowRepository<D extends JpaWorkflow>
extends Object
implements CustomizedWorkflowRepository<D>, org.springframework.beans.factory.InitializingBean
-
Constructor Summary
ConstructorsConstructorDescriptionJpaCustomizedWorkflowRepository
(cz.jirutka.rsql.parser.ast.RSQLVisitor<jakarta.persistence.criteria.Predicate, Class<?>> rsqlVisitor, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, org.springframework.transaction.support.TransactionTemplate transactionTemplate, com.broadleafcommerce.data.tracking.core.BasicAuditUtility auditUtility, ExecutionProperties executionProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
protected void
void
Poll 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.void
prune()
Poll the database for any workflows whose creation date is older than a configured threshold and delete those records from the database.void
setRepository
(JpaWorkflowRepository<D> repository) int
updateStatus
(String workflowId, WorkflowStatus previousStatus, WorkflowStatus newStatus) Apply a status transition in a database synchronized way.int
updateStatusWithToken
(String workflowId, WorkflowStatus previousStatus, WorkflowStatus newStatus, String launchToken) Similar toCustomizedWorkflowRepository.updateStatus(String, WorkflowStatus, WorkflowStatus)
, but also include an optional launch token value as part of the update.
-
Constructor Details
-
JpaCustomizedWorkflowRepository
public JpaCustomizedWorkflowRepository(cz.jirutka.rsql.parser.ast.RSQLVisitor<jakarta.persistence.criteria.Predicate, Class<?>> rsqlVisitor, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder criteriaBuilder, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, org.springframework.transaction.support.TransactionTemplate transactionTemplate, com.broadleafcommerce.data.tracking.core.BasicAuditUtility auditUtility, ExecutionProperties executionProperties)
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
failTimeouts
public void failTimeouts()Description copied from interface:CustomizedWorkflowRepository
Poll the database for any workflows that fail activity timeout boundaries and mark those workflows asWorkflowStatus.FAILED
.- Specified by:
failTimeouts
in interfaceCustomizedWorkflowRepository<D extends JpaWorkflow>
-
prune
public void prune()Description copied from interface:CustomizedWorkflowRepository
Poll the database for any workflows whose creation date is older than a configured threshold and delete those records from the database.- Specified by:
prune
in interfaceCustomizedWorkflowRepository<D extends JpaWorkflow>
-
updateStatus
Description copied from interface:CustomizedWorkflowRepository
Apply a status transition in a database synchronized way. If multiple processes request this operation on the same workflow, only one will win.- Specified by:
updateStatus
in interfaceCustomizedWorkflowRepository<D extends JpaWorkflow>
- Parameters:
workflowId
- primary keypreviousStatus
- The current known statusnewStatus
- The desired target status- Returns:
> 0
if the operation was successful
-
updateStatusWithToken
public int updateStatusWithToken(String workflowId, WorkflowStatus previousStatus, WorkflowStatus newStatus, @Nullable String launchToken) Description copied from interface:CustomizedWorkflowRepository
Similar toCustomizedWorkflowRepository.updateStatus(String, WorkflowStatus, WorkflowStatus)
, but also include an optional launch token value as part of the update.- Specified by:
updateStatusWithToken
in interfaceCustomizedWorkflowRepository<D extends JpaWorkflow>
- Parameters:
workflowId
- primary keypreviousStatus
- The current known statusnewStatus
- The desired target statuslaunchToken
- Optional launch token. SeeInformational.getLaunchToken()
.- Returns:
> 0
if the operation was successful
-
findAll
public 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) Description copied from interface:CustomizedWorkflowRepository
Retrieve all matching the RSQL filters.- Specified by:
findAll
in interfaceCustomizedWorkflowRepository<D extends JpaWorkflow>
- 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
-
getManagedType
-
failInactiveTimeouts
protected void failInactiveTimeouts() -
failActivityTimeouts
protected void failActivityTimeouts() -
setRepository
-