Setting global variable over BPM Remote API ends in error

Solution Verified - Updated -

Issue

Setting a global variable over the remote api:

    RemoteRestRuntimeEngineFactory restSessionFactory
         = new RemoteRestRuntimeEngineFactory(deploymentId, deploymentUrl, user, password);
    RuntimeEngine engine = restSessionFactory.newRuntimeEngine();
    KieSession ksession = engine.getKieSession();
    ProcessInstance processInstance = ksession.startProcess("sampleProcess");
    String res = (String)ksession.getGlobal("response");              
    System.out.println("RES: "+res);

Fails with:

Exception in thread "main" org.jboss.resteasy.client.ClientResponseFailure: Unable to find a MessageBodyReader of content-type application/xml and type null
    at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:523)
    at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:514)
    at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:415)
    at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:377)
    at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:350)
    at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:344)
    at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:410)
    at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:124)
    at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:232)
    at com.test.TestRemoteBPMClient.test(TestRemoteBPMClient.java:36)
    at com.test.TestRemoteBPMClient.main(TestRemoteBPMClient.java:18)

How to correctly implement this requirement?

Environment

  • Red Hat JBoss BPM Suite
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.