How do I know which IBM iLog.NET rules are getting hit during execution? - ilog

I'm using the IBM iLog.NET business rule engine (v7r1 or thereabouts) and I can't find why my rules are failing. How do I trace down what's failing, where, and why?
I've got a local object model that's calling out to my rules hosted in an IBM rules service on IIS 6.0.
About half of my rules are configured to modify one of the input objects with a new status code. The code isn't getting set when I think it should but I cannot tell conclusively which rules are getting hit.

I found that the IBM iLog.NET documentation had the answer buried deep, deep within. Persistent Google searching revealed that I can set ILOG.Rules.ExecutionServer.Trace.EventFilterCategories on my ExecutionRequest object before I send it to the server.
ExecutionRequest request = new ExecutionRequest(rulePath);
request.TraceFilter.EventFilters
= ILOG.Rules.ExecutionServer.Trace.EventFilterCategories.All;
...
ExecutionResponse response = session.Execute(request);
ILOG.Rules.ExecutionServer.Trace.Trace trace = response.Trace;
Debug.WriteLine(trace.SerializedExecutionTrace);
The serialized trace contains all the inputs and outputs for the call as well as all rules that were triggered during execution and the rules that weren't hit at all.

Related

white listing solution against fortify erros does not remove the fortify errors

when i ran fority scanner it reported often misused authentication issue on the below line
hostName=java.net.InetAddress.getLocalHost().getHostName();
I had written a function which will validate this host name against the white list of host names as below.
private String validateHost(String hostName)
{
String[] PossibleHosts = {"host1","host2","host2","host4","host5",};
Integer myhostIndex = Arrays.asList(PossibleHosts).indexOf((hostName).toLowerCase());
if(myhostIndex>=0){
hostName = PossibleHosts[myhostIndex];
} else {
hostName = "";
}
return hostName;
}
which will be called by below line
hostName=validateHost(java.net.InetAddress.getLocalHost().getHostName());
But when i run the fority scan for the next time , it still shows issue on the same line even after i have done the validaiton. what can be done to remove the fortify error.
To answer you, let me explain how Fortify detects this issue, why it's included, then what to do about it.
How Fortify detects this issue: It's basically a super grep. It just finds anywhere you're using java.net.InetAddress.getLocalHost().getHostName() and complains. It is unaffected by data validation.
Why do this? Because this function is sometimes used for security purposes, and it should not be. For example, imagine a dev wanted to trust all messages from their own domain, they might use this to determine where a message came from. But then the security of their system relies on DNS, which is not secure. (See the Details tab for more info.)
What to do: First, make sure that what you're trying to do with java.net.InetAddress.getLocalHost().getHostName() is safe. Basically, that you're not trying to secure your system with this code. Then ignore the finding. At most companies I help, you would write a short explanation of why this code is OK, put it in the comment field of the Issue Summary tab, and mark the Analysis as "Not an Issue." At some places, you could also suppress it. If you're getting a ton of these, you can create a Filter that will knock out the whole category, but realize that you might also knock out some real issues that way.
Source of information: Consultant at Fortify Software 2008-2010, independent application security consultant since then.

Compare two fields with OGC filter in OL3 and GeoServer

I'm using Opeonlayers 3.18 + GeoServer. I can make a ogc filter for comparing a field and a value. How can i compare two fields?
Code below shows what i'm looking for:
var f = ol.format.ogc.filter.greaterThan('Field1', 100); // this works nicely
var f = ol.format.ogc.filter.greaterThan('Field1', 'Field2'); // this doesn't work
Equivalent working CQL filter is: 'Field1 > Field2'
Regards
This sort of filtering should work. I'd note that many databases may not have a way to perform that filter in an optimal way, and as such, there's a chance that the handling for such a filter is not correct.
The first thing to check out is if the GeoServer logs have any additional information. For most requests, there are log messages which will provide all the details (including the filter) for the request.
If OL3 is making a non-sense request, there should be some kind of parse error first. If the datastore is having trouble with the request, you might see an exception.
To help further, which version of GeoServer and which datastore are you using? Also, is there additional information in the logs?
Update: Based on the comment below, I checked out the Open Layers 3 source. If you look here, it looks like OL3 is treating the first argument as a properyName and the second as a literal. It is probably worth filling a bug/feature request on the project's GitHub page.

TFS API - Object not set to reference of an object Error

