You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe. <property> action attributes such as file, registrykey or searchpath will fail if not resolved. For example the following will fail and the following action will not executed:
Using file="foobar.txt" when the file foobar.txt does not exists.
Using registry="HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip\Path64" when 7-zip is not installed.
Using searchpath="python.exe" when Python is not installed.
It would be helpful to be able to prevent failing and keep executing the next action. Without this feature, <property> action must be ordered from the least expected to fail to the most expected to fail action. This creates unnecessary complexity. This is mostly required when setting Default properties.
Describe the solution you'd like
A fail attribute should be added to the <property> element. The attribute's value should evaluate to true or false. See istrue attribute or isfalse attribute logic for details. The default value shall be true to match legacy logic.
For example:
<default>
<!-- Do not skip setting property `workspace.dir` if Python or 7-zip is not installed on the system -->
<propertyfail="no"name="python.exe.path"searchpath="python.exe" />
<propertyfail="no"name="sevenzip.dir"registry="HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip\Path64" />
<propertyname="workspace.dir"value="C:\my_workspace" />
</default>
When a <property> action fails to resolve to a value (file not found, registry key not found, filename not in PATH) and fail attribute evaluates to true, an error should be generated in the logs and the execution of the next action should be cancelled.
If however fail attribute evaluates to false, a warning should be logged and the execution of the next action shall continue.
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
end2endzone
changed the title
Allow property elements to not fail (continue to next action) if unresolved.
Allow property action attributes to not fail (continue to next action) if unresolved.
Jan 15, 2024
Moved most of the logic of PropertyAction::Execute() to independant functions: `GetValueFromExprtk()`, `GetValueFromFile()`, `GetValueFromRegistryKey()` and `GetValueFromSearchPath()`.
This increases cohesion, reduces complexity. It also uses the same design as Validator::Validate() function.
* feature-issue147:
* Updated documentation for `fail` attribute of the <property> element. #147. * Fixed issue #147: Allow property action attributes to not fail (continue to next action) if unresolved.
Implemented `fail` attribute of the <property> element. #147. Moved most of the logic of PropertyAction::Execute() to independant functions: `GetValueFromExprtk()`, `GetValueFromFile()`, `GetValueFromRegistryKey()` and `GetValueFromSearchPath()`. This increases cohesion, reduces complexity. It also uses the same design as Validator::Validate() function.
Is your feature request related to a problem? Please describe.
<property> action attributes such as
file
,registrykey
orsearchpath
will fail if not resolved. For example the following will fail and the following action will not executed:file="foobar.txt"
when the filefoobar.txt
does not exists.registry="HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip\Path64"
when 7-zip is not installed.searchpath="python.exe"
when Python is not installed.It would be helpful to be able to prevent failing and keep executing the next action. Without this feature, <property> action must be ordered from the least expected to fail to the most expected to fail action. This creates unnecessary complexity. This is mostly required when setting Default properties.
Describe the solution you'd like
A
fail
attribute should be added to the <property> element. The attribute's value should evaluate totrue
orfalse
. See istrue attribute or isfalse attribute logic for details. The default value shall betrue
to match legacy logic.For example:
When a <property> action fails to resolve to a value (file not found, registry key not found, filename not in PATH) and
fail
attribute evaluates totrue
, an error should be generated in the logs and the execution of the next action should be cancelled.If however
fail
attribute evaluates tofalse
, a warning should be logged and the execution of the next action shall continue.Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: