fstn
10/19/2017, 7:05 AMobject JsonObjectUtils{
inline operator fun JsonObject.set(key: String, value: Any): Unit {
this.put(key,value)
}
inline operator fun <T> JsonObject.get(key: String): T {
return this.getValue(key) as T
}
fun JsonObject.getFlow(): JsonObject {
return this.getJsonObject("flow")
}
fun JsonObject.getFlowNodeId(): String {
return this.getFlow().get("nodeId")
}
fun JsonObject.setFlowNodeId(nodeId:String) {
this.getFlow().put("nodeId",nodeId)
}
fun JsonObject.getFlowName(): String {
return this.getFlow().get("name")
}
fun JsonObject.setFlowName(nodeId:String) {
this.getFlow().put("name",nodeId)
}
}
dave08
10/19/2017, 7:10 AMfstn
10/19/2017, 7:12 AMmessage.body().getJsonObject("flow").getValue("nodeId")
I can use message.body().getFlowNodeId()
dave08
10/19/2017, 7:18 AMfstn
10/19/2017, 7:24 AM{
“user” :
{
“firstName” : “MyFirstName”
}
“flow”:
{
“id”:“myId”,
“name”:“myName”
}
}
{
"user" :
{
"firstName" : "MyFirstName",
"dynamicProperty": "myDynamicProperty"
}
"flow":
{
}
}
dave08
10/19/2017, 7:26 AMfstn
10/19/2017, 7:28 AMdave08
10/19/2017, 7:28 AMfstn
10/19/2017, 7:29 AMdave08
10/19/2017, 7:30 AMfstn
10/19/2017, 7:30 AMdave08
10/19/2017, 7:31 AMfstn
10/19/2017, 7:31 AMdave08
10/19/2017, 7:32 AMval flow: String
, if not, you might think to make it into some State Machinefstn
10/19/2017, 7:34 AM