@@ -25,15 +25,10 @@ ScComponentManagerCommandHandler::ScComponentManagerCommandHandler()
25
25
26
26
m_InstallParametersRelations = {
27
27
{CommandsConstantsFlags::IDTF, keynodes::ScComponentManagerKeynodes::rrel_components},
28
- {CommandsConstantsFlags::SET, keynodes::ScComponentManagerKeynodes::rrel_sets},
29
- {CommandsConstantsFlags::AUTHOR, keynodes::ScComponentManagerKeynodes::rrel_author},
30
- {CommandsConstantsFlags::CLASS, keynodes::ScComponentManagerKeynodes::rrel_class},
31
- {CommandsConstantsFlags::EXPLANATION, keynodes::ScComponentManagerKeynodes::rrel_explanation}};
28
+ {CommandsConstantsFlags::SET, keynodes::ScComponentManagerKeynodes::rrel_sets}};
32
29
33
30
m_SearchNodesParametersRelations = {
34
- {CommandsConstantsFlags::AUTHOR, keynodes::ScComponentManagerKeynodes::rrel_author},
35
- {CommandsConstantsFlags::CLASS, keynodes::ScComponentManagerKeynodes::rrel_class},
36
- {CommandsConstantsFlags::EXPLANATION, keynodes::ScComponentManagerKeynodes::rrel_explanation}};
31
+ {CommandsConstantsFlags::AUTHOR, keynodes::ScComponentManagerKeynodes::nrel_authors}};
37
32
38
33
m_SearchLinksParametersRelations = {
39
34
{CommandsConstantsFlags::EXPLANATION, keynodes::ScComponentManagerKeynodes::rrel_explanation}};
@@ -63,8 +58,6 @@ bool ScComponentManagerCommandHandler::Handle(
63
58
FormSearchActionNodeParameter (action, commandParameters);
64
59
}
65
60
66
- common_utils::CommonUtils::TranslateFromStringToScMemory (*m_context, action, commandParameters);
67
-
68
61
utils::AgentUtils::applyAction (m_context, action, 30000 );
69
62
70
63
bool const executionResult = m_context->HelperCheckEdge (
@@ -113,17 +106,43 @@ void ScComponentManagerCommandHandler::FormInstallActionNodeParameter(
113
106
114
107
void ScComponentManagerCommandHandler::FormSearchActionNodeParameter (ScAddr const & action, CommandParameters const & commandParameters)
115
108
{
109
+ ScAddr const & searchStructure = m_context->CreateNode (ScType::NodeConstStruct);
110
+ ScAddr const & component = m_context->CreateNode (ScType::NodeVar);
111
+
112
+ ScAddr const & componentArc = m_context->CreateEdge (ScType::EdgeAccessVarPosPerm, searchStructure, component);
113
+ m_context->CreateEdge (ScType::EdgeAccessVarPosPerm, searchStructure, scAgentsCommon::CoreKeynodes::rrel_key_sc_element);
114
+ m_context->CreateEdge (ScType::EdgeAccessVarPosPerm, searchStructure, componentArc);
115
+
116
116
ScAddr paramsSet;
117
117
ScAddr foundParamValue;
118
118
for (auto const & params : commandParameters)
119
119
{
120
- paramsSet = m_context->CreateNode (ScType::NodeConst);
120
+ if (m_SearchNodesParametersRelations.find (params.first ) != m_SearchNodesParametersRelations.cend ())
121
+ {
122
+ common_utils::CommonUtils::GenerateVarRelationBetween (
123
+ *m_context, searchStructure, component, scAgentsCommon::CoreKeynodes::rrel_key_sc_element);
124
+
125
+ paramsSet = m_context->CreateNode (ScType::NodeVar);
126
+ for (std::string const & paramValue : params.second )
127
+ {
128
+ foundParamValue = m_context->HelperFindBySystemIdtf (paramValue);
129
+ m_context->CreateEdge (ScType::EdgeAccessVarPosPerm, paramsSet, foundParamValue);
130
+ }
131
+
132
+ }
133
+
134
+
121
135
for (std::string const & paramValue : params.second )
122
136
{
123
137
// Process parameter if it is a link
124
138
if (m_SearchNodesParametersRelations.find (params.first ) != m_SearchNodesParametersRelations.cend ())
125
139
{
126
140
foundParamValue = m_context->HelperFindBySystemIdtf (paramValue);
141
+ if (m_context->GetElementType (foundParamValue) == ScType::NodeConstClass)
142
+ {
143
+
144
+ }
145
+
127
146
utils::GenerationUtils::generateRelationBetween (m_context, action, paramsSet, m_SearchNodesParametersRelations.at (params.first ));
128
147
}
129
148
// Process parameter if it is a node
0 commit comments