How to assign macro values on a server process?
Hi, is it possible to run a process with macro values?
In the studio flow I am able to use macros to decide which branches should be executed, eg if a given macro value is 0 it means the whole flow needs to be executed, if it is 1 it means the incremental flow needs to be executed.
On the server part however I can find no way to send this value (so 0 or 1) so it makes the whole logic pretty useless. This looks to me like a very basic thing so I am probably overlooking something. I can see some macro binding options in services, but I do not need an output, just a process to run with a give macro value.
Is this possible ?
Best Answer
-
IngoRM Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
You are close :smileyhappy: You can not set macros in the scheduler directly (interesting idea!), but you can schedule other processes which do this for you.
Everything which has been said is correct. Independent of the output (even if there is none), you can still just create a web service from your parameterized process. Now you can create processes executing this web service by using the Get Page operator and using the macro value you desired (per scheduled process).
But there is also an easier way: you can simply build your parameterized process (like you did) and expose the macros to control it in the context of the process. You can now build multiple processes executing the original process with "Execute Process". Here you can set the macros to the desired values. And those new processes (which simply invoke the original one with different macro values) are then scheduled.
Hope that helps,
Ingo
0
Answers
Yes, it's really straightforward. Simply ensure the macro value you want to set is setup in the Context of the process.
View -> Show View -> Context.
When you publish the process as a webservice then you can change the values of the macros copied from Context as required. In your case just the switch with values 1 or 2.
Give it a try and if stuck at any point refer to this guide in the user docs for server.
Creating Webservices
Not sure if we are on the same track tbh. I don't want to create a webservice, I just want to run a (scheduled) process using parameters to trigger a dedicated process flow. My output is currently stored in a repository, and I would like to keep it like that. I have no real value on getting an xml or html returned as I would not use the API, but the process scheduler.
So can I use a macro in the scheduler, or am I forced to make a static process for all of the possible options ? This is possible but looks like an administrational nightmare if you have a lot of variations and branches (as in my case)
Thanks Ingo,
I indeed figured out in the meantime I can do this in the desktop builder, and schedule this way the parameter driven flow. Works out ok pretty fine, only slight annoyance is that you cannot see the difference in the server application. Let's say I have like 10 different variations then they will all look the same in the server queue even if behind the scene's they have different values. Not a big issue as such but it means I need to wait for all to finalize to see if I didn't miss a combination :-)
Would be nice to be able do this on server level also, or at least have some visibility on what macro values were assigned to a process in the queue. Something for the wishlist :-)
You might find the operator Print to Console useful for that. You can use it at the start of the process to see what the macros are whilst they are executing.
What it doesn't show you are the macros set whilst the process is waiting to be executed, for that you might need to dig into the qrtz_ tables on the repository... I'd have a look, but a bit busy at the moment.