Private beta, by invitation. It may change without warning. While the beta lasts, some paid features are free. See pricing

trumlyspec GitHub
Try trumly

← Packs

logic

VerifiedEnrichment0.1.1

Use when: When the order of events matters and getting it wrong is a bug: concurrency, permissions, retries, or anything an agent would otherwise guess.

How the application actually works, in order: the flows a request or a person goes through, the decisions along the way, and the lifecycles things move through (a lock, an invite, a job). The core says what the parts are; this pack says what they do and when. Rules ask that every flow starts somewhere, every step leads on, every decision has labelled branches and every lifecycle has one first state.

Add it

Open it in trumly cloud to start a project with this pack already in. In an existing project, open the editor's Packs tab, choose logic, then Add. Nodes you change after adding are kept when the pack is upgraded.

From a known source. Reviewed by us, and the publisher is known.

Explore is a read-only demo in your browser: nothing to sign in to, and nothing is saved.

Namespace
lgc--
Size
24 nodes
Needs
core@^1.0.0
Works with
api@^0.3.0, data-model@^0.6.0
Enriches
capability, requirement, component, interface
Publisher
trumly
Versions
0.1.1·0.1.0
Checksum
ea3b2374b7b82ea7…

Examples 1

  • Listing jobsA starting point

    A flow for listing every job, with a decision on whether the database answers, and a lifecycle for a job from queued to done, with retries.

    27 nodes17 typesneeds core

    Show the 27 nodes
    • Jobs listedacceptance-criterionacceptance-criterion-jobs-listed
    • Ops staffactoractor-ops-staff
    • View job statuscapabilitycapability-view-job-status
    • Ops APIcomponentcomponent-ops-api
    • Ops dbdatastoredatastore-ops-db
    • Productionenvironmentenvironment-production
    • List jobsflowflow-list-jobs
    • Timely ops visibilitygoalgoal-timely-visibility
    • Live job statusincrementincrement-live-status
    • Joblifecyclelifecycle-job
    • Job status agemetricmetric-status-freshness
    • Ops APIoverviewoverview
    • List jobsrequirementrequirement-list-jobs
    • Abandonedstatestate-abandoned
    • Donestatestate-done
    • Failedstatestate-failed
    • Queuedstatestate-queued
    • Runningstatestate-running
    • Ask the API for jobsstepstep-ask-api
    • Open the job liststepstep-open-list
    • Does the database answer?stepstep-read-db
    • Show an errorstepstep-show-error
    • Show every jobstepstep-show-jobs
    • Devteamteam-dev
    • Platformteamteam-platform
    • Build status APIwork-packagework-package-build-status-api
    • Provision databasework-packagework-package-provision-database

Patterns 1

Small fragments you lift into a project of your own. In the editor or through an agent, insert one under its root node.

  • Starter flowA flow with a start, one action and an end. Add it for each scenario whose order matters, then rename the steps and add the decisions.Hangs from a flow.

Planes 2

  • Flows
  • Lifecycles

Types 4

  • flowUse for one scenario from the thing that sets it off to how it ends, such as opening a node or adding a person to a project. Its steps are its children.
  • lifecycleUse for something that moves through states over its life, such as a lock, an invite or a job. Its states are its children.
  • stateUse for one state of a lifecycle, such as free, held, queued or failed.
  • stepUse for one thing that happens in a flow: it begins, someone or something acts, a choice is made, it waits, or it ends. A decision's outgoing `next` links each say when they are taken.

Link types 6

  • begins-atflow, lifecycle → step, stateUse to say which step a flow begins at, or which state a lifecycle begins in.
  • bystep → actor, component, external, team, datastoreUse to say who or what does a step.
  • enforcesstep, state → requirement, constraintUse to say that a step or state carries out a requirement or constraint, so the rule is written once.
  • moves-tostate → stateUse to say that a state can be followed by another. Say what causes it in `on`, and any condition in `guard`.
  • nextstep → stepUse to say which step can follow this one. A decision gives each branch a `when`.
  • touchesstep → interface, queue, datastore, api-endpoint, api-event, data-tableUse to say what a step works on. Say how in the link's `how`: call, read, write, publish or subscribe.

Rules 12

  • WarningEvery action says who or what does it
  • ErrorEvery decision has two or more branches and each says when it is taken
  • WarningA final state has no way out
  • ErrorEvery flow begins at exactly one start step
  • WarningEvery flow details or satisfies something in Define
  • ErrorEvery lifecycle begins in exactly one initial state
  • WarningEvery state that is not final has a way out
  • WarningEvery state except the first is reached from another state
  • ErrorEvery step except an end has a step that follows
  • WarningEvery step except the start is reached from another step
  • WarningA step only leads on to steps of its own flow
  • ErrorEvery move between states says what causes it