diff --git a/.idea/misc.xml b/.idea/misc.xml index 3fe5f5c..67fa7ec 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -11,7 +11,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index e910fb5..80c8d23 100644 --- a/pom.xml +++ b/pom.xml @@ -3,10 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - + + 7.48.0.Final + org.example GGD 1.0-SNAPSHOT + @@ -17,12 +20,13 @@ 11 + + - - 7.48.0.Final - + + info.picocli picocli @@ -50,25 +54,25 @@ org.drools drools-core - 7.48.0.Final + ${runtime.version} org.drools drools-compiler - 7.48.0.Final + ${runtime.version} org.drools drools-decisiontables - 7.48.0.Final + ${runtime.version} org.drools kiebase-inclusion - 7.48.0.Final + ${runtime.version} runtime @@ -76,14 +80,14 @@ org.kie kie-api - 7.48.0.Final + ${runtime.version} provided org.kie kie-ci - 7.48.0.Final + ${runtime.version} diff --git a/src/main/java/ApiCall.java b/src/main/java/ApiCall.java index bb11460..1504d8f 100644 --- a/src/main/java/ApiCall.java +++ b/src/main/java/ApiCall.java @@ -1,8 +1,11 @@ import Credentials.UserCredentials; import Files.WriteFile; import JSON_Unpack.ReadSensors4Partner; +import Knowledgebase.SensorReadings; +import org.json.JSONArray; import org.json.JSONObject; +import java.lang.reflect.Array; import java.util.ArrayList; public class ApiCall { @@ -33,11 +36,29 @@ public class ApiCall { } } ReadSensors4Partner readSensors4Partner = new ReadSensors4Partner(); - String y = (readSensors4Partner.FetchSensor4Box("Germes",token)); + SensorReadings sensorReadings = new SensorReadings(); + String outputValue = (readSensors4Partner.FetchSensor4Box("Germes",token)); + System.out.println(outputValue); + String outputValueFixed=outputValue.replace("[[","[") +outputValue.replace("[{","{")+outputValue.replace("}]","}")+ outputValue.replace("]]","]"); + System.out.println(outputValueFixed); + JSONArray jsonArray = new JSONArray(outputValueFixed); + System.out.println(jsonArray.length()); + for(int j=0; j list=new ArrayList(); int loopTerminator = 0; - + char par = '"'; for(int j=0; j