Question:

Can you give me examples of ATC workflow scripts and how you set up if they are triggered by document events or called from a predefined route?

Answer:

Let’s say you want to set up four workflow scripts, three of which will be triggered by events and one to be called as needed.

First Script:

The first script, called ON DFR Save Attach Template, creates a file from a specific template and attaches that file to the document

ATC: ATTACH TEMPLATE [JFS Field Report]

This script will be triggered by an event, specifically when a new Daily Field Report is first saved:

Second Script:

The second script, called OnSubmittalDocSaved, sets the Submitted date to today if the Item status has changed to Submitted.

ATC: FOREACH DocItem by DocItemNumber WITH ItemStatus = 'SIP';
   ATC: IF @.ItemStatus IsChanging
      ATC: SET @.Submitted = NOW
   ATC: ENDIF
ATC: ENDLOOP

This script will be triggered by any of three events, specifically

  • when a Submittal Log is saved:
  • when a Submittal is closed or saved or set to Pending:
  • when a Submittal Package is closed or saved or set to Pending

Third Script:

The third script, called PayApplicationInvoiced, applies a predefined route when the document status is changed to Invoiced.

ATC: EXIT WHEN STATUS != V
ATC: IF Status is Changing
   ATC: ROUTE *, AUTO;
ATC: ENDIF

This script will be triggered by an event, specifically when a Pay Application is approved, saved or made Pending:

Fourth Script:

The fourth script, called Project_StartUp_Checklist, copies a Checklist document onto the project.

ATC: * Called from route
ATC: COPY KEY 3909586e-9491-4b09-8bde-47cde45a0151; WITH Autoaccepted Items

 

This script is not triggered by any event, but rather is called (through a ATC: CALL Project_Startup_Checklist command) from a predefined route.

Related KBAs:

  • KBA-01759: Validation and Document Logic Overview
  • KBA-01777: The Workflow Scripts Tool
  • KBA-01778: How to Create a New ATC Workflow Script
  • KBA-01779: How to Associate an Event with a Workflow Script
  • KBA-01780: How to Create Workflow on a Document
  • KBA-01781: How to Create Workflow in a Predefined Route
  • KBA-01782: The Index of ATC Commands
  • KBA-01783: ATC Script Command Conditions

KBA-1784; Last updated: April 11, 2025 at 8:37 am

Related Post