Skip to main content

Model, validate, and deploy

Use the Modeler tutorial to learn the editor. This guide covers decisions you make when preparing a model for a server.

Connect the Modeler to the server and choose Validate, or send the exact BPMN XML as Content-Type: application/xml to POST /api/v1/model-validations. Preflight leaves the stored versions unchanged. It can identify unsupported structure, missing runtime capabilities, unresolved roles or handlers, and behaviour findings.

Read the structural diagnostics and each behaviour result. A concrete counterexample demonstrates a violation under the stated analysis assumptions. An abstract trace shows a possible route that depends on an assumption such as an unknown guard value. This leaves the property undecided. A search limit can also leave a property undecided. A demonstrated violation of a required property blocks deployment, and undecided results produce warnings in the default profile. Inspect any undecided result before using the model in a scenario that depends on that property. Compare the example verdicts.

Choose Validate and deploy, or send the XML to POST /api/v1/deployments with model-management permission. The server validates again and creates a new version only on success. The BPMN target namespace and process ID identify the model. Every successful deployment under that identity creates a distinct version, including when the XML is identical.

Use GET /api/v1/models/{modelId}/versions?includeArchived=true to list versions visible to a model manager. Archive with POST /api/v1/model-versions/{versionId}/archive and restore eligibility with POST /api/v1/model-versions/{versionId}/reactivate. Both take no body. Archive stops new starts on that version while existing instances keep it. Inspect the versions before repeating a deployment whose response was lost.

Declare scalar fields, then map task inputs and outputs directly to fields of the matching type. Long and decimal values use exact strings at the HTTP boundary. An unset field and a value of the wrong type have different consequences. An activity can wait for required input. An expression can also fail when evaluated against invalid or missing data.

At an exclusive split, put a condition on each non-default route. Getriebe tests those routes in declared order. Use an unconditioned default to handle the case where every evaluated condition is false. See the expression dialect for syntax.

Set a User Task’s Potential owner role to offer the task to eligible members of that role. The server resolves the key at deployment, then checks membership before a claim. Use Assigned person field for a direct personal assignment. The field contains the account ID. If you also specify a role, the selected person must satisfy that requirement at assignment time. Personal work appears already assigned. Follow the task assignment contract when implementing clients that handle both modes.

Choose Create expanded sub-process in the palette. Connect its outer Sequence Flows to the Sub-Process shape. Inside, add one None Start Event and at least one End Event. Parallel paths can each reach a separate None End Event. The surrounding flow continues after every internal path and activity has finished. A Terminate End Event can end the whole scope earlier. Try both orders in the WCP-11 example.

Use the native change-element menu to switch to a collapsed Sub-Process. Open it with the drill-down arrow. In the properties panel, Local fields declares data for that execution. Internal task bindings can select those fields and fields from enclosing scopes. When the process enters the Sub-Process again, it gets fresh local values. See the embedded Sub-Process contract.

Take review-round.bpmn, order-approval-with-shared-review.bpmn, and investment-approval.bpmn from apps/server/examples/ in the TypeScript server checkout or distribution. Open the files in Modeler using a Call Activity-enabled server. The Getriebe integration example runs Modeler and Getriebe Admin on the same origin as the API. In Admin, create the budget-reviewer, purchasing-reviewer, compliance-reviewer, and senior-reviewer roles and assign accounts. The demo provides the requester and reviewer roles and the confirmation reminder handler.

  1. Open Review round and choose Validate and deploy. Its input is amount (decimal), and its output is approved (boolean).
  2. Open Order approval with shared review and a confirmation deadline. To build the call yourself, add a native Call Activity from the palette and choose ReviewRound under Target model. Map orderAmount to amount and map approved to the order’s approved field. Choose Save call activity.
  3. Validate and deploy the order, then do the same for Investment approval. Its call maps investmentAmount and investmentApproved to the same process interface.
  4. Get the caller’s modelId from the deployment response or from GET /api/v1/models, matching its namespace and process ID. Sign in as requester in the demo, or as an account with process_start. Send POST /api/v1/models/{modelId}/instances with {"data":{"orderAmount":"9500"}} for an order or {"data":{"investmentAmount":"9500"}} for an investment.
  5. In each reviewer’s session, list their tasks with GET /api/v1/worklist?instanceId={instanceId}. Claim one with POST /api/v1/tasks/{taskId}/claim, then submit {"attemptId":"<claimed-attempt-id>","result":{"reviewVote":true}} to POST /api/v1/tasks/{taskId}/complete. Use the session and CSRF contract for authenticated requests. The instance history identifies the call, its bound version and its return.

For offline editing, enter the namespace urn:getriebe:review-round, process ID ReviewRound, and import location review-round.bpmn. Add the decimal input and boolean output by name and map them to same-type local fields. Export and reopen to inspect the saved bindings. When connected, use Validate to check the target and ports before deployment.

Stage Order approval Investment approval
Call starts Copies the current orderAmount. Copies the separate investmentAmount.
Caller waits Review round opens budget and purchasing tasks at 9,500. At 10,000 it also opens a compliance task. Its own review round uses the same thresholds and the same bound model version.
Review round returns approved Approval opens confirmation with reminder and escalation. Rejection opens revision. Resubmission starts a fresh review execution for the revised amount. The result is saved to investmentApproved and the instance completes.

Deploying another version of Review round leaves these callers on their recorded versions. Redeploy a caller when you want to bind the current startable target. The server reference shows how to inspect the binding. The evidence index records the tested walkthrough.

Use an Error End Event in the called process when a modeled outcome should interrupt the call. In the Modeler’s native Error properties, create or select a local Global error reference and enter its Code. Select the caller’s Call Activity, choose Add error boundary event, give that event a local Error reference with the same code, and connect its outgoing flow to the recovery step. The XML IDs can differ across files. The exact code matches the throw to the catch.

The bundled offline profile supports both events. When connected, the Modeler follows the server’s advertised bpmn-error capability. Export both files, deploy the called process first, then validate and deploy the caller to bind its target version. A validation finding for an invalid Error Event identifies the BPMN element to correct.

Run pnpm example:order-revision from the TypeScript workspace with its dependencies installed. The script starts an isolated SQLite demo server, registers the order-revision reader, deploys the two BPMN documents and prints the outcomes, the called version and the fresh task IDs. It uses sample order data in memory.

In the review process, collect the votes for the submitted revision, read the current revision, then compare the two before tallying. When the revision has changed, end the review with REVIEW_BASIS_CHANGED. In the order process, the Error Boundary Event opens Resubmit order. The next submission uses the updated amount and revision.

The unchanged example reaches Confirm order with its regular approved result. A regular rejection opens Revise order. The changed example advances from revision 1 to 2 before the last vote. Its error path has no returned approved value. Resubmitting at 12,000 creates three fresh review tasks with new execution and task IDs. The caller’s originally bound review version is used even after a newer review version is published. The administration guide explains how to find the Error End Event, handler and call path.

Download Order approval with parallel reviews and a confirmation deadline and open it in the Modeler. Inside Review round, select Determine required reviews and choose Edit decision table. The native editor shows a Unique table with two rules.

Order amount Required review kinds
< 10000 ["budget", "einkauf"]
>= 10000 ["budget", "einkauf", "compliance"]

The task’s input maps the process field amount to the decimal port. Its output maps the ordered list to the Sub-Process’s local reviewKinds field. Use the task’s Inputs and Outputs controls to inspect or change these bindings. Type a literal list of strings in each output cell. Keep each boundary value in exactly one row. Choose Apply, then Export BPMN to save the table with the diagram. Reopen the export and use Edit decision table to check both rules again. Keep the 10,000 threshold for the walkthrough below.

Select Review order. In Multi-instance review, the reviewKinds list supplies the role-bound tasks and the reviewVotes list collects their Boolean results. Both lists are local to the round. Evaluate votes is a Script Task in the Getriebe expression dialect. Its input binds the local Boolean list as reviewVotes. The expression all(reviewVotes) writes its Boolean result to approved in the enclosing process.

Review kind Role key
budget budget-reviewer
einkauf purchasing-reviewer
compliance compliance-reviewer

The deployable model also needs requester, reviewer and senior-reviewer. Review team holds the parameterized role binding. For a different model, add decimal and string-list mappings on its Business Rule Task before opening the Unique template.

Start the local demo and download the example runner. The runner uses the standard demo accounts and creates the additional local reviewers.

Terminal window
node run-workflow.ts parallel-review prepare

Connect the Modeler as the demo administrator and choose Validate and deploy for the reopened BPMN export. Then run both scenarios.

Terminal window
node run-workflow.ts parallel-review approve
node run-workflow.ts parallel-review revise

Set GETRIEBE_DEMO_PORT when the server uses a different port. Both scenarios submit 9,500 EUR and start a budget and a purchasing task. In the revision scenario, purchasing rejects the order. In Revise order, the requester changes the amount to 10,000 EUR and resubmits. The same process instance opens a new round with a compliance task alongside two fresh budget and purchasing tasks. Every review in that round reads the revised amount.

To run it manually, start as requester with {"amount":"9500"} in the start request’s data. Use the budget and einkauf accounts to claim their Worklist tasks and submit {"reviewVote":true} and {"reviewVote":false} as their results. As requester, claim Revise order and submit {"amount":"10000"} as its result. For the new round, use all three accounts (budget, einkauf, and compliance) to claim their tasks and vote true. Server integration guide.

Use the process instance ID printed by parallel-review revise. Read the top-level versionId and decisionHistory in GET /api/v1/instances/{instanceId} as the requester. The entries show standardReviews and extendedReviews in order. Their execution IDs and Sub-Process paths identify the two rounds. Server HTTP API.

When every vote in a round is true, Confirm order opens with a one-minute deadline for the reviewer account. The runner completes that task. To try the timeout in the Worklist, leave the task open until Senior sign-off appears for senior-reviewer. See the Business Rule Task profile and the parallel review and decision evidence.

Open Order approval with sequential position reviews in the Modeler and select Review order position. In Multi-instance review, choose Sequential. Set the input collection to orderPositions with local item position, and the output collection to reviewVotes with local result reviewVote. Choose Fixed role and select purchasing-reviewer. The diagram uses the BPMN marker with three horizontal lines. Export and reopen the file to inspect the same settings.

Run the example from the TypeScript workspace with its dependencies installed.

Terminal window
pnpm example:sequential-order

Open the printed Worklist URL and sign in as purchasing-1. Use the username as the password. Claim and open each current task. The form displays the position, order number and amount with currency.

Position Vote Next open task
Pos-10 Accept position Pos-20
Pos-20 Reject position Pos-30
Pos-30 Accept position Revise order for the requester

You can claim a later position as purchasing-2 in a separate browser session. After the last vote the instance has reviewVotes: [true, false, true] and one revision task. Sign in as requester with the matching password to see that task in the Worklist.

For an order that can be reviewed concurrently, select Parallel. Use Lookup by item when each input item selects a different declared role. Both settings process every input item. To impose a deadline on the round, put the task in an embedded Sub-Process and attach an interrupting Boundary Timer to the Sub-Process. The current task is withdrawn at that deadline and the unfinished collection stays unpublished. See the sequential review evidence.

Confirm an order with reminder and escalation

Section titled “Confirm an order with reminder and escalation”

Run the combined order example with the demo accounts. The shared-review order uses the same confirmation scope. Its demo handler records a successful Send confirmation reminder invocation in the Service Task history.

  1. For the combined order, start as requester with {"amount":"9500"}. Claim and approve the budget and purchasing reviews as budget and einkauf. Confirm order opens with the one-minute deadline in the Worklist.
  2. Confirm before 30 seconds. The pending reminder expires and the order completes. In a fresh instance, wait 30 seconds and inspect reminderHistory and serviceTasks in the instance detail. The reminder has started and you can still complete the original task.
  3. To observe a running reminder, use a demonstration handler that waits before returning. Confirm while the handler is running. The Terminate End Event withdraws the work and approves the order immediately. The Service Task history shows the withdrawn attempt.
  4. Leave confirmation open for one minute. The outer deadline withdraws the confirmation scope and opens Senior sign-off. Claim and complete that task as senior-reviewer. If you revisit the original confirmation, its history identifies the event that withdrew it.

To reproduce the restart case, run with durable SQLite, stop the server after Confirm order opens and restart after its one-minute Worklist deadline. The stored scope deadline wins when both timers are due and Senior sign-off appears without a reminder firing.

To model the reminder, select Confirm order and choose Add deadline. On the Boundary Timer, turn off Interrupt activity and set Duration to PT30S. Connect the event to Send confirmation reminder inside Await order confirmation. Its dashed border shows that the task stays open when the timer fires. Connect Confirm order to the inner Terminate End Event so completing confirmation withdraws outstanding reminder work. Select Await order confirmation and choose Edit deadline to edit its interrupting one-minute escalation. Explore both exits in Cancel Region.

