Parsware
All articles

Process design

The problems panel

The process designer checks the drawing as you draw it, and the corner of the canvas says what is still missing: a step nothing reaches, a step that leads nowhere, a timer that never fires, a misspelt variable. Selecting a line takes you to the thing it is about. Nothing stops you saving, but Publish now waits for the list to be empty.

The problems list open in the corner of the canvas with three lines about a Task and a Timer, next to the title "The problems panel"

A process is drawn a piece at a time, so for most of its life it's unfinished. The designer doesn't refuse an unfinished drawing. It tells you what's left, in a bar in the bottom corner of the canvas.

We used the Leave Approval sample from samples/solutions/bpms-leave-approval-process, and broke it on purpose without saving.

Nothing wrong

Open the sample's process and the bar says so:

The Leave Approval process in the designer, and in the corner of the canvas: Nothing wrong with this process.

Three problems

We dragged a Task into the HR lane and connected Deduct Balance to it, then dropped a Timer beside it and connected nothing. The bar now counts 3 problems. Select it to open the list:

The designer with a new Task after Deduct Balance and a Timer on its own, and the problems list: "Task" leads nowhere: no Finish can be reached from it. "Timer" cannot be reached from the Start — nothing connects to it. "Timer" does not say when it fires, so the process would stop there.

  • Task leads nowhere. The run can get to it, but from there no Finish can be reached.
  • Timer cannot be reached. Nothing connects to it, so no run will ever arrive.
  • Timer does not say when it fires. A timer with no length doesn't wait, it stops the run.

The Timer isn't also reported as leading nowhere. A step nothing reaches is a step nothing leaves either, and saying both would be the list repeating itself.

A line takes you there

Select a line and the designer selects the thing it's about, scrolling the canvas to it if it has to. We selected the first:

The Task selected after selecting its line: its properties open on the right, and the canvas scrolled so the Task is in view

A line about a connection selects the connection. A line about the process, such as a misspelt variable in its On start, selects the process. (Process variables shows that one.)

What it checks

  • Exactly one Start, and at least one Finish.
  • Nothing connects into a Start or out of a Finish.
  • No step the flow can never reach, and none it can never leave.
  • A condition on every connection leaving a branch, and at least two ways out of a branch.
  • At least two ways out of a fork and two into a join, and as many joins as forks.
  • A timer that says when it fires, and a deadline that says what to do when it passes.
  • Every variable a script uses is declared, and every variable has a name.
  • Every script parses.
  • On a user task with a coform: each outcome is taken by exactly one connection.

Whether a script may call something is the code editor's business: it underlines that as you type, against what that particular slot can see. The panel only says whether each script parses, because that's the same answer everywhere.

Saving and publishing

Nothing here stops you saving. A half-drawn process reports a page of problems and saves perfectly well, which is the point of a designer.

Publishing is different. A published version is what runs, and a process with problems wouldn't. So Publish is unavailable while the list has anything in it, and holding the pointer over it says why:

The process designer page with the new Task on the canvas, 1 problem in the corner, and Publish greyed out in the title bar

That's new. Publish used to be offered whatever the list said, and it saves before it publishes. So pressing it on a broken drawing saved the broken drawing, and then the server refused to publish it. It was the one press that could never work, and it changed something on the way.

We fixed two smaller things while we were here. Lines quoted names two ways, "Task" and “Timer”, in the same list; they all use the same quotes now. And a line about code named the slot by its internal name, onStart, in English whatever language you work in. It now uses the slot's name from the code list, in your language.

Every message, and its fix

The messages are short on purpose, and each points at one thing to do. The ones you will meet most:

The panel says It means The fix
…cannot be reached from the Start Nothing connects to the step Connect something to it, or delete it
…leads nowhere: no Finish can be reached from it The run can arrive but never end Connect it on, towards a Finish
…is a Branch with fewer than two ways out A decision with one answer Add the other way out, or replace the branch with a plain connection
The connection … leaves a Branch with no condition Nothing decides whether the flow takes it Write the condition on the connection
…does not say when it fires A timer with no length Give it a duration or a date
…uses a variable called …, which this process does not declare A misspelt or missing variable Correct the name, or declare the variable
A connection leaves the Finish … A line out of an ending Delete the connection
Forks: 2. Joins: 1. The splits and merges don't match Add the missing join, or remove the extra fork

A line about a step names the step's title, a line about a connection names its label or the two steps it joins, and a line about code names the place and the slot, Leave Approval — On start. Select any of them to go there.

The order to fix them in

A broken drawing often shows several problems that come from one cause. Fix them in this order and the list shrinks fastest:

  1. Start and Finish. Without exactly one start and at least one finish, the reachability messages mean little.
  2. Unreachable steps. Connect them or delete them. Every step that comes back into the flow usually clears a leads nowhere further on.
  3. Branches. Two ways out each, and a condition on each way.
  4. Forks and joins. Matched pairs.
  5. Variables and scripts. These are usually typing, fixed in a second each.

The same checks when it matters

The panel runs in the designer, as you draw. The same checks run again on the server when you publish, so a process that arrives from a file, an import or the assistant is held to exactly the same rules as one drawn by hand. That is why publishing is unavailable while the list has anything in it: the server would refuse, and it is better to know before pressing the button. Publish a process covers what publishing does next.

What the panel can't know

It checks the shape of the process and the names in its code. It can't check that the process does what you mean:

  • Conditions the wrong way round. yes reading !getVariable("approved") is a perfectly good condition, and the panel stays quiet. Read each condition beside its label.
  • Who gets the task. A role nobody holds is valid. The run will create a task nobody sees.
  • What a script does to a record. A script that writes the wrong status parses fine.

For those, the test is a run: publish to a development environment, start one, and follow it. Watch a process run shows how to read where it went and why.

Questions that come up

Why save a drawing with problems at all? Because a process is drawn over several sittings, and a half-drawn one is not wrong, only unfinished. Saving it keeps your work; publishing is the moment it has to be complete.

Does a problem stop runs that are already going? No. Runs use the version that was published when they started. The panel is about the drawing in front of you.

Try it

Delete the condition on the yes connection after Approved?. The list says the connection leaves a branch with no condition. Select the line, and the designer selects the connection, ready for you to put it back.

Next: coforms, the form a person fills in when a task reaches them.