use of org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.FailuresInfoType in project carbon-business-process by wso2.
the class InstanceManagementServiceSkeleton method fillFaultAndFailure.
private void fillFaultAndFailure(ProcessInstanceDAO instance, InstanceInfoType instanceInfo) {
if (instance.getFault() != null) {
FaultDAO fault = instance.getFault();
FaultInfoType faultInfo = new FaultInfoType();
faultInfo.setName(fault.getName());
faultInfo.setExplanation(fault.getExplanation());
faultInfo.setLineNumber(fault.getLineNo());
faultInfo.setAiid(fault.getActivityId());
Data_type0 data = new Data_type0();
if (fault.getData() == null) {
OMFactory omFac = OMAbstractFactory.getOMFactory();
OMElement faultDataEle = omFac.createOMElement("no-data", null);
faultDataEle.setText("No data available.");
data.addExtraElement(faultDataEle);
} else {
data.addExtraElement(OMUtils.toOM(fault.getData(), OMAbstractFactory.getOMFactory()));
}
faultInfo.setData(data);
instanceInfo.setFaultInfo(faultInfo);
}
if (instance.getActivityFailureCount() > 0) {
FailuresInfoType failuresInfo = new FailuresInfoType();
failuresInfo.setCount(instance.getActivityFailureCount());
failuresInfo.setDateFailure(toCalendar(instance.getActivityFailureDateTime()));
instanceInfo.setFailuresInfo(failuresInfo);
}
}
Aggregations