i want to approve form if “Approved” chechbox is clicked on certan form , othervise it could be defective, to control this i use delegate class(with service) here is my code:
@Service(“GetApprovedElement”)
public class GetApproved implements JavaDelegate{
Object jsonObject1=new JSONObject();
public void execute(DelegateExecution execution) throws Exception {
// TODO Auto-generated method stub
jsonObject1 =getApproved(execution.getVariable(“selectedDocuments”).toString());
execution.setVariable(“selectedDocuments”, jsonObject1);
}
public Boolean getApproved(String jsonObject12) throws ParseException {
JSONParser jsonParser = new JSONParser();
String jsonObject = (String) jsonParser.parse("approved");
Boolean approved=Boolean.valueOf(jsonObject);
return approved;
}
}
and than i use this expression for Excluive gateWay flow:
${GetApprovedElement.getApproved()==true}
But when i try to start task camunda can’t recognize approved and throws errors, what i am missing here?