KBA-01784: Examples of ATC workflow scripts

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.

 


KBA-1784; Last updated: March 17, 2022 at 13:40 pm