Holarch

Behavior

Action Diagrams

Model a functional flow with sequence, parallel, decision, loop and exit constructs, the items that pass between actions, the resources they use and the assets that perform them, then simulate it.

How to use it →

On this page
  1. Overview
  2. Concepts
    1. The flow
    2. Items around the flow
  3. How to use it
    1. When and why
    2. Build a flow from scratch
    3. Build a flow by dragging from the palette
    4. Connect Input/Outputs and Resources
    5. Assign performers
    6. Decompose and drill down
    7. Simulate and validate
    8. Worked example: the CubeSat EO-1 imaging pass
    9. Tips and good practice
    10. Common mistakes
    11. How it connects to other features
  4. The editor
    1. Page header
    2. Toolbar
    3. Arrange ▾
    4. Generate Asset Diagram
    5. Palette
    6. Canvas gestures
    7. What each shape shows
    8. Inspector
  5. How the diagram maps to LML
  6. Simulation scripts
  7. Delete and remove
  8. Keyboard shortcuts
  9. Options and settings
  10. Messages
  11. Limits
  12. Related pages

Overview

An Action Diagram shows how a parent Action is carried out. It is the LML behavior diagram, and the Simulator runs exactly what it shows.

The diagram shows:

  • the child Actions, in the order they run;
  • where the flow splits into parallel paths or alternatives, and where it loops;
  • the Input/Outputs (I/Os) that pass from one Action to another;
  • the Resources each Action uses;
  • the Assets that perform the work.

The diagram is a view of the model, not a drawing. Each shape you add, move or delete changes entities and relationships in the project. Every change can be undone with a single Undo.

The same flow also drives the Functional Flow Block Diagram (FFBD), the SysML Activity Diagram and the Timeline Diagram. Edit the flow in any of them and the others follow.

Concepts

The flow

A flow runs from a green Start pill on the left to a red End pill on the right. Arrows join the elements in between. Each element is one of these:

ElementShapeWhat it meansEntity
Action (serial step)Rounded blue box with number and nameA step that starts when the previous element endsA child Action of the root (decomposed by)
ParallelA fork bar labelled parallel and a closing barTwo or more branches that run at the same time. The flow continues when all branches finish.None
SYNCA block marked SYNC with a point on the right, and a closing barParallel branches with an entity of their own. Its Duration is a timeout that stops unfinished branches.An Action named "Sync Action" (control type SYNC)
ORA block marked OR with a point on the left, and a closing circleA decision: exactly one branch runsAn Action named "Or Action" (control type OR)
LOOPAn entry circle, the loop body, a block marked LOOP, a dashed return arrowThe body repeats while the continue condition holds. The condition is checked before each pass.An Action named "Loop Action" (control type LOOP)
EXITA red box marked EXITEnds the enclosing LOOP (or the flow it sits in) when reachedNone

A branch is one path inside a Parallel, SYNC or OR. Each branch is its own sequence and can hold any element, including more constructs. A LOOP holds one sequence, called its body.

OR, SYNC and LOOP are constructs with an entity of their own. That entity is a child of the root like a step, so the construct can carry a name, a script and (for SYNC) a timeout. Constructs are not steps: they never appear as Action boxes, and views such as the Timeline skip them.

Items around the flow

ItemShapeRelationshipMeaning
Input/OutputParallelogram above the flow. Green when it triggers an Action, grey otherwise.Action generates I/O; Action receives I/OInformation, data or material passed between Actions
Parent Input/OutputParallelogram labelled parent input (left of Start) or parent output (right of End)The root Action receives or generates itThe interface of the parent Action. Drawn dashed while no child Action uses it.
ResourcePurple hexagon below the flowAction consumes, produces or seizes Resource, with an AmountA quantity that Actions use up, return or create
Performing Asset⟂ and the Asset name under the Action nameAsset performs ActionWho or what carries out the Action. Shown when Assets is on.
Performer⟂ and the Asset name on a Parallel or SYNC branchAsset performs every Action on the branchA performer for a whole branch. Kept in step on every edit.

Two terms matter for simulation:

  • Trigger: a received I/O with Trigger set (the default) makes the receiving Action wait until the I/O exists.
  • Optional: a received I/O with Trigger off. The Action starts without waiting for it.

A Resource line is labelled with the relationship and the amount, for example consumes 1.5. A Resource that is only seized is drawn lighter.

How to use it

When and why

Build an Action Diagram once you have a set of functions and before you allocate them to the physical architecture. The functions usually come from Functional Analysis of the requirements.

