Class FlowUtil
- java.lang.Object
-
- lumis.portal.analytics.automationflow.FlowUtil
-
public class FlowUtil extends java.lang.Object
Utilities for dealing withFlow
.- Since:
- 12.0.0
- Version:
- $Revision: 23402 $ $Date: 2019-12-06 19:07:56 -0300 (Fri, 06 Dec 2019) $
-
-
Constructor Summary
Constructors Constructor Description FlowUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addNextNodeOnJson(FlowNode nextNode, java.lang.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(java.lang.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, java.lang.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, java.lang.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, java.lang.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(java.lang.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
-
-