@lcap/nasl 3.8.0-beta.3 → 3.8.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/out/automate/engine/utils.js +1 -2
  2. package/out/automate/engine/utils.js.map +1 -1
  3. package/out/bak/translator.js +1 -1
  4. package/out/bak/translator.js.map +1 -1
  5. package/out/common/BaseNode.js +7 -2
  6. package/out/common/BaseNode.js.map +1 -1
  7. package/out/concepts/App__.js +6 -1
  8. package/out/concepts/App__.js.map +1 -1
  9. package/out/concepts/Argument__.js +11 -5
  10. package/out/concepts/Argument__.js.map +1 -1
  11. package/out/concepts/AuthLogicForCallInterface__.js +3 -0
  12. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  13. package/out/concepts/BinaryExpression__.js +49 -2
  14. package/out/concepts/BinaryExpression__.js.map +1 -1
  15. package/out/concepts/BindAttribute__.d.ts +4 -3
  16. package/out/concepts/BindAttribute__.js +121 -42
  17. package/out/concepts/BindAttribute__.js.map +1 -1
  18. package/out/concepts/BindEvent__.js +5 -42
  19. package/out/concepts/BindEvent__.js.map +1 -1
  20. package/out/concepts/BusinessComponent__.d.ts +1 -0
  21. package/out/concepts/BusinessComponent__.js +16 -0
  22. package/out/concepts/BusinessComponent__.js.map +1 -1
  23. package/out/concepts/BusinessLogic__.js +3 -0
  24. package/out/concepts/BusinessLogic__.js.map +1 -1
  25. package/out/concepts/CallConnector__.js +1 -1
  26. package/out/concepts/CallConnector__.js.map +1 -1
  27. package/out/concepts/CallFunction__.js +1 -1
  28. package/out/concepts/CallFunction__.js.map +1 -1
  29. package/out/concepts/CallLogic__.d.ts +6 -1
  30. package/out/concepts/CallLogic__.js +58 -17
  31. package/out/concepts/CallLogic__.js.map +1 -1
  32. package/out/concepts/Connection__.d.ts +4 -0
  33. package/out/concepts/Connection__.js +15 -0
  34. package/out/concepts/Connection__.js.map +1 -1
  35. package/out/concepts/DatabaseTypeAnnotation__.d.ts +2 -0
  36. package/out/concepts/DatabaseTypeAnnotation__.js +20 -0
  37. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
  38. package/out/concepts/End__.js +5 -1
  39. package/out/concepts/End__.js.map +1 -1
  40. package/out/concepts/EntityProperty__.js +2 -0
  41. package/out/concepts/EntityProperty__.js.map +1 -1
  42. package/out/concepts/Entity__.d.ts +1 -0
  43. package/out/concepts/Entity__.js +24 -1
  44. package/out/concepts/Entity__.js.map +1 -1
  45. package/out/concepts/EnumItem__.d.ts +12 -0
  46. package/out/concepts/EnumItem__.js +49 -5
  47. package/out/concepts/EnumItem__.js.map +1 -1
  48. package/out/concepts/Enum__.js +4 -1
  49. package/out/concepts/Enum__.js.map +1 -1
  50. package/out/concepts/ForEachStatement__.js +1 -1
  51. package/out/concepts/ForEachStatement__.js.map +1 -1
  52. package/out/concepts/FrontendLibrary__.d.ts +46 -46
  53. package/out/concepts/FrontendLibrary__.js +34 -36
  54. package/out/concepts/FrontendLibrary__.js.map +1 -1
  55. package/out/concepts/I18nInfo__.d.ts +1 -0
  56. package/out/concepts/I18nInfo__.js +7 -0
  57. package/out/concepts/I18nInfo__.js.map +1 -1
  58. package/out/concepts/IfStatement__.js +2 -2
  59. package/out/concepts/IfStatement__.js.map +1 -1
  60. package/out/concepts/Interface__.js +4 -1
  61. package/out/concepts/Interface__.js.map +1 -1
  62. package/out/concepts/Logic__.d.ts +2 -3
  63. package/out/concepts/Logic__.js +33 -8
  64. package/out/concepts/Logic__.js.map +1 -1
  65. package/out/concepts/MatchCase__.d.ts +2 -2
  66. package/out/concepts/MatchCase__.js +7 -7
  67. package/out/concepts/MatchCase__.js.map +1 -1
  68. package/out/concepts/NewComposite__.js +2 -1
  69. package/out/concepts/NewComposite__.js.map +1 -1
  70. package/out/concepts/NewList__.js +2 -1
  71. package/out/concepts/NewList__.js.map +1 -1
  72. package/out/concepts/NewMap__.js +2 -1
  73. package/out/concepts/NewMap__.js.map +1 -1
  74. package/out/concepts/OqlQueryComponent__.js +3 -11
  75. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  76. package/out/concepts/OverriddenLogic__.js +7 -0
  77. package/out/concepts/OverriddenLogic__.js.map +1 -1
  78. package/out/concepts/Param__.js +2 -1
  79. package/out/concepts/Param__.js.map +1 -1
  80. package/out/concepts/ProcessElementV2__.d.ts +4 -5
  81. package/out/concepts/ProcessElementV2__.js +12 -17
  82. package/out/concepts/ProcessElementV2__.js.map +1 -1
  83. package/out/concepts/ProcessElement__.d.ts +3 -4
  84. package/out/concepts/ProcessElement__.js +44 -46
  85. package/out/concepts/ProcessElement__.js.map +1 -1
  86. package/out/concepts/ProcessV2__.d.ts +5 -0
  87. package/out/concepts/ProcessV2__.js +30 -2
  88. package/out/concepts/ProcessV2__.js.map +1 -1
  89. package/out/concepts/Process__.d.ts +5 -0
  90. package/out/concepts/Process__.js +28 -0
  91. package/out/concepts/Process__.js.map +1 -1
  92. package/out/concepts/QueryFromExpression__.js +2 -2
  93. package/out/concepts/QueryFromExpression__.js.map +1 -1
  94. package/out/concepts/QueryJoinExpression__.js +2 -2
  95. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  96. package/out/concepts/Return__.d.ts +1 -1
  97. package/out/concepts/Return__.js +2 -1
  98. package/out/concepts/Return__.js.map +1 -1
  99. package/out/concepts/StaticString__.d.ts +4 -0
  100. package/out/concepts/StaticString__.js +11 -0
  101. package/out/concepts/StaticString__.js.map +1 -1
  102. package/out/concepts/StructureProperty__.js +5 -2
  103. package/out/concepts/StructureProperty__.js.map +1 -1
  104. package/out/concepts/Structure__.js +9 -3
  105. package/out/concepts/Structure__.js.map +1 -1
  106. package/out/concepts/SubLogic__.d.ts +1 -3
  107. package/out/concepts/SubLogic__.js +14 -8
  108. package/out/concepts/SubLogic__.js.map +1 -1
  109. package/out/concepts/Transactional__.d.ts +1 -0
  110. package/out/concepts/Transactional__.js +7 -0
  111. package/out/concepts/Transactional__.js.map +1 -1
  112. package/out/concepts/TypeParam__.d.ts +4 -0
  113. package/out/concepts/TypeParam__.js +3 -0
  114. package/out/concepts/TypeParam__.js.map +1 -1
  115. package/out/concepts/ValidationRule__.d.ts +1 -6
  116. package/out/concepts/ValidationRule__.js +9 -6
  117. package/out/concepts/ValidationRule__.js.map +1 -1
  118. package/out/concepts/Variable__.d.ts +1 -1
  119. package/out/concepts/Variable__.js +7 -2
  120. package/out/concepts/Variable__.js.map +1 -1
  121. package/out/concepts/ViewElement__.d.ts +2 -0
  122. package/out/concepts/ViewElement__.js +130 -47
  123. package/out/concepts/ViewElement__.js.map +1 -1
  124. package/out/concepts/View__.d.ts +8 -0
  125. package/out/concepts/View__.js +123 -7
  126. package/out/concepts/View__.js.map +1 -1
  127. package/out/concepts/basics/stdlib/nasl.processV2.js +2 -2
  128. package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -1
  129. package/out/concepts/basics/stdlib/nasl.ui.js +1 -1
  130. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  131. package/out/concepts/basics/stdlib/nasl.validation.js +110 -4
  132. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
  133. package/out/generator/genBundleFiles.d.ts +2 -0
  134. package/out/generator/genBundleFiles.js +51 -37
  135. package/out/generator/genBundleFiles.js.map +1 -1
  136. package/out/generator/genMetaData.js +20 -26
  137. package/out/generator/genMetaData.js.map +1 -1
  138. package/out/generator/release-body/body.js +8 -6
  139. package/out/generator/release-body/body.js.map +1 -1
  140. package/out/generator/release-body/index.d.ts +1 -0
  141. package/out/generator/release-body/index.js +1 -0
  142. package/out/generator/release-body/index.js.map +1 -1
  143. package/out/generator/release-body/utils.js +1 -1
  144. package/out/generator/release-body/utils.js.map +1 -1
  145. package/out/natural/genNaturalTS.d.ts +56 -24
  146. package/out/natural/genNaturalTS.js +182 -112
  147. package/out/natural/genNaturalTS.js.map +1 -1
  148. package/out/natural/getContext/getUILib.js +4 -2
  149. package/out/natural/getContext/getUILib.js.map +1 -1
  150. package/out/natural/getContext/index.d.ts +34 -25
  151. package/out/natural/getContext/index.js +304 -157
  152. package/out/natural/getContext/index.js.map +1 -1
  153. package/out/natural/index.d.ts +1 -0
  154. package/out/natural/index.js +1 -0
  155. package/out/natural/index.js.map +1 -1
  156. package/out/natural/tools.d.ts +11 -0
  157. package/out/natural/tools.js +155 -0
  158. package/out/natural/tools.js.map +1 -0
  159. package/out/natural/transformTS2UI.js +84 -22
  160. package/out/natural/transformTS2UI.js.map +1 -1
  161. package/out/natural/transformTSCode.js +83 -22
  162. package/out/natural/transformTSCode.js.map +1 -1
  163. package/out/server/formatTsUtils.js +17 -1
  164. package/out/server/formatTsUtils.js.map +1 -1
  165. package/out/server/getLogics.js +1 -4
  166. package/out/server/getLogics.js.map +1 -1
  167. package/out/server/naslServer.js +285 -32
  168. package/out/server/naslServer.js.map +1 -1
  169. package/out/server/translator.js +5 -1
  170. package/out/server/translator.js.map +1 -1
  171. package/out/templator/genCreateBlock.js +5 -18
  172. package/out/templator/genCreateBlock.js.map +1 -1
  173. package/out/templator/genCurdMultipleKeyBlock.js +11 -32
  174. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  175. package/out/templator/genGetBlock.js +1 -2
  176. package/out/templator/genGetBlock.js.map +1 -1
  177. package/out/templator/genListViewBlock.js +6 -4
  178. package/out/templator/genListViewBlock.js.map +1 -1
  179. package/out/templator/genSelectBlock.js +82 -59
  180. package/out/templator/genSelectBlock.js.map +1 -1
  181. package/out/templator/genTableBlock.js +4 -4
  182. package/out/templator/genTableBlock.js.map +1 -1
  183. package/out/templator/genUpdateBlock.js +2 -15
  184. package/out/templator/genUpdateBlock.js.map +1 -1
  185. package/out/templator/utils.d.ts +1 -1
  186. package/out/templator/utils.js +1 -1
  187. package/out/templator/utils.js.map +1 -1
  188. package/out/translator/types.d.ts +4 -0
  189. package/out/translator/utils.d.ts +1 -0
  190. package/out/translator/utils.js +6 -1
  191. package/out/translator/utils.js.map +1 -1
  192. package/out/utils/env.d.ts +4 -0
  193. package/out/utils/env.js +6 -3
  194. package/out/utils/env.js.map +1 -1
  195. package/out/utils/index.d.ts +19 -0
  196. package/out/utils/index.js +61 -1
  197. package/out/utils/index.js.map +1 -1
  198. package/out/utils/language-cache/constant.d.ts +18 -0
  199. package/out/utils/language-cache/constant.js +35 -0
  200. package/out/utils/language-cache/constant.js.map +1 -0
  201. package/out/utils/language-cache/index.d.ts +2 -0
  202. package/out/utils/language-cache/index.js +19 -0
  203. package/out/utils/language-cache/index.js.map +1 -0
  204. package/out/utils/language-cache/nasl.d.ts +10 -0
  205. package/out/utils/language-cache/nasl.js +98 -0
  206. package/out/utils/language-cache/nasl.js.map +1 -0
  207. package/out/utils/language-cache/types.d.ts +44 -0
  208. package/out/utils/language-cache/types.js +4 -0
  209. package/out/utils/language-cache/types.js.map +1 -0
  210. package/out/utils/time-slicing/controller.js.map +1 -1
  211. package/out/utils/types.d.ts +17 -0
  212. package/package.json +3 -2
  213. package/sandbox/stdlib/nasl.core.ts +15 -11
  214. package/sandbox/stdlib/nasl.oql.ts +5 -1
  215. package/sandbox/stdlib/nasl.processV2.ts +5 -4
  216. package/sandbox/stdlib/nasl.ui.components.pc.ts +225 -225
  217. package/sandbox/stdlib/nasl.ui.ts +10 -0
  218. package/sandbox/stdlib/nasl.util.ts +11 -0
  219. package/sandbox/stdlib/nasl.validation.ts +3 -2
  220. package/sandbox-natural/stdlib/nasl.ui.pre.d.ts +1 -1
  221. package/sandbox-natural/stdlib/nasl.ui.ts +2 -2
  222. package/sandbox-natural/stdlib/nasl.util.ts +2 -2
  223. package/src/automate/engine/utils.js +1 -2
  224. package/src/bak/translator.js +1 -1
  225. package/src/common/BaseNode.ts +7 -3
  226. package/src/concepts/App__.ts +9 -1
  227. package/src/concepts/Argument__.ts +10 -5
  228. package/src/concepts/AuthLogicForCallInterface__.ts +3 -0
  229. package/src/concepts/BinaryExpression__.ts +46 -2
  230. package/src/concepts/BindAttribute__.ts +144 -46
  231. package/src/concepts/BindEvent__.ts +8 -47
  232. package/src/concepts/BusinessComponent__.ts +17 -0
  233. package/src/concepts/BusinessLogic__.ts +3 -0
  234. package/src/concepts/CallConnector__.ts +1 -1
  235. package/src/concepts/CallFunction__.ts +1 -1
  236. package/src/concepts/CallLogic__.ts +63 -17
  237. package/src/concepts/Connection__.ts +16 -0
  238. package/src/concepts/DatabaseTypeAnnotation__.ts +11 -0
  239. package/src/concepts/End__.ts +5 -1
  240. package/src/concepts/EntityProperty__.ts +5 -0
  241. package/src/concepts/Entity__.ts +29 -1
  242. package/src/concepts/EnumItem__.ts +64 -1
  243. package/src/concepts/Enum__.ts +6 -1
  244. package/src/concepts/ForEachStatement__.ts +1 -1
  245. package/src/concepts/FrontendLibrary__.ts +78 -80
  246. package/src/concepts/I18nInfo__.ts +5 -0
  247. package/src/concepts/IfStatement__.ts +2 -2
  248. package/src/concepts/Interface__.ts +6 -1
  249. package/src/concepts/Logic__.ts +39 -10
  250. package/src/concepts/MatchCase__.ts +8 -9
  251. package/src/concepts/NewComposite__.ts +2 -1
  252. package/src/concepts/NewList__.ts +2 -1
  253. package/src/concepts/NewMap__.ts +2 -1
  254. package/src/concepts/OqlQueryComponent__.ts +3 -11
  255. package/src/concepts/OverriddenLogic__.ts +7 -0
  256. package/src/concepts/Param__.ts +1 -0
  257. package/src/concepts/ProcessElementV2__.ts +14 -16
  258. package/src/concepts/ProcessElement__.ts +16 -16
  259. package/src/concepts/ProcessV2__.ts +39 -3
  260. package/src/concepts/Process__.ts +36 -0
  261. package/src/concepts/QueryFromExpression__.ts +2 -2
  262. package/src/concepts/QueryJoinExpression__.ts +2 -2
  263. package/src/concepts/Return__.ts +2 -1
  264. package/src/concepts/StaticString__.ts +12 -0
  265. package/src/concepts/StructureProperty__.ts +7 -2
  266. package/src/concepts/Structure__.ts +11 -3
  267. package/src/concepts/SubLogic__.ts +15 -9
  268. package/src/concepts/Transactional__.ts +5 -0
  269. package/src/concepts/TypeParam__.ts +6 -0
  270. package/src/concepts/ValidationRule__.ts +7 -6
  271. package/src/concepts/Variable__.ts +7 -2
  272. package/src/concepts/ViewElement__.ts +130 -47
  273. package/src/concepts/View__.ts +157 -8
  274. package/src/concepts/basics/stdlib/nasl.processV2.ts +2 -2
  275. package/src/concepts/basics/stdlib/nasl.ui.ts +1 -1
  276. package/src/concepts/basics/stdlib/nasl.validation.ts +111 -4
  277. package/src/generator/genBundleFiles.ts +53 -39
  278. package/src/generator/genMetaData.ts +21 -26
  279. package/src/generator/release-body/body.ts +9 -6
  280. package/src/generator/release-body/index.ts +1 -0
  281. package/src/generator/release-body/utils.ts +4 -2
  282. package/src/natural/genNaturalTS.ts +327 -141
  283. package/src/natural/getContext/getUILib.ts +4 -2
  284. package/src/natural/getContext/index.ts +348 -171
  285. package/src/natural/index.ts +1 -0
  286. package/src/natural/tools.ts +130 -0
  287. package/src/natural/transformTS2UI.ts +84 -22
  288. package/src/natural/transformTSCode.ts +83 -22
  289. package/src/server/formatTsUtils.ts +21 -1
  290. package/src/server/getLogics.ts +1 -4
  291. package/src/server/naslServer.ts +302 -33
  292. package/src/server/translator.ts +5 -1
  293. package/src/templator/genCreateBlock.ts +5 -18
  294. package/src/templator/genCurdMultipleKeyBlock.ts +14 -32
  295. package/src/templator/genGetBlock.ts +2 -4
  296. package/src/templator/genListViewBlock.ts +6 -4
  297. package/src/templator/genSelectBlock.ts +88 -61
  298. package/src/templator/genTableBlock.ts +4 -4
  299. package/src/templator/genUpdateBlock.ts +2 -15
  300. package/src/templator/utils.ts +1 -1
  301. package/src/translator/types.ts +4 -0
  302. package/src/translator/utils.ts +6 -0
  303. package/src/utils/env.ts +5 -4
  304. package/src/utils/index.ts +50 -1
  305. package/src/utils/language-cache/constant.ts +37 -0
  306. package/src/utils/language-cache/index.ts +2 -0
  307. package/src/utils/language-cache/nasl.ts +83 -0
  308. package/src/utils/language-cache/types.ts +48 -0
  309. package/src/utils/time-slicing/controller.ts +0 -1
  310. package/src/utils/types.ts +20 -0
  311. package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +13 -13
  312. package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +12 -12
  313. package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -2
  314. package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +221 -217
  315. package/ts-worker/bundle.js +1 -1
  316. package/ts-worker/src/index.js +0 -1
  317. package/out/utils/delay/index.d.ts +0 -0
  318. package/out/utils/delay/index.js +0 -1
  319. package/out/utils/delay/index.js.map +0 -1
  320. package/src/utils/delay/index.ts +0 -0