The diagram answers these questions:

  • In what order do the functions run, and which run in parallel?
  • Where does the system make a decision?
  • What does each function need and produce?
  • How long does the whole sequence take?

Use one diagram per level of decomposition. Start with a top-level operational scenario, such as a mission timeline or a use case. Then add a diagram for each function that needs its own detail.

The diagram is executable. Use it with the Simulator to check timing and resource requirements early, before hardware exists.

Build a flow from scratch

Create the diagram:

  1. Open Diagrams at the bottom of the rail.
  2. Click + New Diagram.
  3. Under Diagram type, pick Action Diagram (in the Behavior group, tagged LML).
  4. In Root, type the name of the new Action, for example Run Nominal Imaging Pass. (Give it a number such as OPS later in the inspector.)
  5. Click Create.

    You see Start and End, and the hint Drag an element here or click + Action.

Add steps in sequence:

  1. Click + Add ▾ → + Action ▾ → New Action….
  2. Type the name in Add Action.
  3. Click OK (or press Enter).

    You see a numbered Action box in the flow. Numbers continue from the parent's number: OPS.1, OPS.2, and so on. The new Action is a child of the root.

  4. Keep the new Action selected and repeat steps 1 to 3 for the next step. + Action always inserts after the selected element.

Add steps that run at the same time:

  1. Select the step after which the parallel steps start.
  2. Click + Add ▾ → + Sync.

    You see a SYNC with two empty branches.

  3. Click a branch line to select it.
  4. Click + Add ▾ → + Action ▾ → New Action… to add a step to that branch.
  5. Click + Branch if you need a third branch.

Use + Add ▾ → + Action ▾ → Parallel branches (no entity) instead of + Sync when you need no timeout, name or script.

Add a decision:

  1. Select the step before the decision.
  2. Click + Or.
  3. Enter the question, for example Contact in view?.

    You see two branches, Yes and No, at 50% each.

  4. Select the OR and set the guard names and probabilities in the inspector.

Repeat a step:

  1. Select the step.
  2. Click + Add ▾ → + Loop.
  3. Enter the loop name.

    You see the step wrapped in a loop that runs twice.

  4. Set the number of iterations, or another condition, in the inspector.

Set durations and check the result:

  1. Select an Action.
  2. Fill in Duration in the inspector's Schedule group.
  3. To give several Actions the same Duration, Shift-click them and set Duration (N Actions) in the inspector.
  4. Click the diagram checks badge in the toolbar (✓ Checks, or ⚠ and a number).

    The inspector lists the Actions without a Duration and the items that are not connected.

Build a flow by dragging from the palette

The palette on the left holds the constructs and the item types. Drag them onto the canvas instead of using the toolbar.

  1. Drag Action onto any line of the flow. The drop line highlights while the item is over a valid place.

    You see a "New Action" at that point. Its name field in the inspector is selected, ready for typing.

  2. Type the name.
  3. Drag Parallel, Or, Sync, Loop or Exit onto a line in the same way.
  4. Drag Input/Output onto an Action. This creates an I/O that the Action generates. Drop it on empty canvas to place an unconnected I/O.
  5. Drag Resource onto an Action. This creates a Resource that the Action consumes (Amount 1). Drop it on empty canvas to place it unconnected.
  6. Drag Performer onto a branch line of a Parallel or SYNC, then choose the Asset.

    The Asset now performs every Action on that branch.

To reuse items that are already in the model:

  1. Type a name in Add or find…. In the project lists the matching Actions, Input/Outputs, Resources and Assets.
  2. Drag a match onto the diagram:
    • an Action onto a line;
    • an I/O or Resource onto an Action or the canvas;
    • an Asset onto a Parallel or SYNC branch line.

With the keyboard, focus a palette item and press Enter or Space. Constructs go to the end of the main flow. Input/Outputs and Resources go to the center of the view.

Connect Input/Outputs and Resources

Connect items by dragging a handle from one shape to another.

Pass an I/O from one Action to another:

  1. Select the first Action.

    You see a green handle above it.

  2. Drag the handle onto the second Action.

    While you hover, the target box shows two halves.

  3. Release on the Trigger (top) half for a triggering input, or on the Optional (bottom) half for an optional one.

    Holarch creates a new Input/Output. The first Action generates it and the second receives it. The new I/O is selected with its name field ready for typing.

  4. Type the I/O name.

The Action's handle can also go elsewhere:

  • Onto an existing Input/Output: the Action generates it.
  • Onto a Resource: the Action produces it (Amount 1).
  • Onto empty canvas: Holarch creates a new output of the Action.

