Merge pull request #461 from Megala21/embed

Fixing bundle loading problem
revert-dabc3590
sinthuja 8 years ago committed by GitHub
commit f864285454

@ -47,6 +47,7 @@
<dependency> <dependency>
<groupId>org.json.wso2</groupId> <groupId>org.json.wso2</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
<version>${analytics.json.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>

@ -18,6 +18,7 @@
package org.wso2.extension.siddhi.execution.json; package org.wso2.extension.siddhi.execution.json;
import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.wso2.siddhi.core.config.ExecutionPlanContext; import org.wso2.siddhi.core.config.ExecutionPlanContext;
import org.wso2.siddhi.core.exception.ExecutionPlanRuntimeException; import org.wso2.siddhi.core.exception.ExecutionPlanRuntimeException;
@ -68,10 +69,13 @@ public class getPropertyFunctionExtension extends FunctionExecutor {
} }
String jsonString = (String) data[0]; String jsonString = (String) data[0];
String property = (String) data[1]; String property = (String) data[1];
JSONObject jsonObject = null;
JSONObject jsonObject = new JSONObject(jsonString); try {
Object value = jsonObject.get(property).toString(); jsonObject = new JSONObject(jsonString);
return value; return jsonObject.get(property).toString();
} catch (JSONException e) {
throw new ExecutionPlanRuntimeException("Cannot parse JSON String in json:getPeroperty() function. " + e);
}
} }
@Override @Override

@ -65,7 +65,6 @@
<bundleDef> <bundleDef>
org.wso2.carbon.devicemgt-plugins:org.wso2.extension.siddhi.execution.json:${carbon.devicemgt.plugins.version} org.wso2.carbon.devicemgt-plugins:org.wso2.extension.siddhi.execution.json:${carbon.devicemgt.plugins.version}
</bundleDef> </bundleDef>
<bundleDef>org.json.wso2:json:${commons-json.version}</bundleDef>
</bundles> </bundles>
</configuration> </configuration>
</execution> </execution>

@ -856,7 +856,6 @@
<artifactId>gcm-server</artifactId> <artifactId>gcm-server</artifactId>
<version>${gcm.server.version}</version> <version>${gcm.server.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.json.wso2</groupId> <groupId>org.json.wso2</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
@ -1377,6 +1376,7 @@
<maven-antrun-plugin.version>1.7</maven-antrun-plugin.version> <maven-antrun-plugin.version>1.7</maven-antrun-plugin.version>
<siddhi.version>3.1.2</siddhi.version> <siddhi.version>3.1.2</siddhi.version>
<maven.scr.version>1.7.2</maven.scr.version> <maven.scr.version>1.7.2</maven.scr.version>
<analytics.json.version>2.0.0.wso2v1</analytics.json.version>
</properties> </properties>
<scm> <scm>

Loading…
Cancel
Save