JBoss Community

intermediateCatchEvent - conditionalEventDefinition using drools

created by William Timpany in jBPM - View the full discussion

Hi, hopefully someone can point me in the correct direction.  

 

I have a Fact that I want to check in an Intermediate Catch Event, I want to compare that Fact to a hardcoded "Yes/No" value and to a Process Instance variable that is in the ksession.

 

The process instance variable called "currentInstanceId" needs to be checked as part of the condition match.   I have hardcoded the "currentInstanceId" into the condition for the moment (and this works for testing). But I need to replace the hard coded "35036-1" is with a comparison to the id in the current process scope.

 

Any help would be appreciated.

 

FYI: the logic that I am trying to implement is: process goes along until a point is reached, where the process should wait until an Asset does not have any Infrastructure associated.  The process should wait until a matching Fact is inserted into working memory.  e.g. matching InstanceInfrastructureFact() is inserted with values matching the wait condition.

 

Java Excerpt

 

InstanceInfrastructureFact instanceInfrastructureFact = new InstanceInfrastructureFact();
instanceInfrastructureFact.setExists("No");
instanceInfrastructureFact.setInstanceId("35036-1");
ksession.insert(instanceInfrastructureFact); 

 

 

 

BPMN Excerpt

 

    <intermediateCatchEvent id="_5" name="Wait Until - Has Production Infrastructure is false" >
      <conditionalEventDefinition>
        <condition xsi:type="tFormalExpression" language="http://www.jboss.org/drools/rule">InstanceInfrastructureFact(exists == "No", instanceId == "35036-1")</condition>
      </conditionalEventDefinition>
    </intermediateCatchEvent>

Reply to this message by going to Community

Start a new discussion in jBPM at Community