diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java index c6343156ee6..d96920d703a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java @@ -412,7 +412,9 @@ public class GenericOperationDAOImpl implements OperationDAO { activity.getActivityStatus().add(activityStatus); enrolmentId = rs.getInt("ENROLMENT_ID"); - } else { + } + + if (operationId == rs.getInt("OPERATION_ID") && enrolmentId == rs.getInt("ENROLMENT_ID")){ if (rs.getTimestamp("RECEIVED_TIMESTAMP") != (null)) { activityStatus.getResponses().add(this.getOperationResponse(rs)); }