Files
JiboSDK/node_modules/jibo-sdk/resources/externals/backward-compatibility/schemas/schema-flow.json
2026-03-22 04:24:01 +02:00

481 lines
15 KiB
JSON

{
"Flow.Begin": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Limeade",
"order": 100
},
"description": "The first shape to be executed in a Jibo Flow Editor procedure, only one allowed per procedure.",
"type": "leaf",
"options": [
{
"type": "Function",
"field": "inputParameters",
"description": "Prototype function text that is copied to provide input parms (and defaults) to this procedure when it is called from another procedure as a subflow. This code is just a text template and is not executed here.",
"defaultValue": "()=>{\n return {\n// parm1: 'parm1_default_value',\n// parm2: 'parm2_default_value'\n };\n}"
}
]
},
"Flow.Begin-Parallel": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Grass",
"order": 101
},
"description": "The beginning of an Asynchronous thread, more than one allowed per procedure. Execution commences when the page is invoked, simultaneously with the Flow.Begin on the page.",
"type": "leaf",
"options": [
]
},
"Flow.Picture": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "white",
"text": "picture",
"title": "picture",
"order": 102
},
"description": "An image to display on the diagram as an annotation (not an activity that is executed at runtime).",
"type": "leaf",
"options": [
{
"location": "",
"type": "string",
"field": "title",
"description": "The picture title.",
"defaultValue": ""
},
{
"location": "",
"type": "image",
"field": "url",
"description": "The URI/Filename for the picture.",
"defaultValue": ""
},
{
"location": "",
"type": "string",
"field": "caption",
"description": "The picture caption.",
"defaultValue": ""
}
]
},
"Flow.Comment": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "white",
"text": "notes",
"order": 103
},
"description": "A place to keep notes.",
"type": "leaf",
"options": [
{
"location": "",
"type": "string",
"field": "text",
"description": "The text of the comment.",
"defaultValue": ""
}
]
},
"Flow.End": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Firecracker",
"order": 104
},
"description": "Ends execution of a Jibo Flow Editor procedure and returns to the calling procedure, or exits if this is the top-most procedure.",
"type": "leaf",
"options": [
{
"location": "options",
"type": "Function",
"field": "getTransition",
"description": "Returns the string value that will be used as the Transition from the subflow activity (if undefined, the Flow.End activity name is used).",
"defaultValue": "() => { return ; }"
}
]
},
"Flow.Subflow": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Topaz",
"order": 105
},
"description": "Calls a subflow.",
"type": "leaf",
"options": [
{
"type": "subflow",
"field": "subflowId",
"description": "path to subflow's .flow file (without the .flow extension)",
"defaultValue": ""
},
{
"type": "Function",
"field": "inputParameters",
"description": "Returns the object that appears in the called subflow as 'notepad.params'.",
"defaultValue": "() => {return {}; }"
},
{
"type": "Function",
"field": "getTransition",
"description": "Returns the transition result from the subflow.",
"defaultValue": "(subflow_result_object) => {\n return subflow_result_object.transition;\n}"
}
]
},
"Flow.Subtree": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Topaz",
"order": 106
},
"description": "Executes a behavior tree (.bt) as a single behavior and returns the status of the subtree.",
"type": "leaf",
"options": [
{
"type": "Subtree",
"field": "behaviorPath",
"description": "Select a subtree.",
"defaultValue": "null"
},
{
"type": "Function",
"field": "getNotepad",
"description": "Returns an object that will be this tree's notepad.",
"defaultValue": "() => {\n return {};\n}"
},
{
"type": "Function",
"field": "onResult",
"description": "Returns the transition result from the subtree.",
"defaultValue": "(treeResult) => {\n\treturn treeResult.transition;\n}"
}
]
},
"Flow.Throw": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Grass",
"order": 107
},
"description": "Throws an exception (the name of the activity becomes the name of the exception thrown).",
"type": "leaf",
"options": [
{
"type": "Function",
"field": "getPayload",
"description": "Returns an object that will be made available as the 'payload' argument to Flow.Catch.",
"defaultValue": "() => {\n return {};\n}"
}
]
},
"Flow.Interrupt": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Limeade",
"order": 108
},
"description": "For use in Parallel threads; causes the Primary thread to take an exception, no matter where it is (the name of the activity becomes the name of the exception thrown).",
"type": "leaf",
"options": [
{
"type": "Function",
"field": "getPayload",
"description": "Returns an object that will be made available as the 'payload' argument to Flow.Catch.",
"defaultValue": "() => {\n return {};\n}"
}
]
},
"Flow.Catch": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Limeade",
"order": 109
},
"description": "Catches the exception given by the name of the activity.",
"type": "leaf",
"options": [
{
"type": "Function",
"field": "getTransition",
"description": "Called with the actual Exception string and the return value from the Exception or Interrupt's getPayload() functions. Returns the Flow.Catch transition value.",
"defaultValue": "(exception, payload) => {\n\treturn '';\n}"
}
]
},
"Flow.Eval": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Grape",
"order": 110
},
"description": "Evaluates a Javascript function, the return value of the function becomes the activity result.",
"type": "leaf",
"options": [
{
"type": "Function",
"field": "Script",
"description": "The return value becomes the activity result.",
"defaultValue": "() => {\n return '';\n}"
}
]
},
"Flow.Eval-Async": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Grape",
"order": 111
},
"description": "Evaluates a Javascript function, the value passed to 'done' becomes the activity result.",
"type": "leaf",
"options": [
{
"type": "Function",
"field": "exec",
"description": "Function to be executed. The value passed to 'done' becomes the activity result.",
"defaultValue": "(done) => {\n done('');\n}"
},
{
"type": "Function",
"field": "onStop",
"description": "Function to be executed when/if the activity receives a stop request.",
"defaultValue": "() => { }"
}
]
},
"Flow.Wait": {
"paletteInfo": {
"uses": [
"xxx-disabled-flow"
],
"color": "Grape",
"order": 112
},
"description": "Pauses for the specified number of milliseconds.",
"type": "leaf",
"options": [
{
"type": "string",
"field": "ms_to_pause",
"description": "The number of milliseconds to pause.",
"defaultValue": "0"
}
]
},
"Mim": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Tangerine",
"order": 113
},
"description": "A Multimodal Interaction Module, for all your speaking needs.",
"type": "leaf",
"options": [
{
"type": "Function",
"field": "getMimPath",
"description": "Return path to mim file (from project root)",
"defaultValue": "() => {\n\treturn 'mims/myMim.mim';\n}"
},
{
"type": "Function",
"field": "getPromptData",
"description": "Get Prompt Data - Return variables for Mim prompt conditions and text replacement",
"defaultValue": "() => {\n\treturn {};\n}"
},
{
"type": "Function",
"field": "onStatus",
"description": "MIM Status - provides incremental listen results.",
"defaultValue": "(status) => {\n\tlet mimState = status.state;\n\tlet asrResults = status.asrResults;\n\tlet speakerIds = status.speakerIds;\n}"
},
{
"type": "Function",
"field": "onSuccess",
"description": "MIM Success - provides data on the end result of the MIM - a successful response.",
"defaultValue": "(results) => {\n\tlet mimState = results.state;\n\tlet asrResults = results.asrResults;\n\tlet speakerIds = results.speakerIds;\n\tlet transition = results.firstGrammarTag;\n\treturn transition;\n}"
},
{
"type": "Function",
"field": "onFailure",
"description": "MIM Failure - provides data on the failure of the MIM - an overall failure due to no input or no matching response.",
"defaultValue": "(results) => {\n\tlet mimState = results.state;\n\tlet asrResults = results.asrResults;\n\tlet speakerIds = results.speakerIds;\n\tlet exception = results.exception;\n\treturn exception;\n}"
}
]
},
"Mim.Announcement": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Tennis",
"order": 114
},
"description": "A Multimodal Interaction Module that plays announcements.",
"type": "leaf",
"options": [
{
"type": "mim",
"field": "mimPath",
"description": "path to mim file (from project root)",
"defaultValue": ""
},
{
"type": "Function",
"field": "getPromptData",
"description": "Get Prompt Data - Return variables for Mim prompt conditions and text replacement",
"defaultValue": "() => {\n\treturn {};\n}"
}
]
},
"Mim.Optional-Response": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Twilight",
"order": 115
},
"description": "A Multimodal Interaction Module that plays an Announcement and waits briefly for a response.",
"type": "leaf",
"options": [
{
"type": "mim",
"field": "mimPath",
"description": "path to mim file (from project root)",
"defaultValue": ""
},
{
"type": "Function",
"field": "getPromptData",
"description": "Get Prompt Data - Return variables for Mim prompt conditions and text replacement",
"defaultValue": "() => {\n\treturn {};\n}"
},
{
"type": "Function",
"field": "onStatus",
"description": "MIM Status - provides incremental listen results.",
"defaultValue": "(status) => {\n\tlet mimState = status.state;\n\tlet asrResults = status.asrResults;\n\tlet speakerIds = status.speakerIds;\n}"
},
{
"type": "Function",
"field": "onSuccess",
"description": "MIM Success - provides data on the end result of the MIM - a successful response.",
"defaultValue": "(results) => {\n\tlet mimState = results.state;\n\tlet asrResults = results.asrResults;\n\tlet speakerIds = results.speakerIds;\n\tlet transition = results.firstGrammarTag;\n\treturn transition;\n}"
}
]
},
"Mim.Question": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Candy",
"order": 116
},
"description": "A Multimodal Interaction Module that plays an Announcement and waits indefinitely for a response.",
"type": "leaf",
"options": [
{
"type": "mim",
"field": "mimPath",
"description": "path to mim file (from project root)",
"defaultValue": ""
},
{
"type": "Function",
"field": "getPromptData",
"description": "Get Prompt Data - Return variables for Mim prompt conditions and text replacement",
"defaultValue": "() => {\n\treturn {};\n}"
},
{
"type": "Function",
"field": "onStatus",
"description": "MIM Status - provides incremental listen results.",
"defaultValue": "(status) => {\n\tlet mimState = status.state;\n\tlet asrResults = status.asrResults;\n\tlet speakerIds = status.speakerIds;\n}"
},
{
"type": "Function",
"field": "onSuccess",
"description": "MIM Success - provides data on the end result of the MIM - a successful response.",
"defaultValue": "(results) => {\n\tlet mimState = results.state;\n\tlet asrResults = results.asrResults;\n\tlet speakerIds = results.speakerIds;\n\tlet transition = results.firstGrammarTag;\n\treturn transition;\n}"
},
{
"type": "Function",
"field": "onFailure",
"description": "MIM Failure - provides data on the failure of the MIM - an overall failure due to no input or no matching response.",
"defaultValue": "(results) => {\n\tlet mimState = results.state;\n\tlet asrResults = results.asrResults;\n\tlet speakerIds = results.speakerIds;\n\tlet exception = results.exception;\n\treturn exception;\n}"
}
]
},
"Menu": {
"paletteInfo": {
"uses": [
"flow"
],
"color": "Candy",
"order": 117
},
"description": "A self contained single stage menu.",
"type": "leaf",
"options": [
{
"type": "Function",
"field": "getConfig",
"description": "Provide the menu config data.",
"defaultValue": "(loadCallback) => {\n\tloadCallback({});\n}"
},
{
"type": "Function",
"field": "onMenuClosed",
"description": "Called when the menu is closed by the user or a timeout.",
"defaultValue": "(wasTimeout, menu, overrideMenuTransition, exception) => {\n\t//exception will be ~InteractionError.MenuTimeout or ~InteractionError.MenuClosed\n\treturn exception;\n}"
},
{
"type": "Function",
"field": "onItemChosen",
"description": "Called when a user utterance matches the menu rule, or an item is selected",
"defaultValue": "(menuResult, menu, overrideMenuTransition) => {\n\treturn undefined;//return a transition here\n}"
},
{
"type": "Function",
"field": "onPositionalSelect",
"description": "Called when a user tries to choose an item with positional selection - 'open the second one', etc",
"defaultValue": "(commandAsr, intendedIndex, menu) => {\n\t//Return an index to use, NaN to not select anything, or undefined to do the normal behavior (selecting intendedIndex)\n}"
}
]
},
"meta": {
"version": 1
}
}