@@ -13,7 +13,7 @@ import { createUUID } from '../utils/create';
13
13
  import * as types from './utils/types';
14
14
  import * as asserts from './utils/asserts';
15
15
  import BaseNode from '../common/BaseNode';
16
- import LogicDeclaration from './LogicDeclaration__';
16
+ import Logic from './Logic__';
17
17
  import ViewComponentDeclaration from './ViewComponentDeclaration__';
18
18
 
19
19
  /**
@@ -59,11 +59,11 @@ export class FrontendLibrary extends BaseNode {
59
59
  * 依赖库逻辑声明列表
60
60
  */
61
61
  @property({
62
- objectRef: 'LogicDeclaration',
62
+ objectRef: 'Logic',
63
63
  isArray: true,
64
64
  defaultValue: [],
65
65
  })
66
- logics: Array<LogicDeclaration> = [];
66
+ logics: Array<Logic> = [];
67
67
 
68
68
  /**
69
69
  * 依赖库组件声明列表
@@ -88,98 +88,96 @@ export class FrontendLibrary extends BaseNode {
88
88
  return super.from(source, parentNode, parentKey) as FrontendLibrary;
89
89
  }
90
90
 
91
- getLogicDeclarationExistingNames(excludedList: Array<LogicDeclaration> = []) {
91
+ getLogicExistingNames(excludedList: Array<Logic> = []) {
92
92
  const excludedSet = new Set(excludedList);
93
- return ((this.logics as LogicDeclaration[]) || [])
94
- .filter((item) => !excludedSet.has(item))
95
- .map((item) => item.name);
93
+ return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
96
94
  }
97
- getLogicDeclarationUniqueName(name = 'logicDeclaration1') {
98
- return utils.unique(name, this.getLogicDeclarationExistingNames(), undefined, true);
95
+ getLogicUniqueName(name = 'logic1') {
96
+ return utils.unique(name, this.getLogicExistingNames(), undefined, true);
99
97
  }
100
98
 
101
99
  /**
102
- * 插入逻辑声明
100
+ * 插入逻辑
103
101
  * @internal
104
- * @param name 逻辑声明名称,如果不填会自动生成一个唯一名称
102
+ * @param name 逻辑名称,如果不填会自动生成一个唯一名称
105
103
  */
