Parsware
All articles

Process design

A tour of the process designer

A business process in Parsware is drawn, not coded. Lanes for who does the work, shapes for the steps, arrows for the order. We opened the leave-approval sample and went round the designer: the palette, the outline, the canvas, the properties panel, and the problems panel that checks the process as you draw.

The Leave Approval process in the process designer: Employee, Manager and HR lanes, from Start through Submit Request, Review Request and an Approved? branch to Deduct Balance, the two messages and End, next to the title "A tour of the process designer"

Some work is a single save: a record is created, a rule checks it, done. Other work takes days and several people. An employee asks for leave, a manager decides, HR updates the balance, and the employee hears back. That's a process, and in Parsware you draw it.

This is the first of a series on the process designer, one part at a time. It's a tour: what's on the screen and what each part is for. We used the Leave Approval sample. Import it from samples/solutions/bpms-leave-approval-process to follow along.

Where it lives

A process belongs to a solution, like a table or a form. Open the solution, choose Processes, and open Leave Approval:

The process designer inside the maker portal: Flow, Coforms, Runs and Insights on the left, Publish, Save, Start a run, Import JSON, Export JSON and Close along the top, and the designer below

Around the designer itself:

  • On the left, Flow is the drawing. Coforms are the short forms people fill in to finish a step, Runs are the times this process has actually run, and Insights is how it's doing.
  • Along the top, Save keeps your drawing and Publish makes it the version that runs. The line under the title says which version is running and whether it matches what you see. Import JSON and Export JSON move the process as a file.

The button at the top right of the designer (the two arrows) gives it the whole window. We used it for the rest of the pictures.

The whole process

The whole Leave Approval process: Start, Submit Request, Review Request, Approved? with no to Tell Employee: Rejected and yes to Deduct Balance, then Tell Employee: Approved, and End

Read it left to right. The employee submits a request. The manager reviews it. A branch, Approved?, sends it one of two ways: yes to HR, who deduct the balance, then a message saying it's approved; no straight to a message saying it isn't. Both messages end at End.

The designer has four regions:

  1. The palette, on the far left: Select, Lane, Connect, and the shapes you can add: Start, Finish, Task, Branch, Fork, Join and Timer.
  2. The outline, beside it: the process as a tree. The root, its lanes, and the steps in each lane, with a count. Selecting something here selects it on the canvas, and the other way round.
  3. The canvas, in the middle, with one swimlane per role: Employee, Manager, HR. A step belongs to the lane it sits in.
  4. The properties panel, on the right: everything about whatever is selected. With the root selected, that's the process's name and description, its Connector style, what starts it, its Variables and its Events.

The picture above uses Orthogonal connectors, chosen under Connector style. The sample ships with Curved, which draws each connection as one smooth curve from step to step. Curves don't go around the steps in their way, so here the curve from Rejected to End passes behind Approved and looks as if it ends there. Orthogonal connectors are routed around the steps.

Fixed while writing this: orthogonal connectors didn't go around a step either when the step they ended at sat close behind it, as End does behind Approved here. They fell back to a straight line through it. Now they go around.

The canvas doesn't zoom yet, so a wide process needs the full window to be seen whole.

Selecting a step

Click Review Request, on the canvas or in the outline:

Review Request selected on the canvas and highlighted in the outline, with its properties: Title, Name reviewrequest, Description, Type User, who may not decide it, Coform and what they look at

A step has a Title, which is what the box says, and a Name, which is what code and the run history call it. The name fills in from the title as you type. Its Type is User, meaning a person does it, and the small person icon on the box says the same. Further down are who may not decide it, which coform it shows, what the person looks at while they decide, a deadline, and the Code the step runs, including Assigned to: who gets the task.

The later articles in this series take each of these in turn.

Adding a step

Drag a shape from the palette onto a lane. We dropped a Task into the HR lane:

A new Task dropped into the HR lane, selected, with its own properties showing: Title Task, Name task, Type Plain

It lands selected, with its own properties open, ready to name. The outline gains a line under HR.

Fixed while writing this: a step you dropped used to be highlighted on the canvas while the properties panel went on showing the process root, so you had to click it again to edit it.

The problems panel

Notice the bottom left: 1 problem. Open it:

The problems panel open, reading "Task" cannot be reached from the Start — nothing connects to it.

The designer checks the process as you draw it, not when you publish, and not when somebody's leave request gets stuck. A new task with nothing leading to it can never run, so it says so. Other things it catches: a branch output with no condition, a step from which no finish can be reached, a script naming a variable nothing declares.

