Scheduling in ODI using SDK

Scheduling in ODI using SDK:

After a long time am gonna write something about ODI SDK. I got a request from Kane in otn forum about scheduling in ODI without taking the help of ODI Studio. Well that’s obvious, requirement may come in different ways. So initially I was digging around the package provided by Oracle ( oracle.odi.domain.runtime.scheduling ). I tried to see my odi-core.jar file and didn’t find this package. Thats strange !! Right ? I spent around 2 hours and just left it because of some other work.

But today I found the problem and it was with the wrong version of jar file. I was using the odi-core.jar that belongs to  version  and the above package was added in  So I just copied the jar file to ODI  \oracledi.sdk\lib directory and bounced the agent.

Then I found an unexpected result and ended up with below message.

Exception in thread “main” java.lang.NoSuchMethodError: org.eclipse.persistence.mappings.OneToManyMapping.setMustDeleteReferenceObjectsOneByOne(Ljava/lang/Boolean;)V

Okay it seems that it is something related to the version mismatch. Probably its the time to  install version. After installing I started the agent and this time the agent was successful. 🙂  Fine, lets get to the issue on our hand. Following is the code snippet that I have wrote on my eclipse. This will create the scheduling for a specified time. Note that your agent should be up.

Scenario name is : PKG_ROUTER , Agent name is : ODIAgent1  and Context is : GLOBAL

package com.bhabani.OdiTool;

import oracle.odi.core.OdiInstance;
import oracle.odi.core.config.MasterRepositoryDbInfo;
import oracle.odi.core.config.OdiInstanceConfig;
import oracle.odi.core.config.PoolingAttributes;
import oracle.odi.core.config.WorkRepositoryDbInfo;
import oracle.odi.core.persistence.transaction.ITransactionStatus;
import oracle.odi.domain.runtime.scenario.OdiScenario;
import oracle.odi.domain.runtime.scenario.OdiScenarioSchedule;
import oracle.odi.domain.runtime.scenario.finder.IOdiScenarioFinder;
import oracle.odi.domain.runtime.scheduling.*;
import oracle.odi.domain.runtime.scheduling.RecurrenceAttributes.DayOfMonth;
import oracle.odi.domain.runtime.scheduling.RecurrenceAttributes.TimeOfDay;
import oracle.odi.runtime.agent.invocation.RemoteRuntimeAgentInvoker;

public class ScenSchedule {
public static void main(String[] args) {
String Url = "jdbc:oracle:thin:@localhost:1521:xe";
String Driver="oracle.jdbc.OracleDriver";
String Master_User="ODI_MASTER2";
String Master_Pass="odimaster2";
String WorkRep="WORKREP91";
String Odi_User="SUPERVISOR";
String Odi_Pass="SUNOPSIS";

MasterRepositoryDbInfo masterInfo = new MasterRepositoryDbInfo(Url, Driver, Master_User,Master_Pass.toCharArray(), new PoolingAttributes());
WorkRepositoryDbInfo workInfo = new WorkRepositoryDbInfo(WorkRep, new PoolingAttributes());
OdiInstance odiInstance=OdiInstance.createInstance(new OdiInstanceConfig(masterInfo,workInfo));
Authentication auth = odiInstance.getSecurityManager().createAuthentication(Odi_User,Odi_Pass.toCharArray());
ITransactionStatus trans = odiInstance.getTransactionManager().getTransaction(new DefaultTransactionDefinition());

RemoteRuntimeAgentInvoker agent = new RemoteRuntimeAgentInvoker("http://localhost:20910/oraclediagent", "SUPERVISOR", "SUNOPSIS".toCharArray());

OdiScenario odiscen= ((IOdiScenarioFinder) odiInstance.getTransactionalEntityManager().getFinder(OdiScenario.class)).findLatestByName("PKG_ROUTER");

OdiSchedule schedule = new OdiScenarioSchedule(odiscen, "GLOBAL", "ODIAgent1");
Recurrence monthlyRecurrence = Recurrence.createMonthlyRecurrence(new DayOfMonth(12), new TimeOfDay(21,25,00));
Period repetitionInterval = new Period(2, TimeUnit.MINUTE);
Repetition repetition = new Repetition(2, null, repetitionInterval);
catch(Exception e){

When you will run this program you will see below message in the console palette.

Now lets verify the same in ODI Studio.  Do  quick refresh and you can see the schedule information.

What about update agent? Lets click on view schedule.
Yes there it is :D. This will now run in the specified time as long as the agent is up.


Thats all. Thanks everybody for your support.

Best Regards

About Bhabani 86 Articles
Bhabani has 12 plus years of experience in Data warehousing and Analytics projects that has span across multiple domains like Travel, Banking and Financial, Betting and Gaming Industries. Solution areas he focuses on designing the data warehouse and integrating it with cloud platforms like AWS or GCP. He is also a Elite level contributor at OTN forum more than 9 years. He loves to do experiment and POC on different integration tools and services. Some of his favorite skills are Redshift, Big Query, Python, Apache Airflow, Kafka, HDFS, Map Reduce ,HIVE, Habse, Sqoop, Drill, Impala.


  1. Hi Bhabani,

    Liked your post. I am new to ODI SDK , i am currently trying to generate the ODI scenario using ODI SDK. i have placed all required jar from oracledi.sdk folder to the eclipse Java path. but still i am getting below error :

    The Jar odi-core.jar has no source attachment.

    have used Java code to generate the scenario :

    OdiProject project=new OdiProject(“TEST”,”TEST”);
    OdiFolder folder=new OdiFolder(project,”First Folder”);
    OdiContext context = ((IOdiContextFinder) odiInstance.getTransactionalEntityManager().getFinder(OdiContext.class)).findByCode(“GLOBAL”);
    OdiPackage pPackage=new OdiPackage(folder,”TEST”);

    OdiInterface intf=new OdiInterface(folder,”OdiInterface”,context);
    OdiScenario newScen = gene.generateScenario(intf, “MYSCENERIO”, “001”);

    if you have any idea about the above issue, kindly provide your input. it will be really helpful.

  2. Hi Bhabani,

    Can you please help me in one minute scheduling? I can see some bug reported which does a time shifting?


Comments are closed.