106
- _insertLogicDeclarationAt(name: string, index: number): LogicDeclaration;
104
+ _insertLogicAt(name: string, index: number): Logic;
107
105
 
108
106
  /**
109
- * 插入逻辑声明
107
+ * 插入逻辑
110
108
  * @internal
111
- * @param logicDeclarationOptions 逻辑声明参数
109
+ * @param logicOptions 逻辑参数
112
110
  */
113
- _insertLogicDeclarationAt(logicDeclarationOptions: Partial<LogicDeclaration>, index: number): LogicDeclaration;
111
+ _insertLogicAt(logicOptions: Partial<Logic>, index: number): Logic;
114
112
 
115
113
  /**
116
- * 插入逻辑声明
114
+ * 插入逻辑
117
115
  * @internal
118
- * @param logicDeclaration 已有的逻辑声明实例
116
+ * @param logic 已有的逻辑实例
119
117
  */
120
- _insertLogicDeclarationAt(logicDeclaration: LogicDeclaration, index: number): LogicDeclaration;
118
+ _insertLogicAt(logic: Logic, index: number): Logic;
121
119
 
122
- _insertLogicDeclarationAt(options: string | Partial<LogicDeclaration> | LogicDeclaration, index: number) {
123
- const logicDeclarationOptions: any = {};
120
+ _insertLogicAt(options: string | Partial<Logic> | Logic, index: number) {
121
+ const logicOptions: any = {};
124
122
  const relationOptions = { parentNode: this, parentKey: 'logics' };
125
- const LogicDeclaration = getConceptConstructor('LogicDeclaration');
126
- let logicDeclaration: LogicDeclaration;
123
+ const Logic = getConceptConstructor('Logic');
124
+ let logic: Logic;
127
125
  if (!options) {
128
- logicDeclaration = LogicDeclaration.from(
126
+ logic = Logic.from(
129
127
  {
130
- ...logicDeclarationOptions,
131
- name: this.getLogicDeclarationUniqueName(),
128
+ ...logicOptions,
129
+ name: this.getLogicUniqueName(),
132
130
  },
133
131
  this,
134
132
  'logics',
135
133
  );
136
134
  } else if (typeof options === 'string') {
137
- logicDeclaration = LogicDeclaration.from(
135
+ logic = Logic.from(
138
136
  {
139
- ...logicDeclarationOptions,
137
+ ...logicOptions,
140
138
  name: options,
141
139
  },
142
140
  this,
143
141
  'logics',
144
142
  );
145
- } else if (asserts.isLogicDeclaration(options)) {
143
+ } else if (asserts.isLogic(options)) {
146
144
  options.ensureDelete(); // 同一实例不支持多处存在
147
- logicDeclaration = options;
148
- Object.assign(logicDeclaration, relationOptions);
145
+ logic = options;
146
+ Object.assign(logic, relationOptions);
149
147
  } else {
150
- logicDeclaration = LogicDeclaration.from(
148
+ logic = Logic.from(
151
149
  {
152
- ...logicDeclarationOptions,
150
+ ...logicOptions,
153
151
  ...options,
154
152
  },
155
153
  this,
156
154
  'logics',
157
155
  );
158
156
  }
159
- this.logics.splice(index, 0, logicDeclaration);
160
- return logicDeclaration;
157
+ this.logics.splice(index, 0, logic);
158
+ return logic;
161
159
  }
162
160
 
163
161
  /**
164
- * 插入逻辑声明
165
- * @param name 逻辑声明名称,如果不填会自动生成一个唯一名称
162
+ * 插入逻辑
163
+ * @param name 逻辑名称,如果不填会自动生成一个唯一名称
166
164
  */
167
- insertLogicDeclarationAt(name: string, index: number): LogicDeclaration;
165
+ insertLogicAt(name: string, index: number): Logic;
168
166
 
169
167
  /**
170
- * 插入逻辑声明
171
- * @param logicDeclarationOptions 逻辑声明参数
168
+ * 插入逻辑
169
+ * @param logicOptions 逻辑参数
172
170
  */
173
- insertLogicDeclarationAt(logicDeclarationOptions: Partial<LogicDeclaration>, index: number): LogicDeclaration;
171
+ insertLogicAt(logicOptions: Partial<Logic>, index: number): Logic;
174
172
 
175
173
  /**
176
- * 插入逻辑声明
177
- * @param logicDeclaration 已有的逻辑声明实例
174
+ * 插入逻辑
175
+ * @param logic 已有的逻辑实例
178
176
  */
179
- insertLogicDeclarationAt(logicDeclaration: LogicDeclaration, index: number): LogicDeclaration;
177
+ insertLogicAt(logic: Logic, index: number): Logic;
180
178
 
181
- insertLogicDeclarationAt(options: string | Partial<LogicDeclaration> | LogicDeclaration, index: number) {
182
- const node = this._insertLogicDeclarationAt(options as any, index);
179
+ insertLogicAt(options: string | Partial<Logic> | Logic, index: number) {
180
+ const node = this._insertLogicAt(options as any, index);
183
181
  node.create({
184
182
  index,
185
183
  parentNode: this,
@@ -189,52 +187,52 @@ export class FrontendLibrary extends BaseNode {
189
187
  }
190
188
 
191
189
  /**
192
- * 添加逻辑声明
190
+ * 添加逻辑
193
191
  * @internal
194
- * @param name 逻辑声明名称,如果不填会自动生成一个唯一名称
192
+ * @param name 逻辑名称,如果不填会自动生成一个唯一名称
195
193
  */
196
- _addLogicDeclaration(name?: string): LogicDeclaration;
194
+ _addLogic(name?: string): Logic;
197
195
 
198
196
  /**
199
- * 添加逻辑声明
197
+ * 添加逻辑
200
198
  * @internal
201
- * @param logicDeclarationOptions 逻辑声明参数
199
+ * @param logicOptions 逻辑参数
202
200
  */
203
- _addLogicDeclaration(logicDeclarationOptions: Partial<LogicDeclaration>): LogicDeclaration;
201
+ _addLogic(logicOptions: Partial<Logic>): Logic;
204
202
 
205
203
  /**
206
- * 添加逻辑声明
204
+ * 添加逻辑
207
205
  * @internal
208
- * @param logicDeclaration 已有的逻辑声明实例
206
+ * @param logic 已有的逻辑实例
209
207
  */
210
- _addLogicDeclaration(logicDeclaration: LogicDeclaration): LogicDeclaration;
208
+ _addLogic(logic: Logic): Logic;
211
209
 
212
- _addLogicDeclaration(options?: string | Partial<LogicDeclaration> | LogicDeclaration) {
210
+ _addLogic(options?: string | Partial<Logic> | Logic) {
213
211
  const index = this.logics.length;
214
- return this._insertLogicDeclarationAt(options as any, index);
212
+ return this._insertLogicAt(options as any, index);
215
213
  }
216
214
 
217
215
  /**
218
- * 添加逻辑声明
216
+ * 添加逻辑
219
217
  * @internal
220
- * @param name 逻辑声明名称,如果不填会自动生成一个唯一名称
218
+ * @param name 逻辑名称,如果不填会自动生成一个唯一名称
221
219
  */
222
- addLogicDeclaration(name?: string): LogicDeclaration;
220
+ addLogic(name?: string): Logic;
223
221
 
224
222
  /**
225
- * 添加逻辑声明
226
- * @param logicDeclarationOptions 逻辑声明参数
223
+ * 添加逻辑
224
+ * @param logicOptions 逻辑参数
227
225
  */
228
- addLogicDeclaration(logicDeclarationOptions: Partial<LogicDeclaration>): LogicDeclaration;
226
+ addLogic(logicOptions: Partial<Logic>): Logic;
229
227
 
230
228
  /**
231
- * 添加逻辑声明
232
- * @param logicDeclaration 已有的逻辑声明实例
229
+ * 添加逻辑
230
+ * @param logic 已有的逻辑实例
233
231
  */
234
- addLogicDeclaration(logicDeclaration: LogicDeclaration): LogicDeclaration;
232
+ addLogic(logic: Logic): Logic;
235
233
 
236
- addLogicDeclaration(options?: string | Partial<LogicDeclaration> | LogicDeclaration) {
237
- const node = this._addLogicDeclaration(options as any);
234
+ addLogic(options?: string | Partial<Logic> | Logic) {
235
+ const node = this._addLogic(options as any);
238
236
  const index = this.logics.indexOf(node);
239
237
  node.create({
240
238
  index,
@@ -423,28 +421,28 @@ export class FrontendLibrary extends BaseNode {
423
421
  }
424
422
 
425
423
  /**
426
- * 删除逻辑声明
427
- * @param name 逻辑声明名称
424
+ * 删除逻辑
425
+ * @param name 逻辑名称
428
426
  */
429
- removeLogicDeclaration(name: string): void;
427
+ removeLogic(name: string): void;
430
428
 
431
429
  /**
432
- * 删除逻辑声明
433
- * @param logicDeclaration 已有的逻辑声明实例
430
+ * 删除逻辑
431
+ * @param logic 已有的逻辑实例
434
432
  */
435
- removeLogicDeclaration(logicDeclaration: LogicDeclaration): void;
433
+ removeLogic(logic: Logic): void;
436
434
 
437
- removeLogicDeclaration(options: string | LogicDeclaration) {
438
- let logicDeclaration: LogicDeclaration;
435
+ removeLogic(options: string | Logic) {
436
+ let logic: Logic;
439
437
  if (typeof options === 'string') {
440
- logicDeclaration = (this.logics as LogicDeclaration[]).find((item) => item.name === options);
441
- if (!logicDeclaration) {
442
- throw new Error('找不到逻辑声明 ' + options);
438
+ logic = (this.logics as Logic[]).find((item) => item.name === options);
439
+ if (!logic) {
440
+ throw new Error('找不到逻辑 ' + options);
443
441
  }
444
442
  } else {
445
- logicDeclaration = options;
443
+ logic = options;
446
444
  }
447
- return logicDeclaration.delete();
445
+ return logic.delete();
448
446
  }
449
447
 
450
448
  /**
@@ -92,6 +92,11 @@ export class I18nInfo extends BaseNode {
92
92
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
93
93
  // 自动生成的代码已结束。下面可以手动编写。
94
94
  //================================================================================
95
+ @withSourceMap()
96
+ toNaturalTS(state = createCompilerState()): string {
97
+ return '';
98
+ }
99
+
95
100
  get messagesLanguageList() {
96
101
  return Object.keys(this.messageMap || {});
97
102
  }
@@ -468,7 +468,7 @@ export class IfStatement extends LogicItem {
468
468
  });
469
469
  if (state.focusedNodePath === `${this.nodePath}.alternate[${this.alternate.length}]`)
470
470
  code += `${indent((state?.tabSize || 0) + 1)}/* 当前位置 */\n`;
471
- code += `${indent(state?.tabSize || 0)}}\n`;
471
+ code += `${indent(state?.tabSize || 0)}}`;
472
472
  return code;
473
473
  }
474
474
 
@@ -506,7 +506,7 @@ export class IfStatement extends LogicItem {
506
506
  });
507
507
  if (state.focusedNodePath === `${this.nodePath}.alternate[${this.alternate.length}]`)
508
508
  code += `${indent((state?.tabSize || 0) + 1)}/* 当前位置 */\n`;
509
- code += `${indent(state?.tabSize || 0)}}\n`;
509
+ code += `${indent(state?.tabSize || 0)}}`;
510
510
  return code;
511
511
  }
512
512
 
@@ -9,6 +9,7 @@ import {
9
9
  withSourceMapGenerator,
10
10
  withGenerator,
11
11
  TranslatorGenerator,
12
+ createDescriptionComment,
12
13
  } from '../translator';
13
14
  import type Namespace from './Namespace__';
14
15
  import type TypeAnnotation from './TypeAnnotation__';
@@ -978,7 +979,11 @@ export class Interface extends ImportedInterface {
978
979
  @withSourceMap()
979
980
  toNaturalTS(state = createCompilerState(), interfaceName: string): string {
980
981
  const { name, params, returns } = this || {};
981
- let code = `declare function ${interfaceName || name}(`;
982
+
983
+ let code = '';
984
+ if (state.descriptionComment)
985
+ code += createDescriptionComment(state, this, ['description']);
986
+ code = `declare function ${interfaceName || name}(`;
982
987
  if (params?.length) {
983
988
  code += '{';
984
989
  params?.forEach((param, index) => {
@@ -17,6 +17,7 @@ import {
17
17
  withSourceMapGenerator,
18
18
  withGenerator,
19
19
  TranslatorGenerator,
20
+ createDescriptionComment,
20
21
  } from '../translator';
21
22
  import type App from './App__';
22
23
  import type Namespace from './Namespace__';
@@ -1274,7 +1275,8 @@ export class Logic extends Annotatable {
1274
1275
  }
1275
1276
 
1276
1277
  get __isVirtual() {
1277
- return this.processV2?.__isVirtual || this.process?.__isVirtual || false;
1278
+ const isDisabled = !!this.getAncestor('HistoryProcessV2') || ['enabled', 'history'].includes(this.processV2?.status)
1279
+ return isDisabled || this.process?.__isVirtual || false;
1278
1280
  }
1279
1281
 
1280
1282
  // 用于calllogic树中定位是那个logic,回显
@@ -1577,6 +1579,9 @@ export class Logic extends Annotatable {
1577
1579
  // 内置函数对集合类型的推导
1578
1580
  (asserts.isCallFunction(el) && el.derivablecollection?.name))
1579
1581
  ) {
1582
+ if (el?.getAncestor('SubLogic')) {
1583
+ return;
1584
+ }
1580
1585
  if (asserts.isAssignment(el)) {
1581
1586
  const advanceVar = self.variables?.find(
1582
1587
  (variable) => !variable.typeAnnotation && el.left?.name === variable.name,
@@ -1772,11 +1777,26 @@ export class Logic extends Annotatable {
1772
1777
  toEmbeddedTSNoExport(state?: TranslatorState): string {
1773
1778
  return runSync(this.toEmbeddedTS(state, 'noExport'));
1774
1779
  }
1775
- get tsName() {
1780
+ get tsName(): string {
1781
+ const { parentNode: parent, connector, integration, view, name } = this;
1782
+
1783
+ if (!view || parent.concept !== 'BindEvent') {
1784
+ return this.name;
1785
+ }
1786
+
1776
1787
  // 来自集成中心,且是连接内部的逻辑,则认为是编辑态的,需要加上后缀
1777
- if (this.connector && this.integration) {
1788
+ if (connector && integration) {
1778
1789
  return `${this.name}${CUSTOM_CONNECTOR_EDITABLE_SUFFIX}`;
1779
1790
  }
1791
+
1792
+ const { parentNode: grandPar } = parent;
1793
+
1794
+ if (grandPar.concept === 'View') {
1795
+ return `$$_view_${parent.parentNode.name}_bind_event_${name}`;
1796
+ }
1797
+ else if (grandPar.concept === 'ViewElement') {
1798
+ return `$$_view_element_${parent.parentNode.name}_bind_event_${name}`;
1799
+ }
1780
1800
  // 由于Logic name 已经是符合函数预期的,因此不再需要做格式化
1781
1801
  return this.name;
1782
1802
  }
@@ -1883,6 +1903,9 @@ export class Logic extends Annotatable {
1883
1903
  // 内置函数对集合类型的推导
1884
1904
  (asserts.isCallFunction(el) && el.derivablecollection?.name))
1885
1905
  ) {
1906
+ if (el?.getAncestor('SubLogic')) {
1907
+ return;
1908
+ }
1886
1909
  if (asserts.isAssignment(el)) {
1887
1910
  const advanceVar = self.variables?.find(
1888
1911
  (variable) => !variable.typeAnnotation && el.left?.name === variable.name,
@@ -2214,6 +2237,8 @@ export class Logic extends Annotatable {
2214
2237
  @withSourceMap()
2215
2238
  toNaturalTS(state = createCompilerState()): string {
2216
2239
  let code = '';
2240
+ if (state.descriptionComment)
2241
+ code += createDescriptionComment(state, this, ['description']);
2217
2242
 
2218
2243
  let logicName = this.name;
2219
2244
  if (state.autoPrefixName) {
@@ -2380,6 +2405,10 @@ export class Logic extends Annotatable {
2380
2405
  const calleeLogic = this.app.logics.find((l) => l.name === calleeName);
2381
2406
  return calleeLogic ? `app.logics.${calleeName}(${calleeLogic.params.map(() => 'null').join(',')})` : null;
2382
2407
  }
2408
+ // 调用依赖库逻辑可能会有子逻辑,子逻辑拼接可能有ts忽略先去掉
2409
+ if (asserts.isCallLogic(rightNode) && rightNode.calleeNamespace?.startsWith('extensions.')) {
2410
+ code = code.replaceAll('// @ts-ignore', '');
2411
+ }
2383
2412
 
2384
2413
  // ForEachStatement 内部变量需要替换处理,如 item、index
2385
2414
  const forEachStatement = assignment.getAncestor('ForEachStatement') as ForEachStatement;
@@ -2689,6 +2718,11 @@ export class Logic extends Annotatable {
2689
2718
  actionMsg,
2690
2719
  });
2691
2720
  super.delete();
2721
+ this.body.forEach((el) => {
2722
+ if (asserts.isCallInterface(el)) {
2723
+ el.deleteCallNode()
2724
+ }
2725
+ })
2692
2726
  this.traverseChildren(async (el) => {
2693
2727
  if (el?.concept === 'CallQueryComponent') (el as CallQueryComponent).removeStructure();
2694
2728
  // 仅仅针对 自定义连接器下的 Loigc,其他需要界定边界
@@ -2855,18 +2889,13 @@ export class Logic extends Annotatable {
2855
2889
  return Array.from(this.existingSubLogic);
2856
2890
  }
2857
2891
 
2858
- getSubLogicUniqueName(name = 'subLogic1') {
2892
+ getSubLogicUniqueName(name = 'subLogic1', excludedNames: Array<string> = []) {
2859
2893
  const existingNames = this.getSubLogicExistingNames();
2860
- const uniqueName = utils.unique(name, existingNames, undefined, false);
2894
+ const uniqueName = utils.unique(name, existingNames.concat(excludedNames), undefined, false);
2861
2895
  this.existingSubLogic.add(uniqueName);
2862
2896
  return uniqueName;
2863
2897
  }
2864
2898
 
2865
- genActionListener($event: EventPayload): void {
2866
- super.genActionListener($event);
2867
- invokeCommand('logic.update', this);
2868
- }
2869
-
2870
2899
  /**
2871
2900
  * 完成的泛型参数
2872
2901
  * 先指支持依赖库的泛型参数
@@ -150,15 +150,6 @@ export class MatchCase extends LogicItem {
150
150
  return logicItem;
151
151
  }
152
152
 
153
- getLogicItemExistingNames(excludedList: Array<LogicItem> = []) {
154
- const excludedSet = new Set(excludedList);
155
- return ((this.patterns as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
156
- }
157
-
158
- getLogicItemUniqueName(name = 'logicItem1') {
159
- return utils.unique(name, this.getLogicItemExistingNames(), undefined, false);
160
- }
161
-
162
153
  /**
163
154
  * 插入逻辑项
164
155
  * @param logicItemOptions 逻辑项参数
@@ -591,6 +582,14 @@ export class MatchCase extends LogicItem {
591
582
  // 自动生成的代码已结束。下面可以手动编写。
592
583
  //================================================================================
593
584
 
585
+ getLogicItemExistingNames(excludedList: Array<LogicItem> = []) {
586
+ const excludedSet = new Set(excludedList);
587
+ return ((this.patterns as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
588
+ }
589
+ getLogicItemUniqueName(name = 'logicItem1') {
590
+ return utils.unique(name, this.getLogicItemExistingNames(), undefined, false);
591
+ }
592
+
594
593
  // 是否处于禁用状态
595
594
  get isDisabled() {
596
595
  const matchExpression = this.parentNode as Match;
@@ -1024,7 +1024,8 @@ export class NewComposite extends LogicItem {
1024
1024
  if (!this.typeAnnotation) return null;
1025
1025
  // 祖先逻辑
1026
1026
  const ancestorLogic = this.getAncestor('Logic');
1027
- if (ancestorLogic) {
1027
+ const bindAttribute = this.getAncestor('BindAttribute');
1028
+ if (ancestorLogic || bindAttribute?.name === 'dataSource') {
1028
1029
  code += 'await (async () => { \n';
1029
1030
  } else {
1030
1031
  code += '(() => { \n';
@@ -320,7 +320,8 @@ export class NewList extends LogicItem {
320
320
  let code = '';
321
321
  // 祖先逻辑
322
322
  const ancestorLogic = this.getAncestor('Logic');
323
- if (ancestorLogic) {
323
+ const bindAttribute = this.getAncestor('BindAttribute');
324
+ if (ancestorLogic || bindAttribute?.name === 'dataSource') {
324
325
  code += 'await (async () => { \n';
325
326
  } else {
326
327
  code += '(() => { \n';
@@ -543,7 +543,8 @@ export class NewMap extends LogicItem {
543
543
  let code = '';
544
544
  // 祖先逻辑
545
545
  const ancestorLogic = this.getAncestor('Logic');
546
- if (ancestorLogic) {
546
+ const bindAttribute = this.getAncestor('BindAttribute');
547
+ if (ancestorLogic || bindAttribute?.name === 'dataSource') {
547
548
  code += 'await (async () => { \n';
548
549
  } else {
549
550
  code += '(() => { \n';
@@ -124,17 +124,9 @@ export class OqlQueryComponent extends LogicItem {
124
124
 
125
125
  getTextVariables() {
126
126
  this._TsVariables = [];
127
- const str = this.code;
128
- const variables: Set<string> = new Set();
129
127
  const Identifier = getConceptConstructor('Identifier');
130
128
  const MemberExpression = getConceptConstructor('MemberExpression');
131
- let temp: any;
132
- const re = /\{(.+?)\}/g;
133
- while ((temp = re.exec(str))) {
134
- let variable = temp[1];
135
- variable = variable.replaceAll(' ', '');
136
- variables.add(variable);
137
- }
129
+ const variables: Array<string> = this.codeSourceMap?.variableNames || [];
138
130
  for (const variable of variables) {
139
131
  // 遍历Set
140
132
  let newVariable: Identifier | MemberExpression;
@@ -252,10 +244,10 @@ export class OqlQueryComponent extends LogicItem {
252
244
  if (typescript) {
253
245
  code += `${indent1}const __oqlQueryResult = ${typescript};`;
254
246
  }
255
- // 临时方案拼接字符串
256
- self.getTextVariables();
257
247
  // 翻译字段
258
248
  code += '\n';
249
+ // 从接口获取可以调试变量的字段,用作下面翻译,作为后面调试的变量。拼接
250
+ self.getTextVariables();
259
251
  yield* wrapForEach(self._TsVariables, function* warpForEachGenerator(variable) {
260
252
  code += yield* variable.toEmbeddedTS(shiftState(state, code));
261
253
  code += ';\n';
@@ -1594,6 +1594,9 @@ export class OverriddenLogic extends BaseNode {
1594
1594
  // 内置函数对集合类型的推导
1595
1595
  (asserts.isCallFunction(el) && el.derivablecollection?.name))
1596
1596
  ) {
1597
+ if (el?.getAncestor('SubLogic')) {
1598
+ return;
1599
+ }
1597
1600
  if (asserts.isAssignment(el)) {
1598
1601
  const advanceVar = self.variables?.find(
1599
1602
  (variable) => !variable.typeAnnotation && el.left?.name === variable.name,
@@ -1976,6 +1979,10 @@ export class OverriddenLogic extends BaseNode {
1976
1979
  const calleeLogic = this.app.logics.find((l) => l.name === calleeName);
1977
1980
  return calleeLogic ? `app.logics.${calleeName}(${calleeLogic.params.map(() => 'null').join(',')})` : null;
1978
1981
  }
1982
+ // 调用依赖库逻辑可能会有子逻辑,子逻辑拼接可能有ts忽略先去掉
1983
+ if (asserts.isCallLogic(rightNode) && rightNode.calleeNamespace?.startsWith('extensions.')) {
1984
+ code = code.replaceAll('// @ts-ignore', '');
1985
+ }
1979
1986
 
1980
1987
  // ForEachStatement 内部变量需要替换处理,如 item、index
1981
1988
  const forEachStatement = assignment.getAncestor('ForEachStatement') as ForEachStatement;
@@ -194,6 +194,7 @@ export class Param extends BaseNode {
194
194
  }
195
195
 
196
196
  @excludedInJSON()
197
+ @property()
197
198
  required: boolean;
198
199
 
199
200
  @excludedInJSON()
@@ -23,6 +23,7 @@ import type Namespace from './Namespace__';
23
23
  import type View from './View__';
24
24
  import type HistoryProcessV2 from './HistoryProcessV2__';
25
25
  import type ProcessV2 from './ProcessV2__';
26
+ import type SubLogic from './SubLogic__';
26
27
  //================================================================================
27
28
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
28
29
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -1251,7 +1252,8 @@ export class ProcessElementV2 extends BaseNode {
1251
1252
  }
1252
1253
 
1253
1254
  get __isVirtual() {
1254
- return this.processV2.__isVirtual;
1255
+ const isDisabled = !!this.getAncestor('HistoryProcessV2') || ['enabled', 'history'].includes(this.processV2.status)
1256
+ return isDisabled;
1255
1257
  }
1256
1258
 
1257
1259
  get AssigneeV2() {
@@ -1351,6 +1353,9 @@ export class ProcessElementV2 extends BaseNode {
1351
1353
  @withSourceMapGenerator
1352
1354
  *toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
1353
1355
  const self = this;
1356
+ // 获取所有子节点用于树上填充
1357
+ self.getSubLogics();
1358
+
1354
1359
  const tab1 = indent((state?.tabSize || 0) + 1);
1355
1360
  const tab2 = indent((state?.tabSize || 0) + 2);
1356
1361
  const tab3 = indent((state?.tabSize || 0) + 3);
@@ -1528,22 +1533,15 @@ export class ProcessElementV2 extends BaseNode {
1528
1533
  return code;
1529
1534
  }
1530
1535
 
1531
- get subLogic() {
1532
- // 只有自动任务需要, 其他的UI展示上均在其下面的 Logic 中
1533
- if (this.type === 'ServiceTask') {
1534
- const subLogics = this.findNaslNodeByBFS((node: BaseNode) => {
1535
- if (asserts.isSubLogic(node)) {
1536
- return true;
1537
- }
1538
- });
1539
- return subLogics;
1540
- }
1541
- return [];
1542
- }
1536
+ subLogics: Array<SubLogic> = [];
1543
1537
 
1544
- genActionListener($event: EventPayload): void {
1545
- super.genActionListener($event);
1546
- invokeCommand('logic.update', this);
1538
+ getSubLogics() {
1539
+ const subLogics = this.findNaslNodeByBFS((node: BaseNode) => {
1540
+ if (asserts.isSubLogic(node)) {
1541
+ return true;
1542
+ }
1543
+ });
1544
+ this.subLogics = subLogics as Array<SubLogic>;
1547
1545
  }
1548
1546
 
1549
1547
  //================================================================================