Search in sources :

Example 1 with FaultInfoType

use of org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.FaultInfoType 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);
    }
}
Also used : OMFactory(org.apache.axiom.om.OMFactory) FaultInfoType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.FaultInfoType) FailuresInfoType(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.FailuresInfoType) OMElement(org.apache.axiom.om.OMElement) FaultDAO(org.apache.ode.bpel.dao.FaultDAO) Data_type0(org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Data_type0)

Aggregations

OMElement (org.apache.axiom.om.OMElement)1 OMFactory (org.apache.axiom.om.OMFactory)1 FaultDAO (org.apache.ode.bpel.dao.FaultDAO)1 Data_type0 (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.Data_type0)1 FailuresInfoType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.FailuresInfoType)1 FaultInfoType (org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.FaultInfoType)1