![]() |
![]() |
[ Bottom of Page | Previous Page | Next Page | Contents ]
The following examples indicate how you use the classes to work with objects in the plan:
This procedure requires several actions:
ConnPlan myPlan; //Get an instance of ConnPlan interface... ... String alias = "SBJBF1_1"; JobStream js = null; JobStreamInPlan jsip = null; //If you already have a JobStream in the DB with Identifier jsDbID... try { //get it from the DB js = (JobStream)(myPlan.getTWSObject(JobStream.class,jsDbID,false,null)); //Transform it in a JobStreamInPlan. TODAY is a variable representing the scheduled time jsip = myPlan.makeJobStreamInPlan(jsDbID, TODAY, alias, null); } catch (ConnException e) { //Something went wrong... } catch (ConnEngineNotMasterException e) { //Since the makeJobStreamInPlan is available also on FTAs (it's on the Plan interface), an exception must be thrown if it is called on an engine that is not the master }
List idList = new ArrayList(); try { //Add the job stream to the plan. //This method returns a list of Identifiers because the job stream can be defined on a Workstation class, so you have an ID for each workstation of the class idList = (ArrayList)myPlan.addJobStreamInstance(jsip, null); } catch (ConnException e) { //... } catch (ConnEngineNotMasterException e) { //... }
The following example lists the first five jobs that begin with the letter "A":
String nameFilter = "A*"; int howMany = 5; QueryFilter qf = new QueryFilter(); qf.setFilter(JobInPlanFilters.JOB_NAME, nameFilter); QueryResult qr = null; try { qr = myPlan.queryPlanObject(JobInPlan.class, qf, howMany, null); } catch (ConnException e) { //... }
[ Top of Page | Previous Page | Next Page | Contents ]