Pages: [1]
  Print  
Author Topic: %{process_name} as filename in store operator  (Read 935 times)
ml1n
Newbie
*
Posts: 8


« on: January 18, 2011, 10:41:35 PM »

Hello,
I'm trying to use the macro %{process_name}_results as the file name for the store operator but the object saved in the repository ends up being called process_name_results, which is not what I'd expected.
How do I set the object name to be the same as the process name?

The operator setup looks like this:
      <operator activated="true" class="store" compatibility="5.1.001" expanded="true" height="60" name="Store" width="90" x="380" y="300">
        <parameter key="repository_entry" value="%{process_name}_results"/>
      </operator>

Any help gratefully recieved.
M.
Logged
steffen
Sr. Member
****
Posts: 376



« Reply #1 on: January 19, 2011, 11:21:48 AM »

Hi ml1n

and welcome to rapidminer (at least it is your first post Wink).

The correct name of the macro is: process_file, hence
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.1.001">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.1.001" expanded="true" name="Process">
    <process expanded="true" height="370" width="614">
      <operator activated="true" class="retrieve" compatibility="5.1.001" expanded="true" height="60" name="Retrieve" width="90" x="112" y="120">
        <parameter key="repository_entry" value="//Samples/data/Iris"/>
      </operator>
      <operator activated="true" class="store" compatibility="5.1.001" expanded="true" height="60" name="Store" width="90" x="311" y="347">
        <parameter key="repository_entry" value="%{process_file}_result"/>
      </operator>
      <connect from_op="Retrieve" from_port="output" to_op="Store" to_port="input"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
    </process>
  </operator>
</process>

worked for me. I can only guess that this is a bug.

@developers: From MacroHandler#getMacro
Code:
case PROCESS_NAME:
String fileName = process.getProcessLocation().getShortName();
return fileName.substring(0, fileName.lastIndexOf("."))

This snippets work only if the process-name contains an ending. If one add a artificial ending when saving a process, it works. Otherwise not (I have tested it).

hope this was helpful,

steffen
Logged

"I want to make computers do what I mean instead of what I say"
Read The Fantastic Manual
ml1n
Newbie
*
Posts: 8


« Reply #2 on: January 19, 2011, 07:52:16 PM »

Hi Steffen,
Thanks for the welcome. I am new to Rapidminer but I'm really impressed with how quickly it let me get up and running.

That works for me. I didn't find anything in the bug tracker related to that macro. Should I raise one?

M.
Logged
steffen
Sr. Member
****
Posts: 376



« Reply #3 on: January 20, 2011, 08:22:57 AM »

Hello ml1n

yeah, sure. First I wanted to wait for a developer statement, but since they are rather busy it is no mistake to open a ticket. They can still close it as "work as intended" Wink.

I suggest to add a link to this thread.

thank you,

steffen
Logged

"I want to make computers do what I mean instead of what I say"
Read The Fantastic Manual
ml1n
Newbie
*
Posts: 8


« Reply #4 on: January 20, 2011, 02:38:07 PM »

Done:

http://bugs.rapid-i.com/show_bug.cgi?id=473
Logged
Pages: [1]
  Print  
 
Jump to: