A workflow walks into a blog

Published: 2019-09-05 Updated: 2022-08-23

On 4 June 2018, the 2018 version of ST4 was launched, bringing with it probably the most comprehensive innovation since the introduction of the Page Layout Designer in 2012: the SCHEMA ST4 Workflow Designer. Just three months later, the SCHEMA Workflow Automation Library was released with Service Pack 1, whose tongue-breaking qualities led to the popular acronym WAL.

A workflow walks into a blog

Designer? Library? Automation? WAL? What is all this and what does it have to do with my workflows?

I asked myself the same questions at the beginning. Today, I like to compare the creation of a workflow with mixing cocktails to give the admittedly rather abstract terms more “feel” in the workflow environment. And after I was able to present this parable in a lecture at the SCHEMA Conference 2019, I wanted to take the opportunity to make my workflow cocktails a tasty treat for our blog readers too.

In order to learn the basics of cocktail mixing, we want to create a workflow cocktail together with the WAL. The workflow is designed to bundle and automate the steps required to extract text for translation in a not quite so hypothetical scenario. The sequence should be as follows:

  1. Selection of source and target language by the technical writer
  2. Automatic check of the selected subtree with Schematron
  3. Automatic release of the source language
  4. Automatic export of the source language to the target language for the TMS

In line with the topic of internationalisation, I call this workflow cocktail the “PAN AM”.

The ingredients

For a good cocktail as well as a workflow, we first need ingredients. For cocktails we use juices, fruit and spices. In workflows, our ingredients are different scripts. A workflow script is a small, finalised function component that can perform an action such as releasing, versioning or changing a metadata date. With Workflow Designer, you already have a whole series of predefined scripts that you can combine into workflows to create your desired cocktail. If you need a little more kick to your cocktail, the Workflow Automation Library (WAL) provides more advanced scripts that allow the ambitious bartender to create even more complex workflows.

 

For our PAN AM we need the following ingredients (scripts):

1 shot   Schematron.Report script (Workflow Automation Library)

1 shot   TMS.Export script (Workflow Automation Library)

1 shot   Release script (Workflow Designer)

3 shots Automatic tasks

3 shots Error states

The recipe

All the ingredients in the world are useless if we cannot combine them into a tasty whole – by following a recipe. In a workflow, the model determines how our ingredients come together. As with all good recipes, the order in which we link our ingredients is important in order to produce a tasty and pleasing result – and a workflow is no exception.

First of all, we build the rough model of the PAN AM with the Workflow Designer. It basically consists of the three central steps we model as states.

 

The rough sequence of the PAN AM in the Workflow Designer

The user can now move the workflow from one state to the next until it reaches the end. Since we actually want to achieve a workflow that is as automated as possible, we use an automatic task for each step instead of a state.

 

The PAN AM with automatic tasks

The alcohol

Every good cocktail needs alcohol. It ensures the taste and also that everything you’ve taken still makes its presence felt the day after – in a sense, it is the cocktail memory. In SCHEMA ST4, this role is played by the fields. You can add as many fields to your workflow as you like to save and read all the information that is generated during the workflow at any time.

For this purpose, as with our roughly mixed PAN AM, we add fields that the writer should not overlook when starting our workflow:

  • SourceLang: Source language of the translation
  • TargetLang: Target language of the translation
  • Node: Project to be translated

In addition, we also need some fields for the results of our automated functions:

  • Success: The Schematron script saves whether the check was successful or not in this field
  • Report: The Schematron script saves the HTML test report in this field
  • Document: The production document used for the test (blue book)

All the fields required for the PAN AM in the Workflow Designer

Mixing

Every professional bartender prepares their ingredients for the cocktail before use, for example, they quarter a lime or foam juices.

We also need to prepare our ingredients (the scripts) before use. Most scripts have parameters that control exactly how the specific function should run. For example, to use the release script in our PAN AM, we must specify as parameters which node is to be released and in which language.

The “Editorial release” script with completed parameters. The node (3) connected to the workflow will be released; the language to be released will be the source language (2) stored in the workflow. In addition, we always release in subtree mode (4).

After we have prepared our other ingredients such as the Schematron Report and TMS Export, we can add them to our workflow cocktail by appending the parameterised scripts to the correct automatic tasks.

The decoration

With decorations such as umbrellas, skewers with fruit pieces or colourful straws, we engage our customers emotionally and at the same time signal the method of consumption we prefer. For workflows, we use input fields that make it easier for users to use our workflow cocktails through one-way user interfaces or determine their use. To do this, we select the first transition of our workflow and select the fields to be entered by the user.

Selected fields to be completed by the user in the first transition

The cherry on top

Finally, we will refine the PAN AM with a few minor details. When using automatic tasks or scripts that are executed there, there may be situations where errors or aborts occur. For example, a release may fail due to insufficient privileges or may cancel the Schematron check for violations of individual rules. In this case, appropriate compensation actions are required, which enable the editor to see the problem that has occurred and to continue working in a controlled manner with the workflow. For the PAN AM, we therefore want to switch to separate error states where the user can either terminate the workflow or continue after manual corrections. Especially for the automatic Schematron test, we add a decision (“test successful”) in which we query the Schematron.Success field filled in by the Schematron script and, if necessary, enter our fault state.

We have now mixed our first joint workflow cocktail! The drink can now be placed on the bar and consumed by the customer. In the ST4 Workflow Designer, we present our drink by releasing the workflow, which makes it visible and usable for all ST4 users.

Conclusion

The beginning is always hard. A certain amount of training is already necessary in order to become a master of the complex Workflow Designer + WAL tool, and to draw out interesting workflows and automated functions. But I promise you that you will improve with every cocktail you mix and will soon be able to blend your own creations. Welcome to the world of workflow bartenders.

Aboute Pierre Hain

Pierre Hain has worked at SCHEMA since 2004. His areas of focus are the design, supervision and implementation of technically challenging projects and interfaces involving the product SCHEMA ST4. He successfully obtained his degree in Media Informatics at the University of Cooperative Education in Mannheim.