From 3dda515add94a5ba1d09225a0f18ca1ca4ee12e1 Mon Sep 17 00:00:00 2001 From: mharindu Date: Thu, 30 Apr 2015 11:01:38 +0530 Subject: [PATCH] Fixed a bug in add operation function --- .../carbon/device/mgt/core/operation/mgt/ConfigOperation.java | 3 ++- .../device/mgt/core/operation/mgt/OperationManagerImpl.java | 2 ++ 2 files 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/ConfigOperation.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/ConfigOperation.java index 8e12a2ab9a..c625499564 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/ConfigOperation.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/ConfigOperation.java @@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.core.operation.mgt; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -39,7 +40,7 @@ public class ConfigOperation extends Operation { properties.add(new Property(name, value, type)); } - public class Property { + public class Property implements Serializable{ private String name; private Object value; private Class type; 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 241b73858b..5000bd56a6 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 @@ -76,6 +76,8 @@ public class OperationManagerImpl implements OperationManager { OperationManagementDAOFactory.beginTransaction(); org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation operationDto = OperationDAOUtil.convertOperation(operation); + operationDto.setStatus(org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation.Status.PENDING); + int operationId = this.lookupOperationDAO(operation).addOperation(operationDto); org.wso2.carbon.device.mgt.common.Device device;