猿问

无法在 KIE 工作台 (jBPM) 中添加 Java 导入

我是 jBPM 的新手。我正在使用 jBPM KIE 工作台。正如您在第二张图片中看到的,我在 KIE 外部数据对象部分添加了必要的导入。为什么我会收到错误?我需要对进口商品做其他事情吗?


我收到一个抛出的错误:


[KBase: defaultKieBase]: Process Compilation error URL cannot be resolved to a type

URL cannot be resolved to a type

HttpURLConnection cannot be resolved to a type

HttpURLConnection cannot be resolved to a type

BufferedReader cannot be resolved to a type

BufferedReader cannot be resolved to a type

InputStreamReader cannot be resolved to a type

Java代码:


    try {

        URL url = new URL("http://localhost:8080/users");

        HttpURLConnection con = (HttpURLConnection) url.openConnection();

        con.setRequestMethod("GET");

        con.setRequestProperty("Content-Type", "application/json");


        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));

        String inputLine;

        StringBuffer content = new StringBuffer();


        while ((inputLine = in.readLine()) != null) {

            content.append(inputLine);

        }


        in.close();


        System.out.println(content);

    }


    catch(Exception e){

        throw new RuntimeException(e);

    }

http://img3.mukewang.com/63abfa870001397718170697.jpg

慕尼黑8549860
浏览 101回答 1
1回答

holdtom

内置的 REST 工作项应该是一个很好的起点。创建一个项目并添加一个 BusinessProcess:然后添加内置的 Rest Workitem然后打开 Rest Workitem Properties 并选择数据分配并输入 Rest Call 的值
随时随地看视频慕课网APP

相关分类

Java
我要回答