Repository navigation
feat(vscode): search instances by process variables - #473
Merged
Merged
Conversation
✅ Deploy Preview for spectacular-cobbler-f6c85b ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
InstanceFilter takes AND-combined variable conditions (equals, notEquals, greaterThan, lessThan with a valueJson, like with a * pattern). Nine read laws pin the semantics on the fake and on Operaton, CIB seven and Camunda 7, nine saboteurs prove they bite. The C7 adapter maps them to variables of the historic process instance query. Refs #456
…core InstanceListFilter carries up to five variable conditions as text with an optional type. VariableConditionRules holds the type inference, the operators per type and the chip label for the guard, the core and the webview alike. Counts, select all matching and the cancel confirmation follow the conditions, and a version switch keeps them. Refs #456
A Variables button in the filter bar opens a modal dialog for one condition: name, compare as, operator and value. Each condition becomes a chip that edits or removes it; the conditions survive scope changes, the element filter and the business-key search. Escape closes the dialog without clearing the selection, and an empty result offers to clear the conditions. Core labels the chips; the dialog's operator table, number pattern and cap are held equal to the protocol's rules by a test. Closes #456
- Keep the variable chips below 760 px, so a narrow panel still shows, edits and removes every condition. - Move focus to the first invalid field after the errors render, and back to the chip that opened the dialog when it closes. - Pin that notEquals finds a value of another type, as all three engines do, with a law and a saboteur. - Say in the empty list that an engine without variable history finds none. - Derive the guard's operators and types from VariableConditionRules, reuse the view's labels in the cancel confirmation, cap the name at 255 like the guard, and record the protocol change in architecture.md. Refs #456
Compare as offers Date and time and Null besides text, number and true or false. A date condition carries an IsoTimestamp in the contract and compares points in time; C7 sends it in UTC in the engine's date format, the only form the engine reads as a date. Null compares with null and never finds a missing variable. The dialog says that JSON and object variables cannot be searched, because the engine keeps their value serialized. Two laws, two saboteurs and a date and a null variable on ORD-1002 pin it on all three engines. With conditions the filter bar wraps into a second row instead of cutting the chips. Refs #456
The filter bar opens the variable dialog from a funnel button named "Filter by variables", with the count of conditions beside the icon. Opening it sends suggestVariableNames; the core reads listVariableNames once per version and puts the names into the view, and the name field offers them in a datalist while it still takes any text. listVariableNames is a new read of the contract: the names of the variables the instances of a version hold, at any scope, sorted and once each, pinned by a law and two saboteurs. C7 reads them from the history of the newest 50 instances. Refs #456
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The instance list of a definition can only be searched by business key. Finding an order by customer or amount meant switching to the engine's web app. This adds a search by process variables, in the engine-neutral contract with its conformance laws and in the definition panel.
What
InstanceFilter.variablestakes conditions that must all hold:equals,notEquals,greaterThanandlessThancarryvalueJson, so big integers stay exact and42never matches the text"42".nullfinds a variable whose value is null, never a missing one.at, anIsoTimestamp, and compares points in time; text never matches a date.likecarries apatternin which*is the only wildcard.notEqualsnever finds an instance without the variable, and a value of another type counts as different.listVariableNames(definitionId): the names of the variables the instances of a version hold, at any scope, sorted and once each. It is a hint for the dialog, not a complete list.dueAt) and a null variable (giftNote). Fourteen saboteurs prove the laws catch a broken runtime. The shared sabotage helpers moved totest/contract/support/sabotaged-runtime.ts.VariableConditionMappermaps the conditions tovariablesof the historic process instance query. It parses values withLosslessJson, sends a date in UTC in the engine's date format (2026-03-15T10:00:00.000+0000, the only form the engine reads as a date), escapes\,%and_in patterns and turns*into%.VariableNameReaderreads the names from the history of the newest 50 instances of the version (historic-variable-instance query --no-deserialize-values).InstanceListFilter.variablescarries up to 5 conditions as text with an optional type.VariableConditionRuleshandles the types: Automatic, Text, Number, True or false, Date and time, and Null. Automatic implies text forlikeand a number for>/<. It also labels the chips.MessageGuardsdrops a condition that does not fit its type.suggestVariableNamesloads the names of the shown version once intoDefinitionView.variableNames. A failed read suggests nothing.<dialog>for one condition, with inline errors and focus on the first invalid field.suggestVariableNames. The core reads the names once per version, and the name field offers them in adatalistwhile it still takes any text.datetime-localfield and offers is after and is before. Null asks for no value and offers is null and is not null. A hint says that JSON and object variables can't be searched.InstanceFilter.composenow keeps the conditions, so a scope change or a business-key search no longer drops them.runtime-contract.md,c7-adapter.md(date format, history level AUDIT, JSON and objects not searchable),user-interface.mdandarchitecture.md, the contract README, the architecture overview anddocs/vscode/usage.md.Verification
test:enginespasses 61/61 against Operaton 2.1.5, CIB seven 2.2.0 and Camunda 7.24.0.\_escaping works,neqskips instances without the variable and number42matches an Integer variable but the text"42"does not.route ≠ 42finds text values too, which the notEquals law now pins.yyyy-MM-dd'T'HH:mm:ss.SSS+0000format. JSON and Object variables match no condition,likeincluded.pnpm build,pnpm typecheck,pnpm test,pnpm lint(incl. ratchets, architecture rules, knip) andpnpm format:checkpass.pnpm test:mutationscores 84.52 on the changed files, above the threshold of 79.VariableConditionRules.test:e2e,docs:screenshotsand a manual check in the sandbox.Out of scope / Follow-ups
atLeast/atMostoperators in v1.VariableConditionRulesas constants, because the webview may import the protocol only as types. A test holds them equal. Sending them in the view model would remove the copy.Closes #456