Appearance
Condition panel
Purpose and problems it solves
condition chooses one child panel from runtime state. It is the configurator's branching container for fallback content, event-variable states, and selection-dependent details.
When to use it
Use Condition when exactly one alternative should render. Put a condition directly on Group or Tabs children when several independent children may remain visible. Those consumers do not share Condition's fallback and last-match semantics.
Prerequisites, inputs, and ownership
Candidate children live in panels. Their common condition objects refer to state owned by the event-variable store or panel-event store:
defaultneeds no additional data;variablesneeds named variables written by a compatible event action;objectSelectedneeds aneventIdwhose stored event containsaddSelectedObjectToRequest. It may also declareobjectTypeNamesto accept only selected objects whose actualmetaType.typeNamematches the list.
Event IDs and variable names are integration contracts. Keep them stable and unique within the application.
Capability map
- one default child;
- equality, inequality, contains, starts-with, empty, and non-empty variable comparisons;
- multiple named variables combined with logical AND;
- object-selection branches tied to a named event;
- optional exact metatype filtering for object-selection branches;
- reactive branch changes as event state changes;
- optional cleanup of tracked variables when a conditioned panel unmounts.
Behavioral model and interactions
Condition first chooses the first child with scenario: "default", or no child if none exists. It then walks candidates in array order. Every matching variables or objectSelected child replaces the current result, so the last matching conditional child wins.
Variable comparisons are strict for EQUAL and NOT_EQUAL. CONTAIN and START_WITH require both values to be strings. EMPTY uses JavaScript falsiness and NOT_EMPTY uses truthiness. All variables in one condition must match.
An objectSelected condition is true only while the referenced stored event exists and includes the addSelectedObjectToRequest action. Clearing selection removes that event and re-evaluates the branch.
When objectTypeNames is absent, this event-presence behavior remains unchanged. When it is present, the selected object's actual metaType.typeName must exactly equal one of the configured strings. Matching is case-sensitive and the list uses logical OR. An empty list, a selected item without metatype data, or a non-matching type makes the condition false. Table rows and Tree nodes use the same check; for a linked Tree node the type belongs to linkedObject, not to the link itself.
Group and Tabs behave differently: they keep unconditioned children and only include matching variables or objectSelected children. They do not treat default as a fallback.
Alternatives, defaults, and precedence
- The first
defaultchild supplies the initial fallback. - Later matching conditional children override earlier matches.
- A child without
conditionis not a Condition fallback and is never chosen by this branch resolver. condition.valuehas no current consumer and does not participate in precedence.
Limitations and runtime drift
panelsis optional in the type, but an absent or empty list only logs a warning and renders nothing.condition.valueis declared legacy state with no current runtime behavior.objectTypeNamesdoes not resolve inheritance or abstract-type membership; it compares the concrete selected-object type name exactly.- Selection conditions do not inspect link type or link attributes. They use the already loaded selected object and do not issue an additional API request.
cleanOnUnmountedis tracked from the conditioned panel's condition and removes the named variable when that rendered panel unmounts. Use it only when the variable truly belongs to that panel lifecycle.- The verified local fixture covers
defaultandobjectSelectedbranches. It does not cover variable comparisons, cleanup, or precedence between several simultaneously matching branches.
Minimal valid configuration
json
{
"id": "state-branch",
"type": "condition",
"panels": [
{
"id": "state-default",
"type": "message",
"condition": {
"scenario": "default"
},
"content": {
"text": "Нет активного состояния"
}
}
]
}Realistic end-to-end scenario
The table emits a stored selection event. The Condition initially shows an instruction, then replaces it with a linked operations table while the event exists.
json
{
"id": "order-workspace",
"type": "group",
"groupLayout": {
"type": "columns"
},
"panels": [
{
"id": "orders",
"type": "table",
"request": {
"metaTypeName": "WorkOrder"
},
"events": [
{
"id": "work-order-selected",
"name": "onObjectSelect",
"actions": [
{
"name": "addSelectedObjectToRequest"
}
]
}
],
"columns": [
{
"attribute": "itemId",
"label": "Заказ"
}
]
},
{
"id": "order-details-branch",
"type": "condition",
"panels": [
{
"id": "select-order-message",
"type": "message",
"condition": {
"scenario": "default"
},
"content": {
"text": "Выберите заказ"
}
},
{
"id": "selected-order-operations",
"type": "table",
"condition": {
"scenario": "objectSelected",
"eventId": "work-order-selected",
"objectTypeNames": [
"WorkOrder"
]
},
"request": {
"getSelectedObjectForEventId": "work-order-selected",
"linkName": "WorkOrderOperation",
"reverse": false
},
"columns": [
{
"attribute": "name",
"label": "Операция"
}
]
}
]
}
]
}Verified demos
Open the default-to-selected Condition journeyOpen the Condition tab. Before selection, the branch pane shows the default Message. Select an order in the source Table; the stored event activates the LocalOrder Attributes branch. Then switch the source to Tree, expand the root, and select a child row; the same event now activates the branch for the linked object's LocalAttributeRendererMatrixCase metatype. Selecting the Tree root does not match that child type and restores the default Message.
The realistic configuration above is source-valid but uses different WorkOrder and WorkOrderOperation data. Do not use the filter-counter fixture as Condition evidence.
Exact parameter reference
condition.panels[]panel.condition.scenariopanel.condition.variables.*.valuepanel.condition.variables.*.comparepanel.condition.variables.*.cleanOnUnmountedpanel.condition.eventIdpanel.condition.objectTypeNamespanel.condition.value
Related guides and next task
Configure the state producer with panel events. Then use Table or Tree selection as the input to an objectSelected branch.