Pass object to DROOLS
<p>I am very new to DROOLS.
I am working with Activiti-Explorer and I need DROOLS for decision making. I have created an Instance object of the class and added the data fetched from the API.</p>

<pre><code>LoanApplicant loanApplicant = new LoanApplicant();
loanApplicant.setUserID(obj.getJSONObject("data").getJSONObject("ownership_details").getInt("user_id"));
loanApplicant.setApplicantName(obj.getJSONObject("data").getJSONObject("ownership_details").getString("name"));
</code></pre>

<p>Similarly I have set few more fields in to the class object and then I have set it in to Java delegate variable arg0 to Activiti memory</p>

<pre><code>arg0.setVariable("loanApplication", loanApplicant);
</code></pre>

<p>And Similarly, as DROOLS decisions outputs are further required, I have created an Output java file recording its decisions.</p>

<p>Output java file: RulesOutput.java: -</p>

<pre><code>private String testValue = null;
public String getTestValue(){
    return this.getTestValue();
}
public void setTestValue(String testValue){
    this.testValue = testValue;
}
</code></pre>

<p>Similarly to loanApplicant, I have set this class in to memory:</p>

<pre><code>arg0.setVariable("RulesOutput", new RulesOutput());
</code></pre>

<p>Now I am passing these fields from Process BPMN Diagram to Drools Task Work Step.</p>

<p><a href="https://i.stack.imgur.com/Y7wIR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y7wIR.png" alt="enter image description here"></a></p>

<p>This is my DROOLS .drl file:</p>

<pre><code>import com.LOS.*;
rule "FLS_1"
when
    $loanApplication : loanApplication(age &gt;= 20 &amp;&amp; age &lt; 60)
    $rulesOutput : RulesOutput (isApproved == false || isApproved == true)
then
    rulesOutput.setAgeScore(100);
</code></pre>

<p>end</p>

<p>Now the <strong>Problem</strong>: 
I am getting <code>Unable to resolve ObjectType</code> even though I have passed all the required objects to DROOLS.
Error Log:</p>

<pre><code>06:39:47,288 [http-bio-8480-exec-15] INFO  org.activiti.engine.impl.bpmn.deployer.BpmnDeployer  - Processing resource RuleSet_1.drl
06:39:47,288 [http-bio-8480-exec-15] INFO  org.activiti.engine.impl.bpmn.deployer.BpmnDeployer  - Processing resource LOS_1.bpmn20.xml'
06:39:47,645 [http-bio-8480-exec-15] INFO  org.activiti.engine.impl.rules.RulesDeployer  - Processing resource RuleSet_1.drl
06:39:47,702 [http-bio-8480-exec-15] INFO  org.activiti.engine.impl.rules.RulesDeployer  - Processing resource LOS_1.bpmn20.xml
06:39:47,704 [http-bio-8480-exec-15] ERROR org.drools.compiler.builder.impl.KnowledgeBuilderImpl  - Unable to resolve ObjectType '$loanApplication' : [Rule name='FLS_1']
06:39:47,704 [http-bio-8480-exec-15] ERROR org.drools.compiler.builder.impl.KnowledgeBuilderImpl  - Unable to resolve ObjectType '$RulesOutput' : [Rule name='FLS_1']
06:39:47,704 [http-bio-8480-exec-15] ERROR org.drools.compiler.builder.impl.KnowledgeBuilderImpl  - Rule Compilation error : [Rule name='FLS_1']
[http-bio-8480-exec-15] INFO  org.activiti.engine.impl.bpmn.deployer.BpmnDeployer  - Processing resource RuleSet_1.drl
[http-bio-8480-exec-15] INFO  org.activiti.engine.impl.bpmn.deployer.BpmnDeployer  - Processing resource LOS_1.bpmn20.xml
[http-bio-8480-exec-15] INFO  org.activiti.engine.impl.rules.RulesDeployer  - Processing resource RuleSet_1.drl
[http-bio-8480-exec-15] INFO  org.activiti.engine.impl.rules.RulesDeployer  - Processing resource LOS_1.bpmn20.xml
[http-bio-8480-exec-15] ERROR org.drools.compiler.builder.impl.KnowledgeBuilderImpl  - Unable to resolve ObjectType '$loanApplication' : [Rule name='FLS_1']
[http-bio-8480-exec-15] ERROR org.drools.compiler.builder.impl.KnowledgeBuilderImpl  - Unable to resolve ObjectType '$RulesOutput' : [Rule name='FLS_1']
[http-bio-8480-exec-15] ERROR org.drools.compiler.builder.impl.KnowledgeBuilderImpl  - Rule Compilation error : [Rule name='FLS_1']
com/LOS/Rule_FLS_1842423443.java (7:323) : \RulesOutput cannot be resolved
</code></pre>

<p>I am stuck here for almost 2 days. Please any suggestions are welcome.</p>