JBoss Community

Re: How to use a POJO as Gateway condition

created by Gary Struthers in jBPM - View the full discussion

The example projects only show drools, xPath, and cron as language attribute in conditionExpressions. I tried the above and it didn't work. IIRC it failed in KnowledgeBuilder.

 

Then I tried

<conditionExpression xsi:type="tFormalExpression" language="http://www.jboss.org/drools/rule">PIvars(applicationReady == true);</conditionExpression>

The Gateway ignored it.

 

This ugly one does work but if there is a clean way that works I'd like to know.

<conditionExpression xsi:type="tFormalExpression">

      org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();

      edu.berkeley.ouae.workflow.dto.FreshmanReadPIvars vars = process.getVariable("vars");

      return vars.isApplicationReady() == false;</conditionExpression>

Reply to this message by going to Community

Start a new discussion in jBPM at Community