3 Replies Latest reply: Oct 10, 2013 11:20 AM by user12005706 RSS

    Load Plan variables using java SDK.

    659781
      Hi, we are using ODI 11.1.1.6 version and trying to create load plan using java sdk, for parallel execution of child table interface scenarios. But the associated variables of interfaces are not coming in the Load plan when created like above.
      Kindly let us know if all the related variables are to be added to the load plan separately using java api's or can be added somehow directly when the interface scenarios are added to the load plan steps.
      Thanks!
      -Anuradha

      code snippet:
      -----------------
      OdiLoadPlanStepSerial rootStep= loadplan.getRootStep();
      OdiLoadPlanStepSerial serialMasterPkgStep = rootStep.addStepSerial("master_pkg");          
      OdiLoadPlanStepRunScenario masterPkgRunScenario = serialMasterPkgStep.addStepRunScenario("LOAD_MASTER", masterScen ,null, null);
      OdiLoadPlanStepParallel parallelPkgStep = rootStep.addStepParallel("child_parallel");
      OdiLoadPlanStepRunScenario childInterfaceRunScenario = parallelPkgStep.addStepRunScenario("Child1_interface", child1Scen ,null, null);
      ......child2...
      ......     
      ----------------------
        • 1. Re: Load Plan variables using java SDK.
          mRainey
          Hi Anuradha,

          You will need to explicitly add the variables to the load plan. The below code shows how:
          //find the variable and add it to the load plan.
          varTextGen = new OdiVariableTextGeneratorDwgImpl(odiInstance)
          varFinder = (IOdiVariableFinder) odiInstance.getTransactionalEntityManager().getFinder(OdiVariable.class)
          varName = "V_EXAMPLE_TWO"
          
          var = varFinder.findByName(varName, projectName)
          varId = var.getVariableId()
          loadPlanVariable = loadPlan.addVariable(var, varTextGen)
          Regards,
          Michael Rainey
          • 2. Re: Load Plan variables using java SDK.
            user12005706

            Hi Michael,

             

            What if i need to add an Global variable  in the below code ?

            Also can you please suggest me a book or reference documentation on how to use Groovy in ODI ? Thanks for your help.

             

            //find the variable and add it to the load plan.
            varTextGen = new OdiVariableTextGeneratorDwgImpl(odiInstance)
            varFinder = (IOdiVariableFinder) odiInstance.getTransactionalEntityManager().getFinder(OdiVariable.class)
            varName = "V_EXAMPLE_TWO"

            var = varFinder.findByName(varName, projectName)
            varId = var.getVariableId()
            loadPlanVariable = loadPlan.addVariable(var, varTextGen)

            • 3. Re: Load Plan variables using java SDK.
              user12005706

              No worries i got it ,  Thank you.

               

              var = varFinder.findGlobalByName(varName)