Prepare and approve a result
Load @posos/common 0.4.2 or later on a host supporting plugin contract 0.1.5.
This recipe prepares a total from a list and asks someone to approve it.
The plugin's catalogue contains the full operation descriptions.
- Add Liste, choose element type
Integer, operation Filtrer, and expressionitem > 1. Supply[1, 3, 2]toitems. - Add another Liste, choose
Integer, Agréger, Somme and expressionitem. Connect the first node'sitemsto the second node'sitems. - Add Calcul, declare an input
totalof typeDecimal, result typeString, and expression"Total: " + inputs.total. Connect the aggregate'svaluetototal. The result isTotal: 5. - Add Date et durée, operation Instant courant. Add Validation
humaine, type
String, titleRelire le total, messageDate : {at}and deadline60. Connect the calculation'svalueto the approval'svalue, and the date node'svalueto the message'sattemplate input. - Connect
accepted,rejectedandtimedOutto separate next steps. Only one is present.acceptedandrejectedcarry the submitted text;decisionalso carries the author, timestamp and optional comment. - Use Tester l’exemple in the calculation/list workshop to inspect outputs, then simulate acceptance, rejection and expiration before publishing.
Use the existing JEXL syntax, including transforms such as
(inputs.amount * 1.2)|round(2) for a Decimal calculation. Declare every input;
a missing optional result emits missing, while a wrong result type fails.
To transform every item, put the calculation inside the existing flow.map.
An empty list is valid. An empty sum is zero and emits empty; empty mean/min/max
emit empty without value, so wire that branch explicitly if it matters.
List operations accept at most 10,000 items. Date arithmetic uses fixed durations
and explicit timezones; one day is 24 hours, including across daylight saving.
A run's current instant is recorded once and reused on replay.
The approval's optional recipient is displayed in the request. It does not send a notification or restrict who may decide. Configure those responsibilities through your instance's existing adapters and access policy. Omit the deadline to wait indefinitely.