Parsware
All articles

How-tos

How to create a process and run it from start to end

Draw a process with lanes, a branch, a person's task and two finishes, publish it, and follow one run from the claim that starts it to the line that says it ended. How-to video H002, step by step.

A bright cover reading "How-to · H002: Run a process, start to end", with "A branch, a manager’s task, two finishes" under it, the steps Branch → Task → Finish → Runs, and two screens from the video.

How-to H002 · 5 min 58 s. A complete tutorial: every click, every value and every condition the video types, so you can build the same process and watch it run. Every picture is a frame of the video.

A process is only finished when it runs. In this tutorial you draw one with a decision in it, publish it, and then follow two real runs from start to end, signing in as each person who has a part in them.

The rule it puts into practice:

  • A claim of 500 or less is approved straight away. Nobody is asked.
  • A claim of more than 500 goes to a manager, who approves or rejects it.

Before you start

  • The Expense Claims solution from How to build a complete app, with its Expense Claim table (fab_expenseclaim), its Amount field (fab_amount) and the Expenses app shared with the Expense User role.
  • Two people with that role: Robin Park (the employee) and Sam Taylor (the manager).
  • If H001's Expense Approval process is still published in the same environment, it also starts on every new claim. To follow along exactly, work in an environment where only this process starts when a claim is created.

Part 1: Draw the process

1.1 Create it

  1. Open Solutions, then Expense Claims, and select Processes in its rail.

  2. Select New and fill in the panel:

    Field Value
    Display name Claim Review
    Description Claims over 500 go to a manager. The rest are approved straight away.
  3. Select Save.

  4. Tick Claim Review in the list and select Design.

1.2 Make the manager's buttons

  1. Open Coforms and select New.
  2. Type the display name Review claim. Its logical name becomes fab_reviewclaim.
  3. Under Outcomes, fill in the first row: value approved, label Approve.
  4. Select Add outcome and fill in: value rejected, label Reject.
  5. Select Save.

The outcomes are the buttons the manager presses, and each one becomes a way out of the task.

1.3 Name the lanes

  1. Go back to Flow and select the full-screen button at the top right of the canvas.
  2. Select each lane's name, type the new one and press Enter:
    • Lane 1 → Employee
    • Lane 2 → Manager
    • Lane 3 → System

Lanes only say who does each step. They don't decide anything on their own.

1.4 Draw the steps

Drag each shape from the toolbar into its lane, then type its Title in the properties panel and press Tab.

Shape Lane Title Notes
Start Employee Claim created Where a run begins.
Branch System Over 500? Asks a question and picks one way out.
Task Manager Review claim Set Type to User, so a person does it.
Finish System Approved
Finish Manager Rejected A process can end in more than one place.

1.5 Connect them

  1. Select Connect in the toolbar.
  2. Drag from each step to the next:
    • Claim created → Over 500?
    • Over 500? → Review claim
    • Over 500? → Approved
    • Review claim → Approved
    • Review claim → Rejected
  3. Press Escape to stop connecting.

The process designer with Claim Review: a Claim created start, an Over 500? branch in the System lane, and a Review claim task in the Manager lane.

1.6 Set up the manager's task

Select Review claim and fill in its properties:

Property Value
Coform fab_reviewclaim (Review claim)
What they look at The record's form
App Expenses
Table Expense Claim

Open the Assigned to code row and type who gets the task:

user("Sam Taylor")

Open the Record row and type which claim it's about, the one that started the run:

getRecordRef("record")

user("…") names one person. A task can also go to everybody with a role, with role("…"), but a role is looked up within the business unit of whoever started the run, so naming a person is the simplest way to start.

1.7 Say which button takes which way

  1. Select the connection from Review claim to Rejected. Set Taken when to Reject and type the title Rejected.
  2. Select the connection from Review claim to Approved. Set Taken when to Approve and type the title Approved.

1.8 Write the branch's conditions

Every way out of a branch needs a condition: a line of BS Lang that's true or false. The run takes the way whose condition is true.

  1. Select the connection from Over 500? to Review claim, and type the title Over 500. Open its Condition row and type:
getRecord("fab_expenseclaim", getRecordRef("record")).fab_amount > 500
  1. Select the connection from Over 500? straight to Approved, and type the title 500 or less. Its Condition:
getRecord("fab_expenseclaim", getRecordRef("record")).fab_amount <= 500

Reading it from the inside out:

Part What it does
getRecordRef("record") The claim that started this run.
getRecord("fab_expenseclaim", …) Reads that claim's current values.
.fab_amount Takes its Amount field.
> 500 / <= 500 The question. Exactly one of the two is true for any amount.

Make sure the two conditions cover every amount between them, with no gap and no overlap. If no condition is true, the run has nowhere to go.

1.9 Say when it starts

  1. Select the process itself, Claim Review, at the top of the outline.
  2. Change Nobody — it is started by hand to A record is created.
  3. Under Choose a table, pick Expense Claim.

1.10 Check, save and publish

  1. The problems panel should say Nothing wrong with this process. A way out of a branch with no condition, or a user task with no coform, is listed there by name.
  2. Leave full screen and select Save.
  3. Select Publish. The designer says Published as version 1. The process is live.

Part 2: Run it

2.1 A small claim, approved straight away

  1. Sign in to the environment as Robin Park and open Expenses.
  2. Select New. Type the name Lunch with a client and the amount 42. Fill in the date.
  3. Select Save & Close.

Saving started a run of Claim Review. 42 isn't over 500, so the run went straight to Approved. Nobody was asked.

2.2 A large claim, sent to the manager

  1. Select New again. Type Hotel, two nights and the amount 820.
  2. Select Save & Close.

This one is over 500, so the run stops at Review claim and waits for the manager.

2.3 The manager decides

  1. Sign out and sign in as Sam Taylor. Open Expenses, then My Tasks.
  2. There is one task, Review claim, for the hotel. The lunch never reached Sam.
  3. Select it and choose Open. The claim opens with the task's bar along the bottom.
  4. Select Decide, then Approve.

The task is done, and so is the run.

Part 3: Watch what happened

  1. Go back to the maker portal as the maker, open Processes, tick Claim Review and select Runs.
  2. There are two runs, newest first, both Completed.
  3. Open the hotel's run. The diagram highlights the steps this run took: the branch, Review claim and Approved. Under it, What happened lists every step with its time:
Step What it says
Run started The claim was created.
Branch Went via Over 500.
Task raised Review claim, assigned to Sam Taylor.
Task completed Approve, by Sam Taylor.
Run ended At Approved.

A finished run on the live diagram, ending at Approved, above its What happened table: run started, branched via Over 500, task raised, task completed as Approve by Sam Taylor, run ended.

  1. Go back to Runs and open the lunch. Its run went from the branch, via 500 or less, straight to Approved. No task was raised and nobody waited.

If something goes wrong

  • Publish is refused. Read the problems panel. The usual causes are a branch exit with no condition, a user task with no coform or no Assigned to, and a step nothing connects to.
  • A claim starts no run. The process isn't published, or its trigger is on a different table.
  • Sam has no task for a big claim. Check the Assigned to name matches the user's full name exactly, and that Expenses is ticked Takes part in business processes.
  • A run stops at the branch. Neither condition was true. Check you typed fab_amount (your field's logical name) and that the claim has an amount.

What you built

A process with a branch that decides, a task for a person and two ways to finish, and the history of every run. The same shape fits most approvals: change the question in the branch, or who the task goes to, and the rest stays the same.

Read more

Is there a task you would like to see done step by step? Tell us. parsware.com/contact