MCPcopy Create free account
hub / github.com/1Panel-dev/MaxKB / is_valid_node

Method is_valid_node

apps/application/flow/common.py:215–231  ·  view source on GitHub ↗
(self, node: Node)

Source from the content-addressed store, hash-verified

213 get_node(node.type, self.workflow_mode)(node, None, None)
214
215 def is_valid_node(self, node: Node):
216 self.is_valid_node_params(node)
217 if node.type == 'condition-node':
218 branch_list = node.properties.get('node_data').get('branch')
219 for branch in branch_list:
220 source_anchor_id = f"{node.id}_{branch.get('id')}_right"
221 edge_list = [edge for edge in self.edges if edge.sourceAnchorId == source_anchor_id]
222 if len(edge_list) == 0:
223 raise AppApiException(500,
224 _('The branch {branch} of the {node} node needs to be connected').format(
225 node=node.properties.get("stepName"), branch=branch.get("type")))
226
227 else:
228 edge_list = [edge for edge in self.edges if edge.sourceNodeId == node.id]
229 if len(edge_list) == 0 and not end_nodes.__contains__(node.type):
230 raise AppApiException(500, _("{node} Nodes cannot be considered as end nodes").format(
231 node=node.properties.get("stepName")))
232
233 def is_valid_work_flow(self, up_node=None):
234 if up_node is None:

Callers 1

is_valid_work_flowMethod · 0.95

Calls 3

is_valid_node_paramsMethod · 0.95
AppApiExceptionClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected