I am writing an automation for promoting the Harvest packages using Java code.

Ezhilan Mahalingam's picture

I am using the JHSDK jar available in ths installation directory of CA to write a java program for an automation project.

 

I am using the below Java code to select the packages from ACEDEV13.06.00.00 from SW Development view and promoting it to next stage 'Integration Test(AIT)'.

 

Java Code:

 

JCaContext context = harvest.getContext();

boolean approve = context.setApprove("Approve"); //Exception @ this line is E0309000d: ERROR: Could not get Process.

boolean promote = context.setPromote("Promote");

 

//Setting the Approval

CaApprove jcaApprove = context.getApprove();

jcaApprove.setApprove(true);

jcaApprove.setDescription("Approved Desc");

jcaApprove.execute();

 

//Setting the Promote

JCaPromote jcaPromoteObj =  context.getPromote();

System.out.println(" getToStateName "+jcaPromoteObj.getToStateName());

System.out.println(" getToStateObjId "+jcaPromoteObj.getToStateObjId());

 

jcaPromoteObj.execute();

 

 

Exception I get :

com.ca.harvest.jhsdk.hutils.JCaHarvestException: E03090027: ERROR: Could not get Approve Process from Context.

com.ca.harvest.jhsdk.hutils.JCaHarvestException: E03090010: ERROR: Could not get Promote Process from Context.

 

Do I need to set any mode to context or harvest object to make the Promote process to work. Kindly help me with this.

2 Answers

Bob Aiello's picture

I will tweet this question out for you but have you gotten any other calls to the API to work using java already?

 

Bob Aiello, Technical Editor CM Crossroads

David Day's picture
David Day replied on November 8, 2013 - 1:50pm.

I know this is late, I've been avoiding the site lately. 

It may be as simple as the state your are trying to do the promote in , doesn't have a valid promote process, with the correct permissions assigned. That some thing will fail in any of the CLI attempts

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.