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.
On this page
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:
| Element | Shape | What it means | Entity |
|---|---|---|---|
| Action (serial step) | Rounded blue box with number and name | A step that starts when the previous element ends | A child Action of the root (decomposed by) |
| Parallel | A fork bar labelled parallel and a closing bar | Two or more branches that run at the same time. The flow continues when all branches finish. | None |
| SYNC | A block marked SYNC with a point on the right, and a closing bar | Parallel branches with an entity of their own. Its Duration is a timeout that stops unfinished branches. | An Action named "Sync Action" (control type SYNC) |
| OR | A block marked OR with a point on the left, and a closing circle | A decision: exactly one branch runs | An Action named "Or Action" (control type OR) |
| LOOP | An entry circle, the loop body, a block marked LOOP, a dashed return arrow | The body repeats while the continue condition holds. The condition is checked before each pass. | An Action named "Loop Action" (control type LOOP) |
| EXIT | A red box marked EXIT | Ends the enclosing LOOP (or the flow it sits in) when reached | None |
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
| Item | Shape | Relationship | Meaning |
|---|---|---|---|
| Input/Output | Parallelogram above the flow. Green when it triggers an Action, grey otherwise. | Action generates I/O; Action receives I/O | Information, data or material passed between Actions |
| Parent Input/Output | Parallelogram labelled parent input (left of Start) or parent output (right of End) | The root Action receives or generates it | The interface of the parent Action. Drawn dashed while no child Action uses it. |
| Resource | Purple hexagon below the flow | Action consumes, produces or seizes Resource, with an Amount | A quantity that Actions use up, return or create |
| Performing Asset | ⟂ and the Asset name under the Action name | Asset performs Action | Who or what carries out the Action. Shown when Assets is on. |
| Performer | ⟂ and the Asset name on a Parallel or SYNC branch | Asset performs every Action on the branch | A 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:
- Open Diagrams at the bottom of the rail.
- Click + New Diagram.
- Under Diagram type, pick Action Diagram (in the Behavior group, tagged LML).
- In Root, type the name of the new Action, for example
Run Nominal Imaging Pass. (Give it a number such asOPSlater in the inspector.) - Click Create.
You see Start and End, and the hint Drag an element here or click + Action.
Add steps in sequence:
- Click + Add ▾ → + Action ▾ → New Action….
- Type the name in Add Action.
- 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.
- 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:
- Select the step after which the parallel steps start.
- Click + Add ▾ → + Sync.
You see a SYNC with two empty branches.
- Click a branch line to select it.
- Click + Add ▾ → + Action ▾ → New Action… to add a step to that branch.
- 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:
- Select the step before the decision.
- Click + Or.
- Enter the question, for example
Contact in view?.You see two branches, Yes and No, at 50% each.
- Select the OR and set the guard names and probabilities in the inspector.
Repeat a step:
- Select the step.
- Click + Add ▾ → + Loop.
- Enter the loop name.
You see the step wrapped in a loop that runs twice.
- Set the number of iterations, or another condition, in the inspector.
Set durations and check the result:
- Select an Action.
- Fill in Duration in the inspector's Schedule group.
- To give several Actions the same Duration, Shift-click them and set Duration (N Actions) in the inspector.
- 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.
- 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.
- Type the name.
- Drag Parallel, Or, Sync, Loop or Exit onto a line in the same way.
- 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.
- Drag Resource onto an Action. This creates a Resource that the Action consumes (Amount 1). Drop it on empty canvas to place it unconnected.
- 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:
- Type a name in Add or find…. In the project lists the matching Actions, Input/Outputs, Resources and Assets.
- 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:
- Select the first Action.
You see a green handle above it.
- Drag the handle onto the second Action.
While you hover, the target box shows two halves.
- 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.
- 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:
- Select the Input/Output.
- Drag its handle (below the shape) onto the Action.
- 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:
- Select the Resource.
- Drag its handle (above the shape) onto the Action.
- 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:
- Select the Action.
- In the inspector's Trace section, find the Resource under consumes, produces or seizes and click Attributes.
- 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:
- Select the Action and choose Open in ▾ → Item View. (On the diagram, performed by is locked in the inspector, because the diagram manages it.)
- In the Trace section, add performed by with + → Link existing….
- 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:
- Select the Action.
- Click Decompose.
That Action's own Action Diagram opens.
- Build its child flow there.
- 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:
- Shift-click two or more elements that are next to each other on the same line.
- 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.
- Type the new name.
Flatten a child flow back into this diagram:
- Select a decomposed Action.
- Click Flatten (in the toolbar or the inspector).
Its child flow replaces it in this diagram.
- 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
- 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.
- Fix what the check reports.
- 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.
- 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.
- Create the demo project with Manage Projects → Project Files ▾ → New Demo Project.
- Open the diagram from Behavior → Action Diagrams.
The flow runs as follows:
- 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).
- 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.
- A LOOP named Each target runs OPS.6 Capture Image Strip and OPS.7 Encode and Store Image four times (Continue (×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.
- 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:
- 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%.
- Select the LOOP and set Number of iterations to 6.
The loop text reads Continue (×6).
- 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.
- Turn on Assets to see each performer.
- 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
| Symptom | Cause | Fix |
|---|---|---|
| Drop the construct on a flow line. | A construct or Action was released on a shape or empty canvas | Release it on an arrow between elements |
| Branch probabilities add up to 90 %. Change them to total 100 %. | OR probabilities do not add up | Correct the percentages, or add a branch |
| The simulation never ends (deadlock) | An Action waits for a triggering I/O that nothing generates on this path | Make the input Optional, or generate it on every path |
| An Action takes no time in the simulation | No Duration, or the Action is decomposed (its child flow runs instead) | Set its Duration, or add durations to its children |
| A step seems to vanish | It was removed from the diagram but kept in the model | Type 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 Performer | Assign 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.
Page header
- 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.
| Group | Control | What it does |
|---|---|---|
| Mode | Pan | Drag the background to move the view (the default). |
| Mode | Box select | Selects 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 | + Sync | Adds a SYNC with two empty branches. |
| Insert | + Or | Asks for the Decision name (a question) (default Or Action), then adds an OR with branches Yes and No at 50%. |
| Insert | + Loop | Asks 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 | + Exit | Adds an EXIT after the selection. |
| Insert | + Branch | Adds 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/O | With 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. |
| Edit | Undo, Redo | ⌘Z / Ctrl+Z, ⇧⌘Z / Ctrl+Shift+Z. |
| Edit | Connect… | 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. |
| Edit | Remove | Remove 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. |
| View | Search 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. |
| View | Contents | Diagram Contents: the shapes, connections and relationships as text. |
| View | Configure | Shows the root and diagram type in the inspector, to switch either in place (see Configure: root and type). |
| View | Arrange ▾ | See Arrange ▾ below. |
| View | Diagram checks badge | Orphans and cycles plus the Action Diagram checks (see Messages), listed in the inspector with Show. |
| View | I/O, Resources, Assets, Parent I/O | Show 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 actions | Decompose / Decompose (group) | One Action selected: open its child Action Diagram. Several elements: group them into a new child Action. |
| Type actions | Flatten | Replace the selected decomposed Action by its child flow. |
| Type actions | Open | Opens 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. |
| Output | Export… | 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 ▾
| Item | What it does |
|---|---|
| Restore Defaults | Clears manual I/O and Resource positions. |
| Show / Hide | Hide 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 Positions | Returns every moved I/O and Resource to the automatic layout. |
| Generate Asset Diagram | Creates "root performers", see Generate Asset Diagram. |
| Open as FFBD | Opens the same flow as a Functional Flow Block Diagram. |
| Diagram Settings | The 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 Panel | Hides 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:
| Item | Drop on | Creates |
|---|---|---|
| Action | A line | A new Action "New Action" |
| Parallel | A line | Parallel branches (no entity) |
| Or | A line | An OR Action entity with Yes/No branches |
| Sync | A line | A SYNC Action entity |
| Loop | A line | A LOOP Action entity (empty body, 2 iterations) |
| Exit | A line | An EXIT |
| Input/Output | An Action, or anywhere | A new I/O named "I/O", generated by the Action when dropped on one |
| Resource | An Action, or anywhere | A new Resource named "Resource", consumed (Amount 1) when dropped on an Action |
| Performer | A Parallel or SYNC branch line | Asks 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
| Gesture | Result |
|---|---|
| Click a shape | Select it; the inspector shows it |
| Shift+click | Add or remove an element from the selection |
| Click a line | Select the branch it belongs to (or clear the selection on the main line) |
| Click the background | Clear the selection |
| Drag an Action or construct onto a line | Move it there (with everything inside it) |
| Drag an I/O or Resource | Place it freely |
| Drag the green handle | Connect (see Connect Input/Outputs and Resources) |
| Double-click an Action | Open its child Action Diagram when it is decomposed, else its Item View |
| Double-click an I/O or Resource | Open its Item View |
| Click the decomposed icon | Open the child Action Diagram |
| Drag the background | Pan |
| Scroll / ⌘ / Ctrl+scroll | Pan / 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.
| Selection | Extra actions |
|---|---|
| Action | Action Diagram, Edit Script…, Flatten (when decomposed), Remove and Delete Item… |
| Input/Output or Resource that was moved | Reset Position |
| Parent I/O that is decomposed into child I/Os | Show Parent Input/Outputs shows its children in place of it; Hide Parent Input/Outputs returns |
| Any | Remove 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 diagram | In the model |
|---|---|
| Root of the diagram | The parent Action |
| Action box | Child Action: parent decomposed by child |
| OR, SYNC, LOOP block | Child Action with a control type, decomposed by the parent |
| Order, branches, loops | The flow structure saved with the parent (the order in which children run) |
| Line from an Action to an I/O | Action generates Input/Output |
| Line from an I/O to an Action | Action receives Input/Output, with the relationship attribute Trigger (Yes = trigger, No = optional) |
| Line between an Action and a Resource | consumes, produces or seizes, each with the attribute Amount |
| ⟂ Asset | Asset performs Action (inverse performed by). The relationship attribute Amount is the number of that Asset the Action occupies. |
| Duration on a box | The Action's Duration attribute (a number or a distribution, with a unit) |
| Child flow | The 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:
- Select an Action, OR, SYNC or LOOP.
- Click Edit Script… (Action) or Edit Script…/Add Script… (OR, SYNC, LOOP).
- Click Add onStart(), Add prompt(), Add onEnd() or Add duration() to insert an empty hook function.
- Write the code. Tab inserts two spaces.
- 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 returnstrueto 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).
| Selection | Remove takes off the diagram | ⇧Delete / Shift+Delete also deletes |
|---|---|---|
| Action, OR, SYNC or LOOP | the element and the elements inside it | the element's entity |
| Parallel or EXIT | the construct and the elements inside it | the entities inside it |
| A branch | the branch and its elements; the last branch, or a loop body, removes the whole construct | the entities on the branch |
| Several elements | all selected elements | their entities |
| Input/Output, Resource or Asset | its links to the Actions shown here | the 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
| Key | Action |
|---|---|
| Delete or Backspace | Remove the selection from the diagram (the entities stay) |
| ⇧Delete / Shift+Delete | Delete the selected entities from the project, after a confirmation |
| Esc | Clear the selection |
| Shift+click | Add to or remove from the selection |
| ⌘Z / Ctrl+Z / ⇧⌘Z / Ctrl+Shift+Z | Undo / Redo |
| Enter or Space on a palette item | Insert it (constructs at the end of the main flow, I/Os and Resources at the center) |
| ⌘ / Ctrl+scroll | Zoom |
| Enter in the zoom field | Apply the typed zoom level |
| ↓ / ↑ in Search diagram | Next / 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
| Message | Meaning |
|---|---|
| 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 them | Decompose 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 flatten | Flatten 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 + Action | The flow is empty. |
| This Action was deleted. | The root was deleted. |
| ✓ Checks on the diagram checks badge | The 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.
Related pages
- Diagrams: the shared editor, exports and annotations.
- Functional Analysis: functions, the FFBD and its tables.
- Simulation: Discrete Event and Monte Carlo runs, scripts and results.
- SysML Diagrams: the Activity and Sequence Diagrams built on the same Actions.
- Other Diagrams: Asset, Timeline, IDEF0 and N² Diagrams.
- Help: Build an Action Diagram, Action Diagram, Simulation Scripts.