I'm using the TFS api to pull data on some projects into a localized database. Recently this stopped working. and gave us this error.
Object Not Set to Reference of an Object
AND
Null reference exception at the Domain level (this fails the moment it connects)
We are pulling down the hierarchy.
Domain - Collection - Project - Requirements... etc.
Debugging I find that I the code can see the domains but not grab them or anything under them. I am perplexed as to what might have caused this. Our dlls are all up to date with the version of TFS being used (Version 12). Thought it might be a credential issue, but this occurs with any credentials used. I've read that it could be a cache issue with the server side credentials somehow. But I do not have access to this.
I would post code, but I am unsure which part would be the most helpful as the connector method works... just fails when it connects so the problem appears to be elsewhere.
Thoughts?
UPDATE:
I have detected the line of code where we have a failure... but walking through it the code detects all TFS items. Domains, test cases, projects. Everything.
But will always return the Null Reference Exception. Keep in mind this has worked seemlessly for months.
Domain dbDomain = server.Domains.DefaultIfEmpty(null).FirstOrDefault(a => a.DomainId.Equals(domain.DomainId));
Okay so the stupid mistake was in the Lambda expression. It was returning null because it was trying to calculate before a value was assigned. Silly me.
Domain dbDomain = server.Domains.DefaultIfEmpty(null).FirstOrDefault(a => a.DomainId.Equals(domain.DomainId));
Should be:
Domain dbDomain = server.Domains.Where(a => a.DomainId.Equals(domain.DomainId))DefaultIfEmpty(null).FirstOrDefault();

How do I construct the cake when using Scalaxb to connect to a SOAP service?

I've read the documentation, but what I need to know is:
I'm not using a fictitious stock quote service (with an imaginary wsdl file). I'm using a different service with a different name.
Where, among the thousands and thousands of lines of code that have been generated, will I find the Scala trait(s) that I need to put together that correspond to this line in the documentation's example:
val service = (new stockquote.StockQuoteSoap12Bindings with scalaxb.SoapClients with scalaxb.DispatchHttpClients {}).service
Now, you might be thinking "Why not just search for Soap12Bindings in the generated code"? Good idea - but that turns up 0 results.
The example in the documentation is outdated, or too specific. (The documentation is also internally inconsistent and inconsistent with the actual filenames output with scalaxb.)
First, search for SoapBindings instead of Soap12Bindings to find the service-specific trait (the first trait).
Then, instead of scalaxb.SoapClients, use scalaxb.Soap11Clients.

Passing Parameters To report using url address

I'm developing some reports for Main Page in Dynamics Ax, however the problem i've got is connected with SSRS. Typical scenario i have report A and report B, i need to open report A when clicking on report B. Opening report itself is correct, but passing parameters is more tricky. After some research i got to the point when I want to run report A in browser using the adress
http://(server address)/Reports/Pages/Report.aspx?ItemPath=/Dynamics/Reports.VendorsOpenTransactionsCount.AutoDesign1&rs:Command=Render&VendOpenTrans_dataAreaID=dor&VendOpenTrans_p1=2011-07-21&VendOpenTrans_p2=2011-07-21
and then i get report displayed(main window) but non of the parameters are validated into proper textboxes, and changing the value of them doesn't have any impact.
can anyone here help me with that "challenge"
Actually, I believe the critical difference is whether you are passing parameters (via URL) to a report that is using database engine or the SSAS - the analytical engine as a data source.
If your data source is the analytical engine then your parameter should be given in the 'dimension format', rather than in the precise format, like &parmname=140, etc. Allow me to explain using specific example and using SSAS data source for this illustration (there is plenty of solutions available on the net for the database engine based solution, including Microsoft postings).
My server name is FRELASM.
So, I have SSAS data source called DealerSource (not visible here).
I have parameter defined in the parameter's section of the SSRS as: #DwDimDealerCorpDlrNbr
In SSAS I have the following dimension:
[Dw dim Dealer] that has attribute: [Corp Dlr Nbr] ==> giving: [Dw dim Dealer].[Corp Dlr nbr]
What I want is to show a report for a single dealer 'number' (but it is a text field, hence the leading zeros) equal to 00140. So, I am looking for Corporate dealer number=00140.
The parameter passing DOES NOT WORK if I use this [this would be find against database engine, but it does not work with SSAS).
What you need is this:
replace constant 00140 with [dimension].[attribute].[value]
do not use & character, rather replace it with: %26.
So, the working version is this.
Can you take a look at this page: http://msdn.microsoft.com/en-us/library/ms155391.aspx
It explains about when you can pass parameters via URL. Maybe your parameters are not set to Prompt for user input. HTH.

Resources