华为云Astro轻应用-启动BPM:脚本启动

时间:2025-02-12 14:58:41

脚本启动

在脚本代码中,导入BPM的脚本库,通过下面脚本代码方式启动。
import * as bp from "bp";//......(其他代码)const client = bp.newInstanceClient();  client.start(BPM名称, BPM版本号, BPM中定义的变量); 

脚本样例如下:

import * as bp from 'bp';let client = bp.newInstanceClient();let res = client.start("test", "1.0.1", {  "foo": 1,  "bar": 3});

输出样例如下:

{    "interviewId": "002N000000FdtN6xwgjI",    "screen": {        "allowBack": false,        "allowFinish": true,        "allowNext": true,        "allowPause": false,        "helpText": "",        "label": "input phone number",        "name": "inputphonenumber",        "pausedText": "",        "screenFields": [            {                "dataType": "text",                "defaultValue": "135xxxxxxxx",                "fieldType": "InputField",                "helpText": "",                "isRequired": false,                "label": "phone number",                "name": "phoneNumber"            }        ]    }
support.huaweicloud.com/usermanual-astrozero/astrozero_05_0072.html
提示

您即将访问非华为云网站,请注意账号财产安全