The idea is to monetize some data apps. For example, I have created some graphs / dashboards with data on climate change I gathered (see here for a few examples) and would like to set up a system to give access to everybody but 'bill' them with a credits-like system similar to what like KNIME Team plan uses.
In order to do so, I have to identify individual users and know which and how many processes they ran.
I came up with the following idea: create a KNIME_JOB_LOG table in my database and add the nodes below to each of my workflows. What they do is extract the context properties and write them to my table.
Nodes that should be added to each HUB workflow. Many thanks to Leo Woerteler from KNIME for your help on this! Later on I will wrap these nodes in a Component to make them reusable.
Workflow to show the KNIME_JOB_LOG table
Now that I can identify the executing user, I would like to implement the 'credits' system. I have created a USER_CREDITS table in my database with 2 columns: the user name (as identified above) and the number of credits the user has available, like below:
Below is the workflow which I want to monetize for example (temperature evolution in Getafe, a village near Madrid). Below this there is a screenshot of the 'Job Log Component', which handles the user identification on the Hub and checks is the user has enough Credits.
When the user has enough credits available, the Component will subtract 5 credits from the user's balance and the Data App will execute normally.
Below is what will happen when a user tries to execute the Data App , but does not have enough credits, or is not present in the USER_CREDITS table.
The only thing I don't like about this solution is the format of the error message. Any suggestions on how to make it 'nicer' would be appreciated.