Get My Flow

Search workflows that meet the search criteria.

Prerequisite

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

Request Format

GET https://{apigw-address}/batch-processing-service/v2.1/flows

Request Parameters (URI)

Name Location (Path/Query) Mandatory/Optional Data Type Description
userId Query Mandatory String The user ID. How to get userId>>
orgId Query Mandatory String The organization ID which the user belongs to. How to get orgId>>
expression Query Optional String The search criteria, supporting fuzzy matching query for the flowId and flowName parameters (if not specified, all workflows related to the user will be returned).
action Query Mandatory String Fixed value: getMyFlow

Response Parameters

Name Data Type Description
data Array of FlowSimpInfo Structs The list of searched workflows, with each element representing a FlowSimpleInfo Struct, which contains the basic information of a workflow.

FlowSimpleInfo Struct

Sample

{
    "flowId": "2526",
    "editable": true,
    "flowName": "testIns",
    "cycle": "mi"
}

Parameters

Name Data Type Description
flowId String The workflow ID.
editable Boolean
  • true = the workflow is editable
  • false = the workflow is not editable
flowName String The workflow name.
cycle String

The scheduling cycle.

  • M: Month
  • W: Week
  • D: Day
  • H: Hour
  • mi: Minute

Error Code

See Common Error Codes.

Samples

Request Sample

url: https://{apigw-address}/batch-processing-service/v2.1/flows?action=getMyFlow&expression={}&userId={}&orgId={}
method: GET

Return Sample

{
    "code": 0,
    "msg": "OK",
    "data": [
        {
            "flowId": "3318",
            "editable": true,
            "flowName": "reduce_entity",
            "cycle": "D"
        },
        {
            "flowId": "2809",
            "editable": true,
            "flowName": "map",
            "cycle": "D"
        },
        {
            "flowId": "3257",
            "editable": true,
            "flowName": "shell",
            "cycle": "D"
        },
        {
            "flowId": "2515",
            "editable": true,
            "flowName": "testWorkflow122",
            "cycle": "D"
        },
        {
            "flowId": "2980",
            "editable": true,
            "flowName": "8",
            "cycle": "D"
        },
        {
            "flowId": "2979",
            "editable": true,
            "flowName": "integrattt",
            "cycle": "D"
        }
    ]
}

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;
    }
}

public void myFlowsTest(){
        //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 = "yourAppAccessKey";
        String secretKey = "yourAppSecretKey";

        //Create a request and save the required parameters in the map of the Query.
        Request request = new Request();
        request.setQueryParam("expression","2");
        request.setQueryParam("userId","yourUserId");
        request.setQueryParam("orgId","yourOrgId");
        request.setMethod("GET");

        try {
            JSONObject response = Poseidon.config(PConfig.init().appKey(accessKey).appSecret(secretKey).debug())
                    .url("https://{apigw-address}/batch-processing-service/v2.1/flows?action=getMyFlow")
                    .getResponse(request, JSONObject.class);
            System.out.println(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }