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
Creating a rule template is a tedious and error-prone process, and much of it has to be done in public. My typical workflow to create a new rule template is as follows:
Write a rule on my local system and test that it works.
Open the code tab and copy that code to VSCode.
Manually add in the property sections for each of the configuration properties and add in the replacement strings to the rule itself (i.e. the "{{propname}}" stuff).
Create a new post on the marketplace and copy/paste the YAML into the template as required.
Try to install the template and fail due to inevitable typos and mistakes in the properties section. Repeat steps 3-5 as required all the while hoping someone else doesn't try to install it in the meantime (even though it's not published they can still install it if "show unpublished" is enabled.
If you are me, add the published tag. If you are not a moderator wait for some moderator to add the published tag.
Once it seems to be working, move the code to GitHub so it's easier to maintain in the long run.
Updating the rule template process is:
Edit the code of a rule that is created from the template.
Manually insert the changes to the published rule template.
Try to install the rule modified rule template and instantiate a new rule based on the template.
Repeat steps 2-3 as necessary to fix typos and bugs. Again, hope someone doesn't try to install it while you are working on it. If you are me you can reduce that likelihood by removing the published tag. Most users do not have that option.
Your suggestion
Add a tool similar to Developer Tools -> Widgets to create and test out rule templates. The preview pane, if kept, can show how the properties will render or simply removed as unneeded. Must have features:
list installed templates
ability to see and edit the YAML for a template
parse the template and report syntax errors, even if just syntax errors for the properties
a template created here should be usable to create new rules from (i.e. they appear in the list of templates same as templates installed from the marketplace for testing
Nice to have features:
screen that looks similar to the regular rule editor on MainUI with triggers, actions, and conditions sections with the addition of a section to set properties
a wizard or form or something a little more constrained to define properties so one doesn't need to review the developer docs to figure out what is and is not possible; this could be useful for Widgets too. Adding a link to the XML config docs would be helpful at a minimum, though they take a good deal of "translation" to convert from the XML used by bindings to the YAML used by widgets and templates.
preview of the form that will render when creating the template
preview of the code that will be generated when creating a rule from the template
With this tool, template developers can have some help in developing the code, and the debug loop can be done in private instead of in public. It should also enable the ability to locally develop and use tempaltes.
The problem
Creating a rule template is a tedious and error-prone process, and much of it has to be done in public. My typical workflow to create a new rule template is as follows:
Updating the rule template process is:
Your suggestion
Add a tool similar to Developer Tools -> Widgets to create and test out rule templates. The preview pane, if kept, can show how the properties will render or simply removed as unneeded. Must have features:
Nice to have features:
With this tool, template developers can have some help in developing the code, and the debug loop can be done in private instead of in public. It should also enable the ability to locally develop and use tempaltes.
Your environment
Additional information
The text was updated successfully, but these errors were encountered: