Create Custom node in Workflow Template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Create Custom node in Workflow Template
We want to create the new custom node on the Workflow Template Edit dialog. It could be just like the "Execute Expression" node.
How to create and Display that custom node on UI?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you describe your requirement? What kind of node would you want to create that is not satisfied by the existing types? This would be a very difficult thing to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
We want to create the node the same as the "Execute Expression" node.
We have some Java expression code that can be used every time in the "Execute Expression" node while creating workflow templates. So we think it is better to have a custom node that includes the pre-existing Java code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So use the existing type Execute expression node. Put there your code and that's all.
You don't need any special new type node. Just add the existing type as a new one.
PetrH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
While this will create more workflow objects in your system you could consider setting that function up as a separate workflow template and just call that template each time. It'll be a little like creating your own functions while programming. If you need to change the code in it you'll just have to update it one place and not hunt around all workflows using it.
We have used such an approach that among other things handles publishing during workflows. Every workflow that needs to perfom publishing will call that workflow template, and if we need to make changes to how it works we only need to implement that code change one place.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Found a suitable example for how it would look. As an additional benefit you can do more with nested workflow templates than a custom node (if this is at all possible) while at the same time not overloading your system with customizations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If it’s “just like the Execution Expression node” why do you need a new node? 🤷♂️
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
We have some Java expression code that can be used every time in the "Execution Expression" node while creating workflow templates. So we think it is better to have a custom node that includes the pre-existing Java code.