Make an Action receive an existing I/O:

  1. Select the Input/Output.
  2. Drag its handle (below the shape) onto the Action.
  3. Release on the Action, then choose Input (trigger) or Input (optional) in the connect chooser.

If the Action already receives that I/O, only its Trigger setting changes.

Make an Action use a Resource:

  1. Select the Resource.
  2. Drag its handle (above the shape) onto the Action.
  3. Release on the Consumes (top) half or the Seizes (bottom) half.

Switching between consumes and seizes keeps the amount.

Set the amount of a resource link:

  1. Select the Action.
  2. In the inspector's Trace section, find the Resource under consumes, produces or seizes and click Attributes.
  3. Edit the relationship attribute Amount.

Place I/Os and Resources by hand:

  • Drag an Input/Output or Resource shape to where you want it. The position is saved with the diagram.
  • Click Reset Position in its inspector to return it to the automatic layout above or below the Actions that use it.
  • Choose Arrange ▾ → Reset Input/Output and Resource Positions to reset all of them.

Assign performers

Assign an Asset to one Action:

  1. Select the Action and choose Open in ▾ → Item View. (On the diagram, performed by is locked in the inspector, because the diagram manages it.)
  2. In the Trace section, add performed by with + → Link existing….
  3. Pick the Asset.

Assign an Asset to a whole branch of a Parallel or SYNC, in either of two ways:

  • Drag Performer from the Add panel onto the branch line.
  • Select the Parallel or SYNC and click + Asset next to the branch in the inspector.

Turn on Assets in the toolbar to show the performers under each Action name.

Decompose and drill down

Give one Action its own child flow:

  1. Select the Action.
  2. Click Decompose.

    That Action's own Action Diagram opens.

  3. Build its child flow there.
  4. Click ▲ Parent in the page header to return.

You can also open a child flow by double-clicking a decomposed Action or by clicking its decomposed icon.

Group several steps into a new child Action:

  1. Shift-click two or more elements that are next to each other on the same line.
  2. Click Decompose (group).

    The elements move into a new child Action named "New Action" with its own flow. You see the toast Grouped into a new child Action. Name it in the inspector. and the name field is selected.

  3. Type the new name.

Flatten a child flow back into this diagram:

  1. Select a decomposed Action.
  2. Click Flatten (in the toolbar or the inspector).

    Its child flow replaces it in this diagram.

  3. Choose Keep the Action to keep the emptied Action in the model (outside this diagram), or Delete Item to delete it.

In the Simulator, a decomposed Action runs its child flow. Its own Duration is not used.

Simulate and validate

  1. Open the diagram checks badge before the first run and fix what it lists.

    You see what the Simulator will treat as missing:

    • Actions without a Duration simulate as 0.
    • I/Os that no Action generates leave their receivers waiting (a deadlock).
    • Resources that nothing uses are listed.
  2. Fix what the check reports.
  3. Click ▶ Simulate ▾ and choose Discrete Event to watch one timed run, or Monte Carlo for many runs.

    The Simulator opens with this Action as the root.

  4. Run the simulation.

A run that waits forever is reported as a deadlock. The Simulator's Status shows the reason, and the Log tab lists it:

  • waiting for I/O … (never generated)
  • waiting for … (never available)

Fix the diagram and run again. For example, turn a trigger into an optional input.

Worked example: the CubeSat EO-1 imaging pass

The demo project contains the Action Diagram OPS Run Nominal Imaging Pass.

  1. Create the demo project with Manage Projects → Project Files ▾ → New Demo Project.
  2. Open the diagram from Behavior → Action Diagrams.

The flow runs as follows:

  1. Three steps run in sequence:
    • OPS.1 Transmit Imaging Plan (Ground Station, triangular 4–9 minutes, most likely 6);
    • OPS.2 Receive Imaging Plan (UHF Transceiver, 1 minute);
    • OPS.3 Load Command Schedule (C&DH, 2 minutes).
  2. A Parallel runs OPS.4 Rotate to Target (ADCS, normal 3 ± 0.5 minutes) and OPS.5 Prepare Camera (Payload Camera, 5 minutes) at the same time. Both receive Command Schedule as a trigger.
  3. A LOOP named Each target runs OPS.6 Capture Image Strip and OPS.7 Encode and Store Image four times (Continue (×4)).
  4. An OR named Contact in view? chooses the next step:
    • Yes (75%): OPS.8 Transmit Image Data;
    • No (25%): OPS.9 Hold Data Onboard.
  5. A final Parallel recharges the battery (OPS.10) while the ground receives and processes the data (OPS.11, OPS.12).

