AnsweredAssumed Answered

HashMap problem in Activiti

Question asked by zlatan316 on Feb 11, 2014
Latest reply on Feb 11, 2014 by zlatan316
Hi,

I have the below code which gives me a HashMap and sets it as the variable.

   @Override
   public void execute(DelegateExecution execution) throws Exception {      
      Reader readerObj = new Reader();
      readerObj.run(); // Creates values in a HashMap within Reader.
      
      MainClass mc = new MainClass();
      mc.map = readerObj.getMap(); // Passes the created HashMap into a new global one.
      mc.decision = true;
      execution.setVariable("decisionVar", mc.decision);
      execution.setVariable("mapVar", mc.map); // Sets the HashMap Variable      
   }


I then want to ideally get something from the HashMap. I tried using ${mapVar.IsEmpty()} on a flow to return a true condition, but it gives me the message "Unknown method used in expression ${mapVar.IsEmpty()}. IsEmpty() is a method that belongs to the HashMap<> collection.

Can someone please explain where I am going wrong?

Outcomes