使用params完成Jbpm任务 - Map为空

时间:2014-10-16 11:16:42

标签: java rest jbpm complete

我尝试使用以下代码完成jbpm中的任务:

private static RemoteRestRuntimeEngineFactory restSessionFactory = null;
    private static RuntimeEngine engine = null;
    private static KieSession ksession = null;
    private static TaskService task = null; 

    public static void main(String[] args) {
        try {
            restSessionFactory = RemoteRestRuntimeEngineFactory.newRestBuilder()
                    .addUrl(new URL("http://localhost:8080/jbpm-console"))
                    .addDeploymentId("jbpm:formularios:1.2")
                    .addUserName("admin")
                    .addPassword("admin").buildFactory();
        } catch (InsufficientInfoToBuildException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

        engine = restSessionFactory.newRuntimeEngine();

        ksession = engine.getKieSession();
        task = engine.getTaskService();

        Map<String,Object> map = new HashMap<String,Object>();
        map.put("name", "mary");
        map.put("age", "23");
        task.complete(271, "admin", map);
    }

我只有这种依赖:

<dependency>
    <groupId>org.kie.remote</groupId>
    <artifactId>kie-remote-client</artifactId>
    <version>6.2.0.Beta3</version>
</dependency>

完成没有问题,但参数是空的;

然后我尝试使用&#34; PostMan&#34; (Chrome插件)执行以下POST:

localhost:8080/jbpm-console/rest/task/249/complete?map_name=mary&map_idade=23

并且任务完成没有问题,但有参数。

如果我开始新流程:

localhost:8080/jbpm-console/rest/runtime/jbpm:formularios:1.0/process/formularios.isluis/start?map_nome=mary&map_idade=23

该过程以正确的参数开始。

我正在使用Jbpm-console 6.1

我错过了什么吗?

1 个答案:

答案 0 :(得分:1)