CallEvent 触发事件
1. 结构声明
- TS Declaration
- JSON Schema
class CallEvent extends LogicItem {
calleeNamespace: string;
calleeName: string;
arguments: Array<Argument>;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"folded": {
"type": "boolean"
},
"offsetX": {
"type": "number"
},
"offsetY": {
"type": "number"
},
"calleeNamespace": {
"type": "string"
},
"calleeName": {
"type": "string"
},
"arguments": {
"type": "array",
"items": {
"$ref": "#/definitions/Argument"
}
}
},
"required": [
"calleeNamespace",
"calleeName",
"arguments"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "CallEvent",
"calleeNamespace": "",
"calleeName": "confirm",
"arguments": [
{
"concept": "Argument",
"keyword": "payload",
"expression": {
"concept": "StringLiteral",
"value": "OK!"
}
}
]
}
concept: CallEvent
calleeNamespace: ""
calleeName: confirm
arguments:
- concept: Argument
keyword: payload
expression:
concept: StringLiteral
value: OK!
对应的代码如下:
- 文本化 NASL
onConfirm('OK!')