Conditional in workflow (adjust for your lifecycle states):
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
totalError=0;
wt.fc.QueryResult queryresult1 = wt.maturity.MaturityHelper.service.getPromotionTargets(pn);
wt.lifecycle.State st=pn.getMaturityState();
System.out.println("The Maturity State is ------------------------------ > " +st);
if((st.toString()).equals("READYRELEASE")){
System.out.println("Coming ye ye ye ------------------------------ > " +st);
isReadyRelease=true;}
wt.fc.WTObject obj=null;
try{
while(queryresult1.hasMoreElements()){
obj=(wt.fc.WTObject)queryresult1.nextElement();
if(obj instanceof wt.epm.EPMDocument){
String mc=ext.alcon.workflow.WorkflowHelper.getIBAValue((wt.iba.value.IBAHolder)obj,"MC_ERRORS");
if(!mc.contains("0")) {totalError++; }}
if(totalError>0)result="Use_Branch";
else{result="Continue";}
}
}
catch( Exception wte )
{
wte.printStackTrace();
result = "Continue";
}