Load Flow For Edit

Load the specified workflow to a temporary workflow to get the workflow information.

Prerequisites

The user must belong to the OU which the target workflow belongs to.

Request Format

GET https://{apigw-address}/dataflow-batch-service/v2.0/flows?action=loadForEdit&flowId={}&userId={}&orgId={}

Request Parameters (URI)

Name Location (Path/Query) Required or Not Data Type Description
flowId Query true Integer Workflow ID
userId Query true String User ID. How to get userId>>
orgId Query true String Organization ID which the user belongs to. How to get orgId>>

Response Parameters

Name Data Type Description
data Flow Struct Detailed information of the workflow. See Flow Struct

Error Code

See Common Error Codes.

Sample

Request Sample

url: https://{apigw-address}/dataflow-batch-service/v2.0/flows?action=loadForEdit&flowId={}&userId={}&orgId={}

method: GET

Return Sample

{
  "status": 0,
  "msg": " Success",
  "data": {
    "virtual": false,
    "freq": "0 0 0 * * ? *",
    "type": 1,
    "cycle": "D",
    "alertMode": 3,
    "appId": "",
    "hasEditPri": true,
    "startTime": "2019-07-23",
    "locked": false,
    "flowId": 2515,
    "owner": ";xxxx;",
    "creator": "xxxxx",
    "updateUser": "xxxxxx",
    "active": 0,
    "updateTime": "2019-08-08 05:51:43.0",
    "flowName": "fpostm",
    "graph": "{"creator":"xxxxxx ","freq":"0 0 0 * * ? *","alert_mode":3,"active":0,"owners":";xxxx;","type":1,"cycle":"D","start_time":"2019-07-23","visitors":";xxxx;","do_as":"data_oxxxxxxxxx","flows":[{"is_virtual":false,"flow_id":"2788","x":0.0186,"flow_name":"jin","y":0.0016999999046325683,"node_id":"f_2788"},{"is_virtual":true,"flow_id":"2819","x":8.0E-4,"flow_name":"104891(tass)","y":0.022100001525878907,"node_id":"f_2819"}],"name":"fpostm","relations":[{"cycle_gap":"D0","source":"t_104575","rerun":true,"target":"t_104590"},{"cycle_gap":"D0","source":"f_2788","rerun":false,"target":"t_104575"},{"cycle_gap":"D0","source":"f_2819","rerun":false,"target":"t_104590"}],"parameters":"[]","queue":"","tasks":[{"task_name":"tass","x":0.0132,"y":0.008100000381469727,"task_id":"104575","node_id":"t_104575"},{"task_name":"gg","x":0.0084,"y":0.014199999237060546,"task_id":"104590","node_id":"t_104590"},{"task_name":"dff","x":0.0352,"y":0.008300002288818359,"task_id":"104901","node_id":"t_104901"}],"desc":"e"}",
    "isUserLocked": false,
    "entry": 1,
    "doAs": "data_oxxxxx",
    "createTime": "2019-07-26 05:41:58.0",
    "alertTo": "",
    "syncType": 1,
    "visitor": ";xxxxx;",
    "parameters": "[]",
    "queue": "",
    "hasReadPri": true,
    "desc": "e"
  }
}

Java SDK Sample

import com.alibaba.fastjson.JSONObject;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;

public class Request extends PoseidonRequest {
    public void setQueryParam(String key, Object value){
        QueryParams().put(key, value);
    }
    public void setHeaderParam(String key, String value){
        headerParams().put(key, value);
    }
    public void setBodyParam(Map<String, Object> bodyPara){
        bodyParams().putAll(bodyPara);
    }
    public void setMethod(String method) {
        this.method = method;
    }
    private String method;
    public String baseUri() {
        return "";
    }
    public String method() {
        return method;
    }
}

ublic void synchronizedFlowTest(){
        //1. Select Application Registration from the left navigation bar of EnOS Console.
        //2. Open the App Detail page to get the AccessKey and SecretKey of the application.
        String accessKey = "**************";
        String secretKey = "**************";

        //Create a request and save the required parameters in the map of the Query.
        Request request = new Request();
        request.setQueryParam("flowId",2791);
        request.setQueryParam("userId","your_userId");
        request.setQueryParam("orgId","your_orgId");
        request.setMethod("GET");

        try {
            JSONObject response = Poseidon.config(PConfig.init().appKey(accessKey).appSecret(secretKey).debug())
                    .url("https://{apigw-address}/dataflow-batch-service/v2.0/flows?action=loadForEdit")
                    .getResponse(request, JSONObject.class);

            System.out.println(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }