Drools doesn't return any result to my c# desktop application

I am using kie .Net Adaptor but i don't get the result for my rules in my c# desktop application.

I created a class called Bilan which contains 4 attributes ( organe,maladie,localisation,medicament). In my WinForm i have a button which allows me to get the name of the medicament when i push it. enter image description here When i hit Start, the button's action sends the attributes (organe,maladie,localisation) to the drools engine which is supposed to return the medicaments name.

The c# application and the drools engine are connected because i get a resultstatus=200 but the responsebody is null and i don't figure out why ..

Can anyone help me ?

Here's my button's code :

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }


    private async void Start_Click(object sender, EventArgs e)
    {

        Bilan b = new Bilan { maladie = maladieText.Text, localisation = localisationText.Text, organe = organeText.Text, medicament = null };

        KieExecuter k = new KieExecuter
        {
            HostUrl = "http://localhost:8080/",
            AuthUserName = "kie-server",
            AuthPassword = "kie1234",
            LookUp = "defaultKieSession"
        };

        k.Insert(b, "pharmacie.projetpfe.Bilan");


        k.FireAllRules();

        //var result = await k.ExecuteAsync<Bilan>("ContainerTest");


        //var bodyResponse = result.ResponseBody;
        //MessageBox.Show("" + result.FriendlyResponse);

        var response = await k.ExecuteAsync<Bilan>("ContainerTest");

        medicament.Text = response.SmartSingleResponse.ToString();
        //result.SmartSingleResponse.medicament;
        //medicament.Text = b.organe;
        }

}

}

c#.netdroolsrule-enginekie

Answers

comments powered by Disqus