I’m looking for assistance with a challenge regarding our workflow management please.
Current Situation
Our workflows rely on an offline Excel file to pull additional fields. I currently use the ‘Extract Context Properties’ node to capture the workflow name and filter the Excel file based on this name.
The columns from the Excel file are then converted into variables for user selection in ‘Single Selection Widget’ nodes. All of this is contained in a Component which is inserted into each of our workflows.
Problem
This approach is not sustainable, as it depends on users keeping the workflow name unchanged.
For example, we have a workflow named “AT Data Sum Official v1,” but in the Excel file, it’s tagged as “AT Data Sum” (i.e. a base name excluding the version). I’ve implemented logic in my component to exclude text from “Official,” allowing the workflow name to match the Excel entry whilst also enabling us to mantain version copies.
Proposed Solutions so far
Hardcoding Base Names: I could hardcode the base workflow name in a ‘table creator’ within each workflow. However, while this would prevent issues arising from renamed workflows, it requires developers to remember to update the table creator upon importing my component into EVERY workflow.
Using Workflow Descriptions: I considered including the base name in the workflow description (similar to tags). However, it seems we cannot read the workflow description or tags within the workflow.
Help needed
Does anyone have ideas for a more robust solution? As more users engage with the workflows, the risk of renaming increases, and I’d like to minimize this issue.
not sure I fully grasp your problem. From what I understand:
You use Widget nodes in a component for enabling people who run the workflow to customize what happens.
You are looking for a way how the people building the workflow can configure what happens / which files are selected when using the component.
If that is the case, you can use configuration nodes like String Configuration – KNIME Community Hub . When used inside a component, they add a dialog to the component that can be used to configure the component, similar to how you configure nodes.
This reminds me of the frustration I used to have of giving users some clever Excel files to automate a process and they would come back a few days later to tell me it stopped working as they deleted/inserted/changed things in all sorts of ways that I could not protect against or lock down.
I’d favour making the configuration of the “base name” part of the act of placing your component on the workflow, so if developers know they have to put your component there, at the same time they configure it directly ( as per @nan ‘s String Configuration suggestion).
There comes a point where somebody has to know to “follow the convention”, but it’s difficult if you don’t have personal direct contact with end users.
But if that isn’t possible, another convention could be that all the workflow names end with a special character (one that KNIME will allow in a workflow name such as underscore)
i.e. none of these:
Then you would still need to educate people that the convention is that if they want to modify the workflow name, they must add after the underscore i.e the start of the name before the underscore must never be changed. It still relies on trust and people understanding the rules, but it might be a way forward.
Your base name is then everything prior to the first underscore, or the entire workflow name if no underscore is present.
I apologize for the confusion in my previous explanation, let me try again.
I have a SharePoint list containing workflow information (e.g., Workflow Name, Type, Saving). When using our KNIME workflows, users need to select options from this list using Single Selection Widgets.
To ensure these widgets are dynamic, I use the Extract Context Properties node to filter the list based on the workflow name. For example, if the workflow is ‘AT Data Sum Official v1’, I extract the name (excluding ‘Official v1’) and use it to filter the relevant data for Type and Saving selections.
The issue arises when a user renames the workflow (e.g. to ‘AT Updated Data Sum’). The filter will not match any rows in the SharePoint list, resulting in empty dropdowns and preventing the user from running the workflow.
Example data. Type and Saving columns contain possible Drop down values.
I’m seeking a solution to link the workflow to the SharePoint list data, regardless of name changes.
Hopefully that clarifies but please let me know if you have any further questions.
Hi @taylorpeter55 , had a think about this and I’ve come up with an experimental component. Would be interested to know if it (a) works and (b) provides a potential solution.
The idea is this: drop this component on a workflow and execute it. It returns the name of the workflow using context properties.
The name is returned as a new flow variable “workflow.internal.id”
BUT… it also writes this to a csv file in the workflow’s folder (not its data folder).
On subsequent execution it reads back the name from this file. (It only returns the name in the context properties if the file doesn’t exist).
My thought is that on subsequent executions, provided that file has not been deleted, it doesn’t matter what name changes the workflow undergoes, it always returns the original name.
If you DO want to give the workflow a new “original name”, you would need to manually edit/delete the file “workflow-internal-id.csv” from the workflow’s folder.
I cannot be certain this works in all circumstances, but I believe the theory is sound!
If the idea is sound, but you want to tweak it a bit, obviously feel free to disconnect the component, modify and share on your own hub space.