Class JpaCustomizedWorkflowRepository<D extends JpaWorkflow>

java.lang.Object
com.broadleafcommerce.workflow.provider.jpa.repository.JpaCustomizedWorkflowRepository<D>
Type Parameters:
D - The possibly extended type of JpaWorkflow
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 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 interface org.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 as WorkflowStatus.FAILED.
      Specified by:
      failTimeouts in interface CustomizedWorkflowRepository<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 interface CustomizedWorkflowRepository<D extends JpaWorkflow>
    • updateStatus

      public int updateStatus(String workflowId, WorkflowStatus previousStatus, WorkflowStatus newStatus)
      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 interface CustomizedWorkflowRepository<D extends JpaWorkflow>
      Parameters:
      workflowId - primary key
      previousStatus - The current known status
      newStatus - 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 to CustomizedWorkflowRepository.updateStatus(String, WorkflowStatus, WorkflowStatus), but also include an optional launch token value as part of the update.
      Specified by:
      updateStatusWithToken in interface CustomizedWorkflowRepository<D extends JpaWorkflow>
      Parameters:
      workflowId - primary key
      previousStatus - The current known status
      newStatus - The desired target status
      launchToken - Optional launch token. See Informational.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 interface CustomizedWorkflowRepository<D extends JpaWorkflow>
      Parameters:
      filters - RSQL filters. Special support here for the JpaWorkflow.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 configuration
      contextInfo - Data tracking context information
      Returns:
      A page of matching data
    • getManagedType

      protected Class<D> getManagedType()
    • failInactiveTimeouts

      protected void failInactiveTimeouts()
    • failActivityTimeouts

      protected void failActivityTimeouts()
    • setRepository

      @Autowired @Lazy public void setRepository(JpaWorkflowRepository<D> repository)