Understanding Workflow States

 

As a quote goes through a workflow, it will be assigned to a specific state based on that workflow's logic. Think of a state as a stopping point in the workflow, where...

  • an automated process can build documents in the quote,
  • a user can edit, approve, or reject the quote and advance it to other states, or
  • nobody performs a task on the quote. It is done and stored for historical purposes.

States dictate who can do and see what within the quote. For instance, you may wish pricing to be hidden to the customer who created the quote until it has reached a state named "Completed." Or you may allow the changing of product specs in an intermediate state, and then disallow it after it has entered a finalized state.

The names and Snap code within each of the states in a workflow are up to you to design, and their meaning depends solely on the implementation.

Types of States

All the workflow branches, loops, and flows you can imagine begin at the Unsubmitted state, and can be created from just three state blocks and the logic of Snap.

Unsubmitted State

This is the only built-in workflow state. When your customer uses a configurator to create a custom configured product, and then saves that configured product, a quote object is automatically created to store their work. The state of this quote is "unsubmitted". Only when the quote is submitted for processing does it enter a workflow, and have other states assigned to it.

When unsubmitted, the quote (and any configured products within it) is a draft. It is not visible to users other than the creator and those with the Company Administrator role. The quote cannot be shared.

If your workflow needs require a quote to be shared or socialized before being approved, then simply create a new state before the approval state. Give this new state an informative name such as "Draft" or "Pending", and the proper permissions so the right user roles have the right access to it.

Approval State

The approval state block provides a formal review process. Specific users or roles are defined as approvers for this state. Two new buttons, "Approve" and "Reject", appear on the quote to those users, and the quote proceeds to whatever other stages in the workflow are defined on approval or rejection. For all other users, the quote cannot be edited while in this state.

Build State

Build states group outputs into a series of jobs. The quote will remain in this state until all of the builds are complete.

General State

The general state represents a simple state which don't require any action from a builder or from a person. You'll use this state at one of the final stages of your workflow, such as a "Final" or "Completed" stage.

Permissions can change at each state

What your users can do with a submitted quote and its products can change at each stage of the workflow.  Use Snap blocks in the workflow block to adjust permissions as necessary.  For a full list of permissions, see the permissions page.

  1. First, set your default permissions. It's easier to set most permissions once, at the start of the workflow, instead of over and over in each state block.
  2. Then, set the unique permissions required by any specific state within that state block.

 

Workflow Example

Here's an example. This workflow built from the Snap blocks below satisfies the following arbitrary business requirements:

  1. Quotes are first submitted into a build stage, where output documents are created or refreshed.
  2. If the discount is greater than 20%, get manager approval.
  3. If rejected by the manager, stop the workflow (the quote returns to a draft state, where the owner can again edit and submit it).
  4. All other quotes then rest in an "Approved" state where they become a locked object of record.
  5. For permissions,
    1. Engineers and Sales People can see the discount percentage,
    2. Only Engineers can see the cost.
    3. When the quote is Approved, then special permissions apply: only the discount percentage is visible to both Engineers and Sales People.
  6. We want a unique quote number stamped on the quote.

 

Under Quotes and Workflows > Workflows, create a new workflow and give it a name.

Req F: To stamp the quote number, use the "After submitted" slot.

Req E1,E2: Set the default permissions:

Create your first state by using the "Build" state block.
Req A: Build the documents.
Req B: Only get approval if the discount is > 0.2. Otherwise, skip to the "Approved" state.

Add the approval stage.
Req. C: If rejected by the manager, stop the workflow

 

Finally, create the general state called "Approved". We accomplish requirement E3 by overriding the default permission for "View Cost". (Note that we are simply overriding the default roles with a convenient role: company administrators can always see all data.)

E3: When the quote is Approved, only the discount percentage is visible to both Engineers and Sales People.


Was this article helpful?