Disable/Enable Odi Loadplan Step using SDK

Disable/Enable Odi Loadplan Step using SDK:

This post is based on theĀ request raised on OTN. I know it took a few days to post it here and I apologize for that. Its all because of lack of time.

Let’s take a look on the following code snippet. It is not that difficult if you have fair knowledge on core java programming. Initially I didn’t find a way to select the substep as parent step as I was trying to get all of its children steps using getChildren() method. But finally I found the trick and it was just a type cast.

import java.util.List;

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.core.persistence.transaction.support.DefaultTransactionDefinition;
import oracle.odi.core.security.Authentication;
import oracle.odi.domain.runtime.loadplan.OdiLoadPlan;
import oracle.odi.domain.runtime.loadplan.OdiLoadPlanStep;
import oracle.odi.domain.runtime.loadplan.OdiLoadPlanStepContainer;
import oracle.odi.domain.runtime.loadplan.OdiLoadPlanStepSerial;
import oracle.odi.domain.runtime.loadplan.finder.IOdiLoadPlanFinder;

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_MASTER_OLD";
String Master_Pass="odi";
String WorkRep="WORKREP651";
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());

OdiLoadPlan odilplan= ((IOdiLoadPlanFinder) odiInstance.getTransactionalEntityManager().getFinder(OdiLoadPlan.class)).findByName("TESTLOADPLAN");
OdiLoadPlanStepSerial olpss=odilplan.getRootStep();
List<OdiLoadPlanStep> olpchild= olpss.getChildrenSteps();

for (int i = 0; i < olpchild.size(); i++) {
System.out.println("Prniting hierarchy " +i+"\n");
OdiLoadPlanStep olps= olpchild.get(i);
OdiLoadPlanStepContainer olpsc= (OdiLoadPlanStepContainer)olps;
List<OdiLoadPlanStep> olpscchild=olpsc.getChildrenSteps();
System.out.println("Printing steps under above hirarchy \n");
for (int j = 0; j < olpscchild.size(); j++) {
//based on the hierarchy and children you can disable any of the steps.

System.out.println("Loadplan Updated Successfully");
if (odiInstance != null)

if (auth != null) {


As you can see the ODISQLUNLOAD has been unchecked.


Let me know if you find any other workaround.

Thanks guys!!


About the author

Bhabani(http://dwteam.in) - Currently Bhabani is working as Technical Lead Product Development at Harman International. He has good expertise on Oracle, ODI, Pervasive Data Integrator, MSBI, Talend, Cloud Integration (AWS, GCP, Azure) , Map-R and Apache Airflow. He is also contributing in ODI-OTN forum for last 7 years. He is from India. If you want to reach him then please visit contact us page. If you have any doubts or concerns on the above article, please put your question here. Dw Team will try to respond it as soon as possible. Also dont forget to provide your comments / suggestions / feedback for further improvement. Thanks for your time.

Similar Posts


Thanks for great post Bhabani. I am struggling to find info to invoke Console so that I can see my println output. I need to debug some groovy code in ODI studio. Could you shed some light into it please ?

Thanks for your help.

What happens if we check or uncheck the Root step option here?

Leave a reply


Are you a human? *