How to pass user input from RM Server Web App to a Process?
Christos_Karapapas
New Altair Community Member
I am following the Titanic example from the documentation and so far I made the following steps but I have a couple of questions.
1. Created a realm.
2. Created a few domains.
3. Assigned the realm to my web app.
4. Checked the "Allow processes to set app variables via context macros" option in my web app.
5. Created a User Input component in the layout of my web app.
6. Created some variables based on my domains.
7. Assigned the variables to the User Input component and marked them as selected variables.
8. Submitted the component, saved the web app and restart the RM Server.
9. Checked the view Context panel on RM Studio.
10. Created some macros with names identical to the names of my variables and default value 0.
11. Inserted the "Recall from App" operator to my process.
--- So far so good.
Now I suppose I have to select something in the Recall operator.
However, all I see as options is a name "meta_something" that I am using as name in another process' "Publish to App" operator.
What exactly I am supposed to see as options, is it the macros that I just created in the context?
Also after I complete some task with the user input, I need to send the results back to the web app, so I will also use the Publish operator to my process, is it this name that I am supposed to find under the Recall operator?
What am I missing here? Thank you in advance.
1. Created a realm.
2. Created a few domains.
3. Assigned the realm to my web app.
4. Checked the "Allow processes to set app variables via context macros" option in my web app.
5. Created a User Input component in the layout of my web app.
6. Created some variables based on my domains.
7. Assigned the variables to the User Input component and marked them as selected variables.
8. Submitted the component, saved the web app and restart the RM Server.
9. Checked the view Context panel on RM Studio.
10. Created some macros with names identical to the names of my variables and default value 0.
11. Inserted the "Recall from App" operator to my process.
--- So far so good.
Now I suppose I have to select something in the Recall operator.
However, all I see as options is a name "meta_something" that I am using as name in another process' "Publish to App" operator.
What exactly I am supposed to see as options, is it the macros that I just created in the context?
Also after I complete some task with the user input, I need to send the results back to the web app, so I will also use the Publish operator to my process, is it this name that I am supposed to find under the Recall operator?
What am I missing here? Thank you in advance.
0
Best Answer
-
Thanks for clarifying!The interaction is a bit different.
- In RapidMiner Studio you connect the Operator "Publish to App" and give it a name of your choice (e.g. myData).
- In RapidMiner Server you edit the Component which should display this Object (can be an ExampleSet, a document or other stuff).
Then you select/enter the App object (in this example myData) to "Subscribe to App object".
In order to be selectable, the RapidMiner process creating this App object needs to have been executed in the Server environment (e.g. by putting it in the initialization process of your Web App or manually executing it by adding a Button component to your Web App).
With the other settings there you can choose different output parameters (e.g.Visualization types). - To use the input variable you also need to attach the execution of the Process where the Macro/Variable is used to the User Input Component.
The raw Workflow is as follows:=> Process creates an App object (e.g. myData)
=> The Web App checks if the object has been created/changed and displays it
=> Every change of a Variable (e.g. via User Input component) is propagated to the defined Processes (i.e. not automatically everywhere where the variable is used)=> The Process is executed and, if necessary, changes the App object
=> Web App gets updatedRecall from App is only needed when you modify an existing object. Most often (e.g. when using a Macro/Variable for filtering) this is not the way to go since you need to filter from the full dataset!The benefit of this approach is that you only need to create an object once but can visualize it in various ways in the Web App.Hope this helps!
Happy Mining,Edin6
Answers
-
Hi @chris_skg ,Welcome in the RapidMiner community!As a first remark let me tell you that restarting the Server is not necessary when working with Web Apps.Based on your explanation I would like to point you to some resources where the general approach of creating a Web App are explained in more detail:
- Our documentation on Web Apps which can be found on https://docs.rapidminer.com/latest/server/use/web-apps/
- A Youtube video posted by a user which can be found on https://www.youtube.com/watch?v=D3-ejMj86AQ
Let me know if you still have questions.Happy Mining,Edin2 - Our documentation on Web Apps which can be found on https://docs.rapidminer.com/latest/server/use/web-apps/
-
I am sorry but neither the RM documentation or this youtube video explain how to setup and configure a user input component.
I believe my question is very specific, if not please let me try to narrow it down even more.
Btw, please correct me if I am wrong.
When I insert to my process a Recall operator, there are no options to set in the name parameter.
Now if I understand this correctly, on this parameter I should choose the name of the User Input Component that contain the Web App Variables I want to receive. After of course I set up the equivalent Macros on RM Studio, making sure that the Variables and Macros share the same name, and also making sure of all the other prerequisites I mention in this question.
The problem now is that on the Recall operator I do NOT see any of View names of my Web App.0 -
Thanks for clarifying!The interaction is a bit different.
- In RapidMiner Studio you connect the Operator "Publish to App" and give it a name of your choice (e.g. myData).
- In RapidMiner Server you edit the Component which should display this Object (can be an ExampleSet, a document or other stuff).
Then you select/enter the App object (in this example myData) to "Subscribe to App object".
In order to be selectable, the RapidMiner process creating this App object needs to have been executed in the Server environment (e.g. by putting it in the initialization process of your Web App or manually executing it by adding a Button component to your Web App).
With the other settings there you can choose different output parameters (e.g.Visualization types). - To use the input variable you also need to attach the execution of the Process where the Macro/Variable is used to the User Input Component.
The raw Workflow is as follows:=> Process creates an App object (e.g. myData)
=> The Web App checks if the object has been created/changed and displays it
=> Every change of a Variable (e.g. via User Input component) is propagated to the defined Processes (i.e. not automatically everywhere where the variable is used)=> The Process is executed and, if necessary, changes the App object
=> Web App gets updatedRecall from App is only needed when you modify an existing object. Most often (e.g. when using a Macro/Variable for filtering) this is not the way to go since you need to filter from the full dataset!The benefit of this approach is that you only need to create an object once but can visualize it in various ways in the Web App.Hope this helps!
Happy Mining,Edin6 -
Edin_Klapic Thank you for the answer! It seems that I had it all wrong.
Could you please elaborate to explain just a bit further the step3? What exactly does the following mean "attach the execution of the Process where the Macro/Variable is used to the User Input Component" in terms of configuration?
What I understand is to go in the RM Server at the Web App, at the Input component and select as "Process to run" the process which has the macros and also the publish to App Object selected at the "Subscribe" option at the result component. Is this right?0 -
Hi @chris_skg ,That is exactly what I meant with "attach". - Great that you got it working
Happy Mining,Edin0 -
Edin_Klapic I tried it but it work. I guess that either I am still missing a step of the process or perhaps there is something wrong with the configuration of either my RM Server or Studio. I keep trying though. Too bad there isn't a part in the documentation to describe this process step by step.
0 -
Edin_Klapic Yes! I finally understood how it works and fixed it! Thank you so much for your answer!!1