Below is my code. I want to retrieve the records after rule execution. Also the yellow highlighted values will dynamically change(Based on user inputs). I'm feeling hard to find a solution for this since I'm completely new to this. Please guide me on this.
public List<SecurityReport> ExecuteRules()
{
var securityReport = new List<SecurityReport>();
//Load rules
var repository = new RuleRepository();
if (_RuleId == (int)RuleInfo.CartWithOver50partsPendingOver48Hrs)
{
repository.Load(x => x.From(typeof(PendingShoppingCartTemp2).Assembly));
}
//Compile rules
var factory = repository.Compile();
//Create a working session
var session = factory.CreateSession();
//Load domain model
//Insert facts into rules engine's memory
session.InsertAll(_PendingOrderList);
//Start match/resolve/act cycle
session.Fire();
securityReport = session.Query<SecurityReport>().ToList();
return securityReport;
}
public override void Define()
{
List<ShoppingCartItem> currentCartItem = null;
When()
.Query(() => currentCartItem, p => p
.Match<ShoppingCartItem>(
c => (c.Status != null && (c.Status.ToUpper() == "OPEN" || c.Status.ToUpper() == "P" || c.Status.ToUpper() == "NULL"))
&& c.NumberOfUniqueParts > 25
&& c.CreatedUTCDate.DateDiff("hour", DateTime.UtcNow) >= 24)
.Collect()
.Where(c => c.Any()));
Then()
//.Do(ctx => SendEmailNotification(currentCartItem));
}