Add a Script Task and select a Script language. Use Add input mapping and Add output mapping to bind the inputs and the single output. Enter Script source using the input port names. In the order example, all(reviewVotes) returns true for unanimous votes and false when any vote rejects the order.

Download Evaluate votes with JavaScript to try the same calculation with text/javascript. The function body is return inputs.reviewVotes.every(vote => vote === true);.

  1. Start the Effect server with GETRIEBE_JAVASCRIPT_SCRIPT_TASKS=true.
  2. Open the BPMN file in the Modeler, connect to that server as the demo administrator, and choose Validate and deploy.
  3. As the requester, send {"versionId":"<deployed version ID>","data":{"reviewVotes":[true,false]}} to POST /api/v1/models/{modelId}/instances. Follow the session and CSRF setup for HTTP requests.
  4. Read GET /api/v1/instances/{instanceId} using the returned instance ID. Expect status: "completed" and data.approved: false. Votes [true,true] give data.approved: true.

The connected server determines which languages the Modeler offers. You can open and export a task with a disabled language and see the diagnostic at that task. For configuration and error details, see the Script Task server reference and the Node embedding guide.

Select a User Task and choose Add deadline. Set its Duration and connect the Boundary Timer’s outgoing Sequence Flow to the timeout path. Use a User Task for the escalation when another person needs to take over. If the paths converge, merge the regular and timeout alternatives with an exclusive gateway before a shared continuation. Inside a synchronized parallel branch, both alternatives must reach that branch’s join.

A timer can attach to a User Task that repeats through the process graph. The combination with Standard Loop Characteristics on the same task is outside the supported profile. Validate against the server that will run the model. It must advertise boundary-timer. See the BPMN profile and the order deadline tutorial.

For an outbound HTTP call, select HTTP / REST (v1) under Service implementation and choose a named Connection from the server profile. Set the method and relative path. Use typed input and output mappings for the request and response fields. Follow the Connectors guide to run the same BPMN against two targets.

For a service implemented in your server composition, set a Handler key and declare matching input and output names and types. The server composition registers that key with defineServiceHandler or defineEffectServiceHandler. Deployment checks the binding. When the task activates, the handler receives frozen inputs and a context with the attempt ID. The server accepts the result only for the current attempt and applies valid output mappings to the process data. For an example, see the automatic amount check.

Declare a Service Task Operation and catch a fault

Section titled “Declare a Service Task Operation and catch a fault”

Open the diagram with its local XSD files. In BPMN Operation, select an Operation from this model or use Add Operation. Pick an Interface, a request Message, an optional success response Message, and the explicit BPMN Errors that the service can report. A second Service Task can select the same Operation and bind its own process fields.

Map required request and response fields to process fields of the same type. The editor creates a structured Data Input and, when the Operation has a success response, a structured Data Output. It records the direct field assignments in standard BPMN. Select Add error boundary event on the Service Task, choose an Operation Error, and connect its outgoing flow.

Validate against a server that advertises service-operation and bpmn-error for the boundary. To map an HTTP response to a declared Error, also use a server with http-service-fault. Follow the delivery reservation example to see the success and recovery paths.

Open the BPMN diagram and its local XSD files together. The XSD type must describe a flat payload with named scalar fields. Each Message uses a full versioned ID such as PurchaseOrderIssued.V1. Set a new ID when the payload’s field names, types or requiredness change.

Select a Message Start Event, Send Task or Message Catch Event. In Message contract, select a declared Message or use Add message to create one from an attached XSD type. The field selector offers compatible process fields for each payload field. The model stores BPMN ItemDefinitions, Imports, Data Associations and XPath Assignments.

For a supplier exchange, connect the Send Task and Catch Event to the same external participant with Message Flows. Use Correlation on the Send Task to select the reply event and a required string from both payloads. This creates the Conversation grouping and CorrelationKey. An Event-Based Gateway can branch to the Message Catch Event and a Timer Catch Event. Each branch target has just the incoming flow from the gateway.

Validate or deploy to send the BPMN and schema files together. A loaded server version restores the schemas. Export the BPMN and use XSD files to save its schemas for offline work.

Try the purchase order walkthrough for a working model.