Note that there are some explanatory texts on larger screens.

plurals
  1. POIzPack ProcessPanel using executeclass not giving desired onSuccess/onFail behavior
    text
    copied!<p>I'm following the IzPack documentation use case <a href="http://docs.codehaus.org/display/IZPACK/Executing+a+Java+Class+with+ProcessPanel" rel="nofollow">Executing a Java Class with ProcessPanel</a> and am running into some difficulty achieving the desired behavior from the onSuccess and onFail elements and could use some clarification from someone more familar with IzPack 4.3.5.</p> <p>I've defined a java condition, process.panel.condition, that I want to use to control the availability of the next and previous buttons on the process panel after the run method in my Java class has been invoked. This run method assigns true or false to the static field, ConditionBoolean, underlying the process.panel.condition condition.</p> <p>My expectation is that when process.panel.condition is true, I'd like the previous button to become disabled and the next button enabled. When process.panel.condition is false, I'd like the complement to occur- previous becomes enabled and next becomes disabled.</p> <p>Instead what appears to be happening is that the previous button assignment is working but the next button is always made enabled. </p> <p>Can anyone point out why I'm seeing this behavior and how I should go about changing my approach to achieve my desired behavior?</p> <p>Below are the xml definitions and associated Java class referenced in the executeclass element.</p> <pre><code>&lt;conditions&gt; &lt;condition type="java" id="process.panel.condition"&gt; &lt;java&gt; &lt;class&gt;MyClass&lt;/class&gt; &lt;field&gt;ConditionBoolean&lt;/field&gt; &lt;/java&gt; &lt;returnvalue type="boolean"&gt;True&lt;/returnvalue&gt; &lt;/condition&gt; &lt;/conditions&gt; </code></pre> <p>Process spec xml as follows:</p> <pre><code>&lt;processing&gt; &lt;job name="Step 1"&gt; &lt;executeclass name="MyClass"&gt; &lt;arg&gt;...&lt;/arg&gt; &lt;/executeclass&gt; &lt;/job&gt; &lt;onFail previous="false" next="false" /&gt; &lt;onSuccess condition="!process.panel.condition" previous="true" next="false" /&gt; &lt;onSuccess condition="process.panel.condition" previous="false" next="true" /&gt; &lt;/processing&gt; </code></pre> <p>And the MyClass implementation:</p> <pre><code>import com.izforge.izpack.util.AbstractUIProcessHandler; public class MyClasss { public static boolean ConditionBoolean; public void run(AbstractUIProcessHandler handler, String[] args) { ConditionBoolean = false; try { ... ConditionBoolean = true; } catch (Throwable e) { handler.logOutput(e.getMessage(), false); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload