AnsweredAssumed Answered

Manning Book Ch5 example - creditCheckOk var not created

Question asked by jemmerling on Jul 1, 2015
Latest reply on Jul 1, 2015 by trademak
So in the Loan Application example, there are 4 variables declared at the start then the first task is a script task that does the following:


      out:println "Checking credit for " + name;
      creditCheckOk = false;
      if((income / 2) > loanAmount){
         creditCheckOk = true;
      }
      out:println "Checked credit for " + name + " outcome is " + creditCheckOk;

Then there is a Java Service task that tries to look at the value of creditCheckOk. When I ran the example, the Java Service Task failed because it couldn't access it. I added creditCheckOk to the form and now it runs successfully, however it also appears as a checkbox in the start form which I don't think is the intended behavior.

It would seem that the introduction of an undeclared variable in a Script Task is supposed to cause it to be created in the process context, however this didn't seem to happen.

As the example is based on a several-years-old version of Activiti, I am wondering if the behavior has changed. If so, what should be done to correct this?

Thanks!

Outcomes