The flow uses two Resources:

  • Battery Charge (Wh, initial 62, minimum 23, maximum 77). OPS.4 (1.5), OPS.5 (0.8), OPS.6 (2), OPS.7 (0.3) and OPS.8 (6) consume it. OPS.10 (30) produces it.
  • Data Storage (GB). OPS.7 (2.5) produces it and OPS.8 (8) consumes it.

Image Data Package is an optional input of OPS.11. A pass without contact therefore does not deadlock the ground segment.

Try these changes:

  1. Select the OR and change Yes to 60 and No to 40.

    The branch labels read Yes (60%) and No (40%). The inspector shows Total 100%.

  2. Select the LOOP and set Number of iterations to 6.

    The loop text reads Continue (×6).

  3. Choose ▶ Simulate ▾ → Monte Carlo and run it.

    More targets per pass consume more battery. The summary strip and the Distribution tab show the longer pass time.

  4. Turn on Assets to see each performer.
  5. Choose Arrange ▾ → Generate Asset Diagram.

    Holarch creates the Asset "Run Nominal Imaging Pass performers". Its children are the performing Assets, with Conduits for every I/O that passes between two of them. Its Asset Diagram opens.

Tips and good practice

  • Name Actions as verb + object (Capture Image Strip) and I/Os as nouns (Image Strip). Name OR guards as answers to the OR's question.
  • Keep each diagram to about seven to twelve elements. Group detail into child Actions with Decompose (group).
  • Use Parallel (no entity) by default. Use SYNC only when you need a timeout, a name or a script.
  • An OR in probability mode must total 100%. When the probabilities are unknown, choose None (ask during the run, or random). The Simulator then asks, or Monte Carlo uses equal probabilities.
  • Give every leaf Action a Duration before simulating. Where the time varies, use a distribution, for example =norm.dist(40,6) Seconds.
  • Make a received I/O Optional when the Action can start without it. Otherwise a branch that never produces it deadlocks the run.
  • Number children in flow order with Renumber children… in the root's inspector (Arrange ▾ → Diagram Settings), with the child order set to flow order.

Common mistakes

SymptomCauseFix
Drop the construct on a flow line.A construct or Action was released on a shape or empty canvasRelease it on an arrow between elements
Branch probabilities add up to 90 %. Change them to total 100 %.OR probabilities do not add upCorrect the percentages, or add a branch
The simulation never ends (deadlock)An Action waits for a triggering I/O that nothing generates on this pathMake the input Optional, or generate it on every path
An Action takes no time in the simulationNo Duration, or the Action is decomposed (its child flow runs instead)Set its Duration, or add durations to its children
A step seems to vanishIt was removed from the diagram but kept in the modelType its name in Add or find… and drag it back onto a line
Generate Asset Diagram reports No Action here has a performer…No Action has a performed by Asset and no branch has a PerformerAssign performers first

How it connects to other features

  • Fed by: Functional Analysis creates the functions (child Actions) and their flow. Requirements reach the Actions through satisfied by. Assets and Resources come from the architecture.
  • Feeds the Simulator: time, cost, resource levels, Asset utilization and requirement checks. See Simulation.
  • Feeds other views of the same flow: the FFBD and the Activity Diagram.
  • Feeds derived views:
    • the Timeline Diagram (schedule from Start and Duration);
    • the Sequence Diagram (lifelines are the performing Assets, messages are the I/Os);
    • Generate Asset Diagram (physical context and Conduits);
    • the N² Diagram (I/Os between functions);
    • IDEF0 (inputs and outputs).
  • Traceability: the inspector's Trace section shows each Action's requirements (satisfies). The RVTM and Traceability Matrix read the same relationships.

The editor

The Action Diagram uses the shared diagram editor (see Diagrams). It has a toolbar row, the palette on the left, the canvas, and the inspector on the right.

  • Diagram type selector: shows the same root Action in another diagram type that applies to Actions. The types are Hierarchy, Spider, Tree, Risk, Timeline, Action, Sequence, Use Case, N2, IDEF0, ICOM (A0), Activity and FFBD.
  • ▲ Parent: opens the Action Diagram of the parent Action. Shown only when the root has a parent Action.

Toolbar

The toolbar is one row of groups. The adds of the Insert group (+ Action ▾, + Sync, + Or, + Loop, + Exit, + Branch, + I/O) are in one + Add ▾ list: they work at the selection (after it, around it, on its branches), while the Add panel on the left adds by dragging or Enter. In the list, ↓ and ↑ move between the adds and Esc closes it. When the window is narrow, items move into ⋯ (More actions); + Add ▾ stays in the row, and only Decompose and ▶ Simulate ▾ stay as long. Selecting a shape opens the inspector without moving the toolbar's buttons.

GroupControlWhat it does
ModePanDrag the background to move the view (the default).
ModeBox selectSelects annotations only on Action Diagrams. Select flow elements with Shift-click.
Insert+ Add ▾Opens the list of the adds below ("Add at the selection").
Insert+ Action ▾New Action… asks for the name (default New Action). Existing Action… picks an Action that is not the root, one of its ancestors, or already in this diagram. Parallel branches (no entity) adds parallel branches. Inserts after the selection, at the end of a selected branch, or at the end of the flow.
Insert+ SyncAdds a SYNC with two empty branches.
Insert+ OrAsks for the Decision name (a question) (default Or Action), then adds an OR with branches Yes and No at 50%.
Insert+ LoopAsks for the Loop name (the repeat condition) (default Loop Action). With an element selected, it wraps that element in the loop (Put the selected element inside a LOOP). Otherwise it adds an empty loop (Add an empty LOOP). New loops run 2 iterations.
Insert+ ExitAdds an EXIT after the selection.
Insert+ BranchAdds a branch to the selected Parallel, SYNC or OR (or the one whose branch is selected). An OR's probabilities are re-split evenly. Disabled otherwise.
Insert+ I/OWith an Action selected, pick the receiving Action (Input/Output from "…" to…), then name the new I/O. The first Action generates it and the second receives it as a trigger.
EditUndo, Redo⌘Z / Ctrl+Z, ⇧⌘Z / Ctrl+Shift+Z.
EditConnect…Connects the selected shape to another from the keyboard, with the same choices as dragging its handle (see Keyboard and screen readers).
Edit◀, ▶Move the selected element one place left or right within its sequence.
EditRemoveRemove the selection from the diagram; Shift+click deletes the entities (see Delete and remove).
View−, zoom %, +, ⤢Zoom out, type a zoom level (10–400%), zoom in, fit the diagram.
ViewSearch diagram with ‹ ›Highlights Actions, I/Os and Resources whose name, number, description, id or attribute values match. ↓ / ↑ (or ‹ ›) move between matches; Enter selects the current one.
ViewContentsDiagram Contents: the shapes, connections and relationships as text.
ViewConfigureShows the root and diagram type in the inspector, to switch either in place (see Configure: root and type).
ViewArrange ▾See Arrange ▾ below.
ViewDiagram checks badgeOrphans and cycles plus the Action Diagram checks (see Messages), listed in the inspector with Show.
ViewI/O, Resources, Assets, Parent I/OShow or hide Input/Outputs, Resources, performing Assets and parent Input/Outputs. The choice is saved with the diagram and becomes the default for new Action Diagrams.
Type actionsDecompose / Decompose (group)One Action selected: open its child Action Diagram. Several elements: group them into a new child Action.
Type actionsFlattenReplace the selected decomposed Action by its child flow.
Type actionsOpenOpens the Item View of the selected entity, or of the root.
Type actions▶ Simulate ▾Discrete Event or Monte Carlo: opens the Simulator with this root.
OutputExport…Diagram (PNG) with Transparent background and Scale, Diagram (SVG), Diagram (HTML), Diagram (Word), Diagram (Print).
More⋯Overflowed items, then Open Item View, All Diagrams, Help for Action Diagram and Delete Diagram….

Arrange ▾

ItemWhat it does
Restore DefaultsClears manual I/O and Resource positions.
Show / HideHide Resources, Hide All Input/Outputs, Hide Parent Input/Outputs, Hide Performing Assets and Hide Palette; each item reads Show … while that part is hidden (for example Show Performing Assets).
Reset Input/Output and Resource PositionsReturns every moved I/O and Resource to the automatic layout.
Generate Asset DiagramCreates "root performers", see Generate Asset Diagram.
Open as FFBDOpens the same flow as a Functional Flow Block Diagram.
Diagram SettingsThe root in the inspector with Renumber children… (old → new numbers; the child order, outline or flow, comes from Project Preferences → Numbering; a single Undo takes it all back).
Hide Add Panel / Show Add PanelHides the left sidebar (palette and annotations) in every diagram.

Generate Asset Diagram

Arrange ▾ → Generate Asset Diagram builds the physical context of the flow from its performers.

  • It creates the Asset "root performers". That Asset performs the root Action.
  • The new Asset is decomposed by every performing Asset. Performers come from performed by and branch Performers, at all levels below the root.
  • For each pair of Assets whose Actions exchange an I/O, it reuses or creates a Conduit. The Conduit is named "A to B", or "A / B" when the I/O goes both ways, and it transfers those I/Os.
  • Then it opens the Asset Diagram.

Palette

The Add panel (hint Drag onto a line or a shape, or press Enter) lists:

ItemDrop onCreates
ActionA lineA new Action "New Action"
ParallelA lineParallel branches (no entity)
OrA lineAn OR Action entity with Yes/No branches
SyncA lineA SYNC Action entity
LoopA lineA LOOP Action entity (empty body, 2 iterations)
ExitA lineAn EXIT
Input/OutputAn Action, or anywhereA new I/O named "I/O", generated by the Action when dropped on one
ResourceAn Action, or anywhereA new Resource named "Resource", consumed (Amount 1) when dropped on an Action
PerformerA Parallel or SYNC branch lineAsks for the Asset (Performer of this Branch), which then performs the branch

Type a name in Add or find…: Create offers "name" as Action, Or, Sync, Loop, Input/Output or Resource, and In the project lists matching Actions, Input/Outputs, Resources and Assets (up to 60; not the root or construct entities). Drag a row in, or press Enter on it.

Below the palette is the Annotations section shared by all diagrams. × in the Add panel's header hides it. Arrange ▾ → Show Palette brings it back.

Canvas gestures

GestureResult
Click a shapeSelect it; the inspector shows it
Shift+clickAdd or remove an element from the selection
Click a lineSelect the branch it belongs to (or clear the selection on the main line)
Click the backgroundClear the selection
Drag an Action or construct onto a lineMove it there (with everything inside it)
Drag an I/O or ResourcePlace it freely
Drag the green handleConnect (see Connect Input/Outputs and Resources)
Double-click an ActionOpen its child Action Diagram when it is decomposed, else its Item View
Double-click an I/O or ResourceOpen its Item View
Click the decomposed iconOpen the child Action Diagram
Drag the backgroundPan
Scroll / ⌘ / Ctrl+scrollPan / zoom at the pointer

What each shape shows

  • Action box: the number (top), the name, and one line below. That line shows the Duration (for example 1 minute), or the performing Assets when Assets is on.
  • { } in purple at the lower left: the Action or construct has a simulation script.
  • Decomposed icon at the upper right: the Action has its own child flow. Click the icon to open it.
  • OR branch labels: the guard name and its probability (Yes (75%)) or condition (Low [< 20], [else]).
  • Parallel and SYNC branch labels: the branch name and its Performer.
  • Loop text under the return arrow: Continue (×4), Continue (50%), Continue while Battery Charge > 20, Continue (script) or Continue (ask). Exit marks the way out.
  • Construct name: shown in italics next to OR, SYNC and LOOP blocks.

Inspector

The inspector on the right shows the selection. What it shows depends on what you select.

Action, Input/Output, Resource or Asset: the shared entity panel. It has:

  • the header with the class, number and name, and Open in ▾ (Item View and every other diagram of this entity);
  • Definition: Number, Name and Description;
  • Shape: the extra actions in the table below, and Position and Size;
  • the attribute groups (Workflow, Schedule and so on), then Trace, Discussion and Details.

The relationships this diagram manages are locked in the Trace section, so the diagram and model stay in step. They are consumed by, decomposed by, generated by, performed by, produced by, received by and seized by.

SelectionExtra actions
ActionAction Diagram, Edit Script…, Flatten (when decomposed), Remove and Delete Item…
Input/Output or Resource that was movedReset Position
Parent I/O that is decomposed into child I/OsShow Parent Input/Outputs shows its children in place of it; Hide Parent Input/Outputs returns
AnyRemove and Delete Item…

OR selected (panel OR (Decision)):

  • Decision name: the OR entity's name.
  • Decision type: Probability, Resource amount, Script or None (ask during the run, or random).
  • Resource (Resource amount only): the Resource whose amount is compared.
  • Branches: a guard name per branch. By type, each branch also has a probability (0–100 %), or an operator (==, !=, >, <, >=, <=, else) and a value.
  • Total line: reads Total 100%, or the warning Branch probabilities add up to N %. Change them to total 100 %.
  • Edit Script…/Add Script… (Script type): onEnd() returns the guard name of the branch to take.
  • None type note: With "Prompt" decisions the simulator asks which path to take; when automated it picks a branch at random.
  • + Add Branch, Open Item.

