根据流程应用编码获取流程定义

  • SDK调用
WorkflowEngineClient client = new WorkflowEngineClient();
client.setUrl(URL+"/engine");  //引擎客户端
String appCode = "test001";
ResultEntity<Definition> result = client.getDefinitionByAppCode(appCode);
String resultStr = JSONObject.fromObject(result,getJsonConfig()).toString();
System.out.println(resultStr);
  • CURL 调用
curl -X GET "URL/engine/getDefinitionByAppCode?appCode=test001" -H "accept: application/json"
  • 响应示例
{
  "businessObject": {
    "activitys": [
      {
        "activityName": "传阅步骤",
        "activityText": "传阅步骤",
        "activityType": "pass",
        "autoRun": false,
        "lines": [],
        "responseType": "one"
      },
      {
        "activityName": "结束步骤",
        "activityText": "结束步骤",
        "activityType": "end",
        "autoRun": true,
        "lines": [],
        "responseType": "one"
      },
      {
        "activityName": "审批步骤",
        "activityText": "审批步骤",
        "activityType": "approval",
        "autoRun": false,
        "lines": [
          {
            "enablePushBack": false,
            "lineName": "审批步骤->审批步骤1",
            "lineText": "",
            "orderby": 0,
            "remark": "",
            "sourceActivity": {
              "activityName": "审批步骤",
              "activityText": "审批步骤",
              "activityType": "approval",
              "autoRun": false,
              "lines": [],
              "responseType": "one"
            },
            "targetActivity": {
              "activityName": "审批步骤1",
              "activityText": "审批步骤1",
              "activityType": "approval",
              "autoRun": false,
              "lines": [],
              "responseType": "one"
            }
          }
        ],
        "responseType": "one"
      },
      {
        "activityName": "审批步骤1",
        "activityText": "审批步骤1",
        "activityType": "approval",
        "autoRun": false,
        "lines": [
          {
            "enablePushBack": false,
            "lineName": "审批步骤1->结束步骤",
            "lineText": "",
            "orderby": 0,
            "remark": "",
            "sourceActivity": {
              "activityName": "审批步骤1",
              "activityText": "审批步骤1",
              "activityType": "approval",
              "autoRun": false,
              "lines": [],
              "responseType": "one"
            },
            "targetActivity": {
              "activityName": "结束步骤",
              "activityText": "结束步骤",
              "activityType": "end",
              "autoRun": true,
              "lines": [],
              "responseType": "one"
            }
          },
          {
            "enablePushBack": false,
            "lineName": "审批步骤1->传阅步骤",
            "lineText": "",
            "orderby": 0,
            "remark": "",
            "sourceActivity": {
              "activityName": "审批步骤1",
              "activityText": "审批步骤1",
              "activityType": "approval",
              "autoRun": false,
              "lines": [],
              "responseType": "one"
            },
            "targetActivity": {
              "activityName": "传阅步骤",
              "activityText": "传阅步骤",
              "activityType": "pass",
              "autoRun": false,
              "lines": [],
              "responseType": "one"
            }
          }
        ],
        "responseType": "one"
      },
      {
        "activityName": "开始步骤",
        "activityText": "开始步骤",
        "activityType": "start",
        "autoRun": false,
        "lines": [
          {
            "enablePushBack": false,
            "lineName": "开始步骤->审批步骤",
            "lineText": "",
            "orderby": 0,
            "remark": "",
            "sourceActivity": {
              "activityName": "开始步骤",
              "activityText": "开始步骤",
              "activityType": "start",
              "autoRun": false,
              "lines": [],
              "responseType": "one"
            },
            "targetActivity": {
              "activityName": "审批步骤",
              "activityText": "审批步骤",
              "activityType": "approval",
              "autoRun": false,
              "lines": [],
              "responseType": "one"
            }
          }
        ],
        "responseType": "one"
      }
    ],
    "appCode": "0828",
    "appName": "传阅测试",
    "appVersionId": "8a92478d-45ce-45aa-aba4-de4a32778f65",
    "defVersionId": "2f9c24b0-55da-4d35-870b-48f1741d57b9",
    "definitionName": "test",
    "free": false,
    "lines": [],
    "startActivity": {
      "activityName": "开始步骤",
      "activityText": "开始步骤",
      "activityType": "start",
      "autoRun": false,
      "lines": [
        {
          "enablePushBack": false,
          "lineName": "开始步骤->审批步骤",
          "lineText": "",
          "orderby": 0,
          "remark": "",
          "sourceActivity": {
            "activityName": "开始步骤",
            "activityText": "开始步骤",
            "activityType": "start",
            "autoRun": false,
            "lines": [],
            "responseType": "one"
          },
          "targetActivity": {
            "activityName": "审批步骤",
            "activityText": "审批步骤",
            "activityType": "approval",
            "autoRun": false,
            "lines": [],
            "responseType": "one"
          }
        }
      ],
      "responseType": "one"
    }
  },
  "message": "成功",
  "statusCode": 200,
  "success": true
}