From f93d710d8e4f0c18cd7d53e6e15e8721a636d1d8 Mon Sep 17 00:00:00 2001 From: manoj Date: Wed, 8 Apr 2015 15:37:40 +0530 Subject: [PATCH] For operation is profile operation get Next operations from profile operation DAO --- .../device/mgt/core/operation/mgt/OperationManagerImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 1f5219ec15..721669ab3c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -143,6 +143,9 @@ public class OperationManagerImpl implements OperationManager { public Operation getNextPendingOperation(DeviceIdentifier deviceId) throws OperationManagementException { try { Operation operation = operationDAO.getNextOperation(deviceId); + if (operation instanceof ProfileOperation){ + operation = profileOperationDAO.getNextOperation(deviceId); + } return operation; } catch (OperationManagementDAOException e) { throw new OperationManagementException("Error occurred while retrieving next pending operation", e); @@ -152,8 +155,8 @@ public class OperationManagerImpl implements OperationManager { @Override public void updateOperation(int operationId, Operation.Status operationStatus) throws OperationManagementException { - try { + try { Operation operation = operationDAO.getOperation(operationId); operation.setStatus(operationStatus); OperationManagementDAOFactory.beginTransaction();