Class FlowUtil
- java.lang.Object
-
- lumis.portal.analytics.automationflow.FlowUtil
-
-
Constructor Summary
Constructors Constructor Description FlowUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addNextNodeOnJson(FlowNode nextNode, String objectKey, org.json.JSONObject nodeJson)
Adds the given next node on node JSON using the givenobjectKey
parameter as the object's key.static void
addSingleNextNodeOnJson(FlowNode nextNode, org.json.JSONObject nodeJson)
Adds the next node on node JSON.static FlowNode
findNode(String id, Flow flow)
Returns the node of the given flow with the given identifier ornull
if there's no such node.static Flow
getFlowFromJson(org.json.JSONObject flowJson, FlowEntry flowEntry)
Returns aFlow
by parsing the givenJSONObject
.static org.json.JSONObject
getJsonFromFlow(Flow flow)
Returns aJSONObject
by converting the givenFlow
.static FlowNode
getNextNodeInJson(org.json.JSONObject nodeJson, String objectKey, FlowEntry flowEntry)
Returns the next node from the given JSON object, using the givenobjectKey
parameter as object key.static FlowNode
getSingleNextNodeInJson(org.json.JSONObject nodeJson, FlowEntry flowEntry)
Returns the next node from the given JSON object, using thenextNode
key to get it.
-
-
-
Method Detail
-
getFlowFromJson
public static Flow getFlowFromJson(org.json.JSONObject flowJson, FlowEntry flowEntry)
Returns aFlow
by parsing the givenJSONObject
.- Parameters:
flowJson
- the flow in JSON format.flowEntry
- the flow entry this node belongs to.- Returns:
- a
Flow
. - Since:
- 12.0.0
-
getJsonFromFlow
public static org.json.JSONObject getJsonFromFlow(Flow flow)
Returns aJSONObject
by converting the givenFlow
.- Parameters:
flow
- theFlow
- Returns:
- the
JSONObject
. - Since:
- 12.0.0
-
addSingleNextNodeOnJson
public static void addSingleNextNodeOnJson(FlowNode nextNode, org.json.JSONObject nodeJson)
Adds the next node on node JSON. This method will add the given next node within the given JSON object usig anextNode
key.- Parameters:
nextNode
- the next node to be stored.nodeJson
- the node JSON that will receive the next node.- Since:
- 12.0.0
- See Also:
#getSingleNextNodeInJson(JSONObject)
-
addNextNodeOnJson
public static void addNextNodeOnJson(FlowNode nextNode, String objectKey, org.json.JSONObject nodeJson)
Adds the given next node on node JSON using the givenobjectKey
parameter as the object's key.- Parameters:
nextNode
- the next node to be stored.objectKey
- the property JSON for store next node.nodeJson
- the node JSON that will receive the next node.- Since:
- 12.0.0
-
getSingleNextNodeInJson
public static FlowNode getSingleNextNodeInJson(org.json.JSONObject nodeJson, FlowEntry flowEntry)
Returns the next node from the given JSON object, using thenextNode
key to get it.- Parameters:
nodeJson
- the JSON object.flowEntry
- the flow entry this node belongs to.- Returns:
- the next node from the given JSON object, using the
nextNode
key to get it. - Since:
- 12.0.0
- See Also:
addSingleNextNodeOnJson(FlowNode, JSONObject)
-
getNextNodeInJson
public static FlowNode getNextNodeInJson(org.json.JSONObject nodeJson, String objectKey, FlowEntry flowEntry)
Returns the next node from the given JSON object, using the givenobjectKey
parameter as object key.- Parameters:
nodeJson
- the parent next flow node.objectKey
- property that holds next flow node.flowEntry
- the flow entry this node belongs to.- Returns:
- the next flow node, or
null
if there is no next flow node. - Since:
- 12.0.0
-
findNode
public static FlowNode findNode(String id, Flow flow)
Returns the node of the given flow with the given identifier ornull
if there's no such node.- Parameters:
id
- the node identifier.flow
- the flow.- Returns:
- the node of the given flow with the given identifier or
null
if there's no such node. - Since:
- 12.1.0
-
-