I'm working on ODI 11.1.16 and trying to create an interface using Groovy Scripts. It throws me an error "java.lang.IllegalArgumentException: DataStore shouldn't be null "
Below are my assumptions
Source datastore : Groovy_Source
Target datastore : Groovy_Trgt
Context : Global
Stndrd conn: localhost,1521,orcl
def file = new File('c:/interfaces.txt')
def s = 0
Interfaces.txt contains : TEST1,SOURCE,DUMMY_GROOVY_SOURCE,STAGING,DUMMY_GROOVY_TRGT
DataSet dataSet = odiInterface.getDataSets().get(0);
OdiDataStore odiDatastore1 = ((IOdiDataStoreFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiDataStore.class)).findByName(DUMMY_GROOVY_SOURCE,Oracle);
OdiDataStore targetDatastore = ((IOdiDataStoreFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiDataStore.class)).findByName(DUMMY_GROOVY_TRGT,Oracle);
It throws an error here any help is appreciated
What are the variables DUMMY_GROOVY_SOURCE and DUMMY_GROOVY_TRGT assigned to in your script? How about Oracle, is this assigned to the correct Model code? I think some more of your code would provide a better context for determining the cause of the error.
You can always debug using out.print, as follows:
This will allow you to determine if objects are being set correctly in the code.
First glance, I noticed a typo.
name = toks
Oracle = toks DUMMY_GROOVT_SOURCE = toks
Oracle = toks
DUMMY_GROOVY_TRGT = toks
Should that be DUMMY_GROOVY_SOURCE?
Please let me know if that fixes the issue.
Sounds like your search for the datastore in the model failed.
There are a few posts on this kind of accelerator below;
Groovy version - Getting Groovy with ODI
Extending the interface accelerator example (auto mapping extensions);
More interface accelerator options around auto mapping;
Interface Builder (explicit interface definition driven from a file);
I agree with David. Take a look at all of the other resources available. Plus, you can use the process I mentioned to print out the object value for debugging to ensure the text file is being read correctly.
Unfortunately, without having your full environment in front of me it's tough to offer you further advice.