[solved] Assign repository in JAVA
radone
New Altair Community Member
How can I assign repository location to JAVA application?
Where is my problem:
I would like to run external "execute_process" process from my current process.
Notification:
JAVA Code
Thanks for any help.
Radim
Where is my problem:
I would like to run external "execute_process" process from my current process.
Notification:
INFO: Cannot access file system in execution mode UNKNOWN. Not loading repositories.
JAVA Code
"execute_process" operator definition:
RapidMiner.init();
try {
RepositoryManager.getInstance(null).addRepository(new LocalRepository("MyRepo", new File("processes")));
} catch (RepositoryException e1) {
e1.printStackTrace();
}
Process process = null;
try {
process = RapidMiner.readProcessFile(new File(annotationProcess));
// RepositoryProcessLocation loc = new RepositoryProcessLocation(new RepositoryLocation(annotationProcess));
// process = loc.load(null);
IOContainer results = process.run();
} catch (Exception e) {
e.printStackTrace();
RapidMiner.quit(RapidMiner.ExitMode.ERROR);
}
Error:
<operator activated="true" class="execute_process" compatibility="5.3.000" expanded="true" height="76" name="Execute ExtracGlobaltFeatures (3)" width="90" x="246" y="120">
<parameter key="process_location" value="RMModule/processes/ExtracGlobaltFeatures"/>
<parameter key="use_input" value="true"/>
<parameter key="store_output" value="false"/>
<parameter key="propagate_metadata_recursively" value="true"/>
<parameter key="cache_process" value="true"/>
<list key="macros"/>
</operator>
com.rapidminer.operator.UserError: Cannot resolve relative repository location 'ExtracGlobaltFeatures'. Process is not associated with a repository.
Thanks for any help.
Radim
0
Answers
-
The solution was to add: (the processes are in "processes" directory):
and to change to //MyRepo/ExtractFeatures:
try {
RepositoryManager.getInstance(null).addRepository(
new LocalRepository("MyRepo", new File("processes")));
} catch (RepositoryException e1) {
e1.printStackTrace();
}<operator activated="true" class="execute_process" compatibility="5.3.000" expanded="true" height="76" name="Execute ExtracGlobaltFeatures (3)" width="90" x="246" y="120">
<parameter key="process_location" value="//MyRepo/ExtracGlobaltFeatures"/>
<parameter key="use_input" value="true"/>
<parameter key="store_output" value="false"/>
<parameter key="propagate_metadata_recursively" value="true"/>
<parameter key="cache_process" value="true"/>
<list key="macros"/>
</operator>0 -
Thanks, it's been very usefull to me0