SYNC selected:

  • Name.
  • Time limit: Optional. After this time the SYNC ends and stops the branches still running.
  • The note N branches run concurrently; flow continues when all finish.
  • One row per branch: the branch name and + Asset. Once an Asset is set, the row shows ⟂ Asset name and × to remove it.
  • Edit Script…/Add Script…, + Add Branch, Open Item.

Parallel selected: the same as SYNC, without the entity fields.

A branch selected: Branch N selected — + Action adds to it.

LOOP selected:

  • Name (condition).
  • Repeat while: Iterations, Probability, Resource amount, Script or None (ask during the run, or random).
  • By condition: Number of iterations (minimum 1), Probability to continue (%), or Resource plus continue while amount with an operator and value.
  • Script note: Before each pass onEnd() is called; returning true runs the body again.
  • None note: With "Prompt" decisions the simulator asks for the number of iterations; when automated it runs 0–2 passes at random.
  • Edit Script…/Add Script…, the note An EXIT in the loop body stops the loop early., Open Item.

EXIT selected: Stops the enclosing LOOP, or this flow, when reached.

Several elements selected: N elements selected, Duration (N Actions) (a live field: a change sets the Duration on every selected Action as one undo step; it stays empty when their durations differ), Decompose (group into a new child Action) and Remove.

How the diagram maps to LML

On the diagramIn the model
Root of the diagramThe parent Action
Action boxChild Action: parent decomposed by child
OR, SYNC, LOOP blockChild Action with a control type, decomposed by the parent
Order, branches, loopsThe flow structure saved with the parent (the order in which children run)
Line from an Action to an I/OAction generates Input/Output
Line from an I/O to an ActionAction receives Input/Output, with the relationship attribute Trigger (Yes = trigger, No = optional)
Line between an Action and a Resourceconsumes, produces or seizes, each with the attribute Amount
⟂ AssetAsset performs Action (inverse performed by). The relationship attribute Amount is the number of that Asset the Action occupies.
Duration on a boxThe Action's Duration attribute (a number or a distribution, with a unit)
Child flowThe child Action's own Action Diagram

The attributes of the classes on this diagram:

  • Action: Start (date and time), Duration (value or distribution plus Seconds, Minutes, Hours, Days, Weeks, Months or Years) and Percent Complete.
  • Resource: Units, Initial Amount, Minimum Amount and Maximum Amount.
  • Input/Output: Size, Units, Type and Value.

Simulation scripts

A script adds behavior that the diagram alone cannot express, such as a computed duration or a decision based on model values.

To edit a script:

  1. Select an Action, OR, SYNC or LOOP.
  2. Click Edit Script… (Action) or Edit Script…/Add Script… (OR, SYNC, LOOP).
  3. Click Add onStart(), Add prompt(), Add onEnd() or Add duration() to insert an empty hook function.
  4. Write the code. Tab inserts two spaces.
  5. Click Save. An empty script removes the script.

The hooks:

  • onStart() runs when the element starts.
  • prompt(p) builds a question for the user: p.setTitle(), p.addEnumInput(title, name, choices, default), addTextInput, addNumberInput, addBooleanInput.
  • onEnd(response) runs at the end. An OR returns the name of the branch to take. A LOOP returns true to run the body again.
  • duration() returns the duration of the Action when its Duration is =script().

Scripts can call:

  • Sim.getEntityByName(n), Sim.getAmount(name), Sim.setResourceByName(name, v);
  • Sim.getCurrentTime(), Sim.getCurrentCost();
  • print(x);
  • globals.put(k, v) / globals.get(k).

Top-level variables persist for the run. Math.random uses the run's seeded generator. The full API, the sandbox and the trust prompt are in Simulation.

Delete and remove

Delete or Remove takes the selection off the diagram at once and keeps the entities; the note Removed from diagram. offers Undo and Delete Item…. ⇧Delete / Shift+Delete or Delete Item… asks first, then also deletes the entities. A single Undo takes back either one (see Remove and delete).

SelectionRemove takes off the diagram⇧Delete / Shift+Delete also deletes
Action, OR, SYNC or LOOPthe element and the elements inside itthe element's entity
Parallel or EXITthe construct and the elements inside itthe entities inside it
A branchthe branch and its elements; the last branch, or a loop body, removes the whole constructthe entities on the branch
Several elementsall selected elementstheir entities
Input/Output, Resource or Assetits links to the Actions shown herethe entity
Performer (× in the inspector)Remove Performer: "name" performs N Action(s) on this branch. Remove those performed by relationships too?Keep Relationships, Remove Relationships

Remove also removes the Action's decomposed by link to the root, so it is no longer a child. The entity and its other relationships stay.

Keyboard shortcuts

KeyAction
Delete or BackspaceRemove the selection from the diagram (the entities stay)
⇧Delete / Shift+DeleteDelete the selected entities from the project, after a confirmation
EscClear the selection
Shift+clickAdd to or remove from the selection
⌘Z / Ctrl+Z / ⇧⌘Z / Ctrl+Shift+ZUndo / Redo
Enter or Space on a palette itemInsert it (constructs at the end of the main flow, I/Os and Resources at the center)
⌘ / Ctrl+scrollZoom
Enter in the zoom fieldApply the typed zoom level
↓ / ↑ in Search diagramNext / previous match; Enter selects it, Esc clears the search

Options and settings

  • Show/hide (toolbar toggles and Arrange ▾): I/O, Resources, Assets, Parent I/O and Palette. Saved per diagram, and remembered in this browser as the default for new Action Diagrams. Defaults: I/O, Resources, Parent I/O and Palette on; Assets off.
  • I/O and Resource positions: saved per diagram. Reset them with Reset Position or Reset Input/Output and Resource Positions.
  • Zoom and position: saved per diagram. A diagram opens fitted, but at no less than 70%.
  • Read-only display: people with the Viewer role see the diagram without the toolbar edit groups, palette, handles or selection panel. They can pan, zoom, search and export.

Messages

MessageMeaning
Drop the construct on a flow line.Constructs and Actions can only be inserted on an arrow.
An element cannot go inside itself. Drop it outside.You dropped a construct inside its own branch, or tried to add the root or one of its ancestors.
"name" is already in this diagram.That Action is already in the flow.
Select a Parallel, SYNC or OR to add a branch+ Branch needs one of them (or one of its branches) selected.
Select the Action that produces the Input/Output first+ I/O needs an Action selected.
Select an Action to decompose, or shift-click several to group themDecompose needs an Action (not a construct).
Cannot group: the elements are on different branches. Select elements in one sequence.The grouped elements must share one sequence.
Cannot group: the elements are not adjacent. Select elements that follow each other.The grouped elements must be contiguous.
Grouped into a new child Action. Name it in the inspector.Decompose (group) succeeded.
Select an Action with a child diagram to flattenFlatten needs an Action with a child flow.
The child diagram is empty. Add Actions to it before flattening.The child Action has no children.
Cannot flatten: child control flow is malformed.The child flow refers to deleted entities; open it to repair it.
This group cannot be flattened: one of its children already appears at this level.Flattening would place an Action twice.
Iterations must be 1 or more. Enter a whole number of at least 1.Iterations below 1 are refused.
Branch probabilities add up to N %. Change them to total 100 %.Correct the OR probabilities.
"name" now performs the Actions on this branch.A Performer was set.
No Action here has a performer. Relate Actions to Assets (performed by), or drop a Performer on a branch.Generate Asset Diagram has nothing to place.
Created "name performers" with N Asset(s) and M Conduit(s).Generate Asset Diagram succeeded.
Drag an element here or click + ActionThe flow is empty.
This Action was deleted.The root was deleted.
✓ Checks on the diagram checks badgeThe checks found nothing.
… has no relationship to anything else on this diagram. … Connect it or remove it.A diagram checks finding (Orphans and cycles), with the reason: Input/Output "name" is not generated or received by any Action in this diagram., Resource "name" is not consumed, produced or seized by any Action in this diagram. or Action "name" has no Duration (simulates as 0).
The decomposition runs in a cycle: … Remove one of these decomposed by relationships.An Action is (indirectly) its own child.
View only: ask an owner for edit access.Your role on this project is Viewer.

Limits

  • One flow per parent Action.
  • An Action can appear only once in a given flow. Use a LOOP to repeat it.
  • Add or find… lists the first 60 matches in the project. Type more of the name to narrow it.
  • OR probabilities are whole percentages from 0 to 100.
  • Loop iterations are whole numbers of at least 1.
  • Durations are never negative in simulation: a sampled negative value is drawn again.
  • Box select selects annotations only. Use Shift-click for flow elements.