enhancement
critical
major
minor
minor
major
#25921
State-dependent executability of commands
Each tl:CommandHandler can specify a rule for its executability via a tl:ExecutabilityRule. This rule can determine, for each target model on which the command is to be executed, whether the command is executable or not.
However, if you want to disable a large number of commands based on an object’s state (e.g., all Write commands), this is difficult to achieve using the tl:ExecutabilityRule because the configuration of all relevant commands would have to be modified to insert an additional tl:ExecutabilityRule.
In such a case, it would be better to implement a central executability rule that is not configured specifically for a single command, but is used generically for all command executions and can restrict executability based on the state of the target model and the properties of the command to be executed.
Application
Executability can be overridden globally by configuring the tl:CommandApprovalService.
Migration
- Convert any existing webapp/WEB-INF/xml/state/ViewStateConfiguration.xml file into corresponding rules for the tl:CommandApprovalService.
See also
- com.top_logic.tool.boundsec.BoundHelper.allowInState(TLContext, BoundChecker, BoundCommand, BoundObject)
- com.top_logic.layout.state.ViewStateManager - Cannot be configured within the application, as a specific derivation hierarchy is required for model elements: com.top_logic.tool.state.StatefullElement.
Test
- /com.top_logic.demo/src/test/com/top_logic/demo/scripted/layout/executability/TestCommandApprovalService.script.xml