1 Reply Latest reply on Aug 4, 2015 2:51 PM by Francisco Gonzalez Alvarez

    GenericCommand..is not an accepted command!

    Francisco Gonzalez Alvarez Newbie

      I'm trying to run a GenericCommand from a remote session via JMS and get the following error:

       

      Servlet.service () for servlet javax.ws.rs.core.Application Threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.UnsupportedOperationException: cl.bee.mwi.jbpm.WorkflowJbpmImpl $ 1 is not an accepted command .


      The code:

       

        RemoteRuntimeEngine rte = new RemoteJmsRuntimeEngineFactory(config).newRuntimeEngine();
        rte.getKieSession().execute(new GenericCommand<Map<String, Object>>()
        {
            @SuppressWarnings("unchecked")
            public Map<String, Object> execute(Context context)
            {
              try
              {
                  KieSession ksession = ((KnowledgeCommandContext) context).getKieSession();
                  org.jbpm.process.instance.ProcessInstance processInstance =
                        g.jbpm.process.instance.ProcessInstance) ksession.getProcessInstance((getTaskObjectById(taskId).getTaskData().getProcessInstanceId()));
                  VariableScopeInstance variableScope = (VariableScopeInstance) processInstance.getContextInstance(VariableScope.VARIABLE_SCOPE);
                  variableScope.getVariables().putAll((HashMap<String, Object>) parameters.get("variables"));
              }
              catch (Exception e)
              {
                  e.printStackTrace();
              }
              return new HashMap<String, Object>();
           }
        });
      

       

       

      Someone can help me, from a remote session via JTA works wonders.

      Regards