All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.workflow.flow.definition.deploy.ParseInputStreamFlow Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
package cn.schoolwow.workflow.flow.definition.deploy;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.IOUtils;

import java.io.InputStream;

public class ParseInputStreamFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        InputStream inputStream = (InputStream) flowContext.checkData("inputStream");

        String content = IOUtils.toString(inputStream, "UTF-8");
        JSONObject workflow = JSONObject.parseObject(content);
        flowContext.putTemporaryData("workflow", workflow);
    }

    @Override
    public String name() {
        return "部署工作流-解析输入流";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy