Class WorkflowEndpoint

java.lang.Object
com.broadleafcommerce.workflow.web.endpoint.WorkflowEndpoint

@FrameworkRestController @FrameworkMapping("/workflows") @DataRouteByExample(Workflow.class) public class WorkflowEndpoint extends Object
API for managing Workflow instances and execution.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id)
    Archive a workflow.
    org.springframework.data.domain.Page<Workflow>
    readAll(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String query, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters)
    Read multiple workflow with RSQL filtering.
    readById(boolean useReference, String workflowName, com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id)
    Read a single record by an identifier (primary key or reference id).
    com.broadleafcommerce.orchestration.client.History
    readHistory(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id)
    Read step-by-step execution history.
    com.broadleafcommerce.orchestration.client.SimpleOrchestrationMap
    readOrchestrationMap(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id)
    Read the ordered list of information items related to the SimpleActivity members of the current workflow.
    start(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String name, String reference, Map<String,String> workflowContext)
    Start a new workflow execution.
    update(com.broadleafcommerce.data.tracking.core.context.ContextInfo context, String id, Update update)
    Update the workflow state by either editing the workflow context parameters, or by influence via a state change command.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • readAll

      @FrameworkGetMapping @Policy(permissionRoots="WORKFLOW") public org.springframework.data.domain.Page<Workflow> readAll(@ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @RequestParam(value="query",required=false) String query, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters)
      Read multiple workflow with RSQL filtering. See WorkflowService.readAll(Node, Pageable, ContextInfo).
      Parameters:
      context - Data tracking context information
      page - Paging config
      filters - RSQL filters (if any)
      Returns:
      The filtered page of results
    • readById

      @FrameworkGetMapping("/{id}") @Policy(permissionRoots="WORKFLOW") public Workflow readById(@RequestParam(name="useReference",required=false,defaultValue="false") boolean useReference, @RequestParam(name="workflowName",required=false) String workflowName, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id)
      Read a single record by an identifier (primary key or reference id).
      Parameters:
      useReference - If true, the id is treated as a reference id. Otherwise, it is treated as the primary key. Default is false.
      context - Data tracking context information
      id - The primary key or reference id
      Returns:
      The single record, if found
    • readHistory

      @FrameworkGetMapping("/{id}/history") @Policy(permissionRoots="WORKFLOW") public com.broadleafcommerce.orchestration.client.History readHistory(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id)
      Read step-by-step execution history. See WorkflowService.readHistoryElements(String, ContextInfo)
      Parameters:
      context - Data tracking context information
      id - The primary key
      Returns:
      Step-by-step execution history
    • readOrchestrationMap

      @FrameworkGetMapping("/{id}/map") @Policy(permissionRoots="WORKFLOW") public com.broadleafcommerce.orchestration.client.SimpleOrchestrationMap readOrchestrationMap(@ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id)
      Read the ordered list of information items related to the SimpleActivity members of the current workflow. See WorkflowService.readOrchestrationMap(String, ContextInfo).
      Parameters:
      context - Data tracking context information
      id - The primary key
      Returns:
      The ordered list of information items
    • update

      @FrameworkPatchMapping(value="/{id}", consumes="application/json") @Policy(permissionRoots="WORKFLOW") public Workflow update(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id, @RequestBody Update update)
      Update the workflow state by either editing the workflow context parameters, or by influence via a state change command.
      Parameters:
      context - Data tracking context information
      id - The primary key
      update - Pojo containing update information. See Update.
      Returns:
      The workflow with update state
    • start

      @FrameworkPostMapping(value="/{name}", consumes="application/json") @Policy(permissionRoots="WORKFLOW") public Workflow start(@ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("name") String name, @Nullable @RequestParam(required=false) String reference, @RequestBody Map<String,String> workflowContext)
      Start a new workflow execution. See WorkflowService.start(String, String, Map, ContextInfo).
      Parameters:
      context - Data tracking context information.
      name - The name of the workflow to start.
      reference - Optional. A reference value to which this workflow is correlated. The system will not start more than one workflow for a given reference value. The value must be less than or equal to 36 chars in length.
      workflowContext - Workflow context params to pass to the execution.
      Returns:
      The persisted state of the workflow.
    • delete

      @FrameworkDeleteMapping("/{id}") @Policy(permissionRoots="WORKFLOW") public void delete(@ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("id") String id)
      Archive a workflow.
      Parameters:
      context - Data tracking context information
      id - The primary key