use of org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.InstanceInfoType in project carbon-business-process by wso2.
the class InstanceManagementServiceSkeleton method fillFaultAndFailure.
/**
* Use fillFaultAndFailure(ProcessInstanceDAO, InstanceInfoType) to fill the
* instanceInfoWithEvents
*
* @param instance Process Instance DAO
* @param instanceInfoWithEvents Instance info with events
*/
private void fillFaultAndFailure(ProcessInstanceDAO instance, InstanceInfoWithEventsType instanceInfoWithEvents) {
InstanceInfoType instanceInfo = new InstanceInfoType();
fillFaultAndFailure(instance, instanceInfo);
if (instance.getFault() != null) {
instanceInfoWithEvents.setFaultInfo(instanceInfo.getFaultInfo());
}
if (instance.getActivityFailureCount() > 0) {
instanceInfoWithEvents.setFailuresInfo(instanceInfo.getFailuresInfo());
}
}
use of org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.InstanceInfoType in project carbon-business-process by wso2.
the class InstanceManagementServiceSkeleton method getInstanceInformation.
private InstanceInfoType getInstanceInformation(final long iid) throws InstanceManagementException {
final InstanceInfoType instanceInfo = new InstanceInfoType();
instanceInfo.setIid(Long.toString(iid));
dbexec(new BpelDatabase.Callable<Object>() {
public Object run(BpelDAOConnection conn) throws InstanceManagementException {
ProcessInstanceDAO instance = conn.getInstanceEagerly(iid, false);
if (instance == null) {
String errMsg = "Instance " + iid + " not found.";
log.error(errMsg);
throw new InstanceManagementException(errMsg);
}
fillInstanceInfo(instanceInfo, instance);
return null;
}
});
return instanceInfo;
}
use of org.wso2.carbon.bpel.skeleton.ode.integration.mgt.services.types.InstanceInfoType 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