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 Type
    Method
    Description
    void
    Poll the database for any workflows that fail activity timeout boundaries and mark those workflows as WorkflowStatus.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
    Poll the database for any workflows whose creation date is older than a configured threshold and delete those records from the database.
    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 to updateStatus(String, WorkflowStatus, WorkflowStatus), but also include an optional launch token value as part of the update.
    int
    updateStepValues(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 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
    • 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 key
      previousStatus - The current known status
      newStatus - The desired target status
      Returns:
      > 0 if the operation was successful
    • updateStatusWithToken

      @Policy(operationTypes=UPDATE) int updateStatusWithToken(String workflowId, WorkflowStatus previousStatus, WorkflowStatus newStatus, @Nullable String launchToken)
      Similar to updateStatus(String, WorkflowStatus, WorkflowStatus), but also include an optional launch token value as part of the update.
      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
    • 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:
      > 0 if 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 as WorkflowStatus.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.