Select the new task, press Delete, confirm, and the panel is back to Nothing wrong with this process:

The process back as it was, with Nothing wrong with this process at the bottom

We didn't save any of this. The sample is installed as a managed solution, and closing the designer without saving leaves it as it was.

The drawing is a document

Everything on the canvas is saved as one document, which is what Export JSON gives you and what the solution carries. Leave Approval, without the positions of the boxes, reads like this:

{
  "$schema": "bpms-design/v1",
  "meta": {
    "name": "Leave Approval",
    "description": "An employee asks for leave, a manager decides, and the decision is written back onto the record.",
    "scripts": { "onStart": "setVariable(\"approved\", false);" }
  },
  "lanes": [
    { "id": "lane-employee", "name": "Employee", "order": 0 },
    { "id": "lane-manager", "name": "Manager", "order": 1 },
    { "id": "lane-hr", "name": "HR", "order": 2 }
  ],
  "nodes": [
    { "id": "node-start", "kind": "start", "laneId": "lane-employee", "title": "Start" },
    { "id": "node-submit", "kind": "task", "laneId": "lane-employee", "title": "Submit Request", "taskType": "user" },
    { "id": "node-review", "kind": "task", "laneId": "lane-manager", "title": "Review Request", "taskType": "user" },
    { "id": "node-decide", "kind": "branch", "laneId": "lane-manager", "title": "Approved?" },
    { "id": "node-balance", "kind": "task", "laneId": "lane-hr", "title": "Deduct Balance", "taskType": "service" },
    { "id": "node-end", "kind": "finish", "laneId": "lane-employee", "title": "End" }
  ],
  "edges": [
    { "source": "node-decide", "target": "node-balance", "condition": "getVariable(\"approved\")", "label": "yes" }
  ],
  "variables": [{ "name": "approved", "type": "boolean" }]
}

(Shortened: the two Tell Employee steps, most edges, and each step's scripts and assignment are left out.) The four lists are the four things on the canvas: lanes across it, nodes in the lanes, edges between the nodes, and variables the process carries from step to step. The branch's yes is an edge with a condition, which is how the drawing decides which way to go. Export and import a process works with this file directly.

Because it is a document with a published schema, a file written by hand or by the assistant is checked exactly like one drawn on the canvas, and the problems panel reports the same problems.

Save, publish, run

The three buttons along the top are three different things, and the difference matters in a live environment:

Button Does Affects runs
Save Keeps your drawing No. The version that runs is unchanged
Publish Makes the saved drawing the version that runs New runs use it; runs already going carry on with the version they started with
Start a run Starts one run of the published version, to try it One run

So you can save work in progress as often as you like without changing what people are doing. The line under the title tells you whether what you see is what is running. Publish a process covers what publishing checks.

The palette, shape by shape

Shape Is for Read more
Start Where a run begins The shapes
Task A step: a person's decision, a script, a message Task types
Branch Choosing one way out, by a condition Branch conditions
Fork and Join Several things at once, then waiting for all of them Fork and join
Timer Waiting until a time, or for a while Deadlines and timers
Finish Where a path ends The shapes
Lane A role whose work goes in it Swimlanes and roles

Connect draws an edge from one shape to another; Connecting and arranging covers the details.

Drawing a process of your own, in outline

The series goes through each part in turn. As a map of where it is heading, drawing a new process usually goes like this:

  1. Lanes first, one per role that does part of the work: Requester, Manager, Finance.
  2. Start, in the lane of whoever begins it.
  3. One task per thing a person does, in their lane, connected in the order it happens.
  4. A branch wherever the path divides, with a condition on each way out, reading a variable a task set.
  5. A finish at the end of every path.
  6. Watch the problems panel until it says Nothing wrong with this process.
  7. Save, publish, and start a run to try it with a real record.

The two-step approval and leave approval articles in the next series follow this from start to finish.

Questions that come up

Is this BPMN? It is a swimlane process designer with the familiar shapes, start, task, branch, fork, join, timer and finish, saved as its own document format rather than as BPMN XML.

Can a process start by itself? Yes. With the root selected, the properties say what starts it: a person pressing a button, or a record being created or changed. Start a process from a record shows the second.

Who can edit a process? Makers, in the solution it belongs to. A process in a managed solution, like this sample, can be looked at and tried but not saved.

Try it

Select the process root in the outline and switch Connector style between Curved and Orthogonal, watching the line from Tell Employee: Rejected to End. Then click each lane in the outline: a lane has its own properties, and one of them, Role, is what the next article is about.

Next: swimlanes and roles, and who a lane's work goes to.