Error in Business Rules

Discussions related to writing and managing custom business rules.

Moderator: Phil Barton

roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Error in Business Rules

Post by roteague » Tue Apr 12, 2011 9:06 pm

I'm running into the following error in one of the built in business rules:

TItleInsurancePremium.

The stack trace shows the error is a SqlException "@ID is not a parameter for procedure HudLineLoad."

The stored procedure HudLineLoad takes a single parameter @OrderID, not @ID. This leads me to believe that either the stored procedure is incorrect, or the BusinessRule module has a bug in it; it hasn't been updated to call stored procedure with the correct parameter name.

I need to validate that we have the correct version, if not, then we need to get the correct version.

We are running SP 2.6 SP5.
Robert

Mark McKenna

Re: Error in Business Rules

Post by Mark McKenna » Wed Apr 13, 2011 12:31 pm

Hi Robert, can you provide the stack trace so that we can investigate?

roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Error in Business Rules

Post by roteague » Wed Apr 13, 2011 1:44 pm

Here is the Stack Trace:

Code: Select all

<Exception Type="System.Exception" Message="&#xA;Error occurred while trying to load business object data.  Type="TitleInsurancePremium", ID=b6452689-dd5f-e011-8ff0-0050568e002c&#xA;System.Exception: &#xA;Error occurred while trying to load business object data.  Type="Loan", ID=60462689-dd5f-e011-8ff0-0050568e002c&#xA;System.Exception: &#xA;Error occurred while trying to load business object data.  Type="HudLine200Section", ID=e5452689-dd5f-e011-8ff0-0050568e002c&#xA;System.Data.SqlClient.SqlException (0x80131904): @ID is not a parameter for procedure HudLineLoad.&#xD;&#xA;   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)&#xD;&#xA;   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)&#xD;&#xA;   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()&#xD;&#xA;   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)&#xD;&#xA;   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()&#xD;&#xA;   at System.Data.SqlClient.SqlDataReader.get_MetaData()&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.ExecuteReader()&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.Load(Guid primaryID, ContextRoot rootContext)&#xA;&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.Load(Guid primaryID, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Core.HudLine.Load(Guid primaryID, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectCache.GetBusinessObject(String contextName, Guid primaryKey, ContextRoot rootContext, Boolean allowDisambiguation, SqlDataReader openReader, Boolean allowLoad, Boolean loadingAsCopy, Boolean acquiringRoot, Guid idForNewObject)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectCache.GetBusinessObject(String contextName, Guid primaryKey, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.LoadCalculatedChildObject(DataItemDescription itemDesc, Guid primaryKey)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.InternalLoad(Guid primaryID, ContextRoot rootContext, Dictionary`2 values, Byte[]& mergedIDs, Byte[]& userEnteredFlags, Boolean& foundIDs, StringBuilder& errors, Hashtable& nonBaseFieldsFound, Byte[]& sources, String& formulaData, String& customFields)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.Load(Guid primaryID, ContextRoot rootContext)&#xA;&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.Load(Guid primaryID, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectCache.GetBusinessObject(String contextName, Guid primaryKey, ContextRoot rootContext, Boolean allowDisambiguation, SqlDataReader openReader, Boolean allowLoad, Boolean loadingAsCopy, Boolean acquiringRoot, Guid idForNewObject)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectCache.GetBusinessObject(String contextName, Guid primaryKey, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.LoadCalculatedChildObject(DataItemDescription itemDesc, Guid primaryKey)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.InternalLoad(Guid primaryID, ContextRoot rootContext, Dictionary`2 values, Byte[]& mergedIDs, Byte[]& userEnteredFlags, Boolean& foundIDs, StringBuilder& errors, Hashtable& nonBaseFieldsFound, Byte[]& sources, String& formulaData, String& customFields)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.Load(Guid primaryID, ContextRoot rootContext)&#xA;System.Exception: &#xA;Error occurred while trying to load business object data.  Type="Loan", ID=60462689-dd5f-e011-8ff0-0050568e002c&#xA;System.Exception: &#xA;Error occurred while trying to load business object data.  Type="HudLine200Section", ID=e5452689-dd5f-e011-8ff0-0050568e002c&#xA;System.Data.SqlClient.SqlException (0x80131904): @ID is not a parameter for procedure HudLineLoad.&#xD;&#xA;   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)&#xD;&#xA;   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)&#xD;&#xA;   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()&#xD;&#xA;   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)&#xD;&#xA;   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()&#xD;&#xA;   at System.Data.SqlClient.SqlDataReader.get_MetaData()&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)&#xD;&#xA;   at System.Data.SqlClient.SqlCommand.ExecuteReader()&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.Load(Guid primaryID, ContextRoot rootContext)&#xA;&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.Load(Guid primaryID, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Core.HudLine.Load(Guid primaryID, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectCache.GetBusinessObject(String contextName, Guid primaryKey, ContextRoot rootContext, Boolean allowDisambiguation, SqlDataReader openReader, Boolean allowLoad, Boolean loadingAsCopy, Boolean acquiringRoot, Guid idForNewObject)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectCache.GetBusinessObject(String contextName, Guid primaryKey, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.LoadCalculatedChildObject(DataItemDescription itemDesc, Guid primaryKey)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.InternalLoad(Guid primaryID, ContextRoot rootContext, Dictionary`2 values, Byte[]& mergedIDs, Byte[]& userEnteredFlags, Boolean& foundIDs, StringBuilder& errors, Hashtable& nonBaseFieldsFound, Byte[]& sources, String& formulaData, String& customFields)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.Load(Guid primaryID, ContextRoot rootContext)&#xA;&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.Load(Guid primaryID, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectCache.GetBusinessObject(String contextName, Guid primaryKey, ContextRoot rootContext, Boolean allowDisambiguation, SqlDataReader openReader, Boolean allowLoad, Boolean loadingAsCopy, Boolean acquiringRoot, Guid idForNewObject)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectCache.GetBusinessObject(String contextName, Guid primaryKey, ContextRoot rootContext)&#xD;&#xA;   at SoftPro.BusinessObjects.Base.BusinessObjectBase.InternalLoad(Guid primaryID, ContextRoot rootContext, Dictionary`2 values, Byte[]& mergedIDs, Byte[]& userEnteredFlags, Boolean& foundIDs, StringBuilder& errors, Hashtable& nonBaseFieldsFound, Byte[]& sources, String& formulaData, String& customFields)&#xA;">
  <StackTrace>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectBase" Name="Load">
      <Arguments>
        <Argument Type="Guid" Name="primaryID" />
        <Argument Type="ContextRoot" Name="rootContext" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCache" Name="GetBusinessObject">
      <Arguments>
        <Argument Type="String" Name="contextName" />
        <Argument Type="Guid" Name="primaryKey" />
        <Argument Type="ContextRoot" Name="rootContext" />
        <Argument Type="Boolean" Name="allowDisambiguation" />
        <Argument Type="SqlDataReader" Name="openReader" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCache" Name="GetCollectionBusinessObject">
      <Arguments>
        <Argument Type="String" Name="contextName" />
        <Argument Type="Guid" Name="primaryKey" />
        <Argument Type="ContextRoot" Name="rootContext" />
        <Argument Type="Boolean" Name="allowDisambiguation" />
        <Argument Type="SqlDataReader" Name="openReader" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCollectionBase" Name="GetNewChildFromGuid">
      <Arguments>
        <Argument Type="GuidObjectPair" Name="childID" />
        <Argument Type="ContextRoot" Name="root" />
        <Argument Type="SqlDataReader" Name="openReader" />
        <Argument Type="Boolean" Name="allowLoad" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCollectionBase" Name="CreateChildrenFromGuidList">
      <Arguments>
        <Argument Type="GuidObjectPair[]" Name="childIDs" />
        <Argument Type="SqlDataReader" Name="openReader" />
        <Argument Type="Boolean" Name="allowLoad" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCollectionBase" Name="LoadIndividual">
      <Arguments>
        <Argument Type="" Name="" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCollectionBase" Name="Load">
      <Arguments>
        <Argument Type="" Name="" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectBase" Name="LoadChildCollections">
      <Arguments>
        <Argument Type="" Name="" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectBase" Name="Load">
      <Arguments>
        <Argument Type="Guid" Name="primaryID" />
        <Argument Type="ContextRoot" Name="rootContext" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCache" Name="GetBusinessObject">
      <Arguments>
        <Argument Type="String" Name="contextName" />
        <Argument Type="Guid" Name="primaryKey" />
        <Argument Type="ContextRoot" Name="rootContext" />
        <Argument Type="Boolean" Name="allowDisambiguation" />
        <Argument Type="SqlDataReader" Name="openReader" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCache" Name="GetBusinessObject">
      <Arguments>
        <Argument Type="String" Name="contextName" />
        <Argument Type="Guid" Name="primaryKey" />
        <Argument Type="ContextRoot" Name="rootContext" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.SingleObjectContainerMatchingIDs" Name="Load">
      <Arguments>
        <Argument Type="Guid" Name="owningID" />
        <Argument Type="ContextRoot" Name="rootContext" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectBase" Name="LoadChildCollections">
      <Arguments>
        <Argument Type="" Name="" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectBase" Name="Load">
      <Arguments>
        <Argument Type="Guid" Name="primaryID" />
        <Argument Type="ContextRoot" Name="rootContext" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Core.Order" Name="Load">
      <Arguments>
        <Argument Type="Guid" Name="primaryID" />
        <Argument Type="ContextRoot" Name="rootContext" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCache" Name="GetBusinessObject">
      <Arguments>
        <Argument Type="String" Name="contextName" />
        <Argument Type="Guid" Name="primaryKey" />
        <Argument Type="ContextRoot" Name="rootContext" />
        <Argument Type="Boolean" Name="allowDisambiguation" />
        <Argument Type="SqlDataReader" Name="openReader" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCache" Name="GetRootObject">
      <Arguments>
        <Argument Type="String" Name="contextName" />
        <Argument Type="Guid" Name="primaryKey" />
        <Argument Type="ContextRoot" Name="rootContext" />
        <Argument Type="Boolean" Name="loadingAsCopy" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.BusinessObjects.Base.BusinessObjectCache" Name="AcquireRootReference">
      <Arguments>
        <Argument Type="String" Name="contextName" />
        <Argument Type="Guid" Name="primaryKey" />
        <Argument Type="Boolean" Name="loadAsCopy" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.OrderTracking.Client.OrderTracking" Name="OpenOrderObject">
      <Arguments>
        <Argument Type="Guid" Name="id" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.OrderTracking.Client.OrderTracking" Name="OpenOrder">
      <Arguments>
        <Argument Type="Guid" Name="id" />
        <Argument Type="Boolean" Name="readOnly" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.OrderTracking.Client.OrderTracking" Name="GetOrderOrTemplate">
      <Arguments>
        <Argument Type="OrderQuerySpec" Name="spec" />
        <Argument Type="Boolean" Name="readOnly" />
      </Arguments>
    </Method>
    <Method Namespace="SoftPro.OrderTracking.Client.OrderTracking" Name="GetOrder">
      <Arguments>
        <Argument Type="OrderQuerySpec" Name="spec" />
        <Argument Type="Boolean" Name="readOnly" />
      </Arguments>
    </Method>
    <Method Namespace="TG.SoftPro.OrderLookup.SoftProOrder" Name="LoadOrder">
      <Arguments>
        <Argument Type="String" Name="orderNumber" />
        <Argument Type="Boolean" Name="isReadOnly" />
      </Arguments>
    </Method>
  </StackTrace>
</Exception>
Note: I found a bug in one of your other stored procedures: HudLine1200SectionLoad. This stored procedure also calls: HudLineLoad, but with two parameters:

Code: Select all

Execute HudLineLoad @ID, @HudID
Robert

Mark McKenna

Re: Error in Business Rules

Post by Mark McKenna » Wed Apr 13, 2011 5:50 pm

Robert, I think both the stored procedure and the business rule are sound. What appears to be happening is that the engine is trying to use the stored procedure that is really intended to load HudLines en masse (for the Order), but for the purpose of loading a single HudLine instead (which it can't do). We will have to investigate further. Is this something that is happening on only one Order? If so, what is the origin of the Order (API, Select app, etc.)? Also, is this something that just started happening, following an upgrade, perhaps? If you have any more of those sorts of details, that would help.

As for the HudLine1200SectionLoad stored procedure, there is a good possibility that it has simply been abandoned, but not dropped (the data store is not intended to be public facing, so that does happen occasionally).

roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Error in Business Rules

Post by roteague » Wed Apr 13, 2011 8:53 pm

Thanks Mark,

All our errors are coming from API calls; this particular error was being raised frequently times yesterday, and on one order. I reported this particular one because it's one of the few that I've been able to get an error message that seems to make sense.

The problem is, we are continually running into issue with Business Rules via the API. It's just not reliable, and causing us lots of problems with keeping our Orders and Back End system sychronized. As soon as I get a chance, I'll go through and do an anaysis of which rules are failing (it seems to be the same ones over and over) and let you know.

Thanks,

Robert
Robert

roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Error in Business Rules

Post by roteague » Thu Apr 14, 2011 3:11 pm

I did an analysis of the business rule failures (about 1500 errors), and it seems to be pretty consistent which rules fail.

AdditionalChargeFirstNonEmpty
AllPayoffs
CommitmentPoliciesToInsure
CountersignaturePolicy
CreditDebitChecked
FIndPayoffCharge
FindPercentBasisCharge
FindProrationCharge
HudLineAdditionalChargeGenerator
HudLineFromNumberAndRESPAOption
PayeeAggregator
PayorAggregator
SisterHudLine

There are others, but they only happen occasionally. Some of the happen hundreds of times.

The difference between these rule errors is they are marked as:
Error executing business rule 'SoftPro.BusinessRules.Core.PayeeAggregator' Inputs: 1. 2. False
The original error is still happening, with the same stack trace as I reported earlier.
Robert

Mark McKenna

Re: Error in Business Rules

Post by Mark McKenna » Thu Apr 14, 2011 5:01 pm

Robert, our critical issues team is currently looking into this and will get back with you. Yours is the only report of this problem we have so they will have to work with you in order to get more specifics for determining the appropriate solution.

kqian
Posts: 68
Joined: Wed Feb 23, 2011 4:01 pm

Re: Error in Business Rules

Post by kqian » Mon May 09, 2011 6:07 pm

We are now running into the same problems. Can you share the solution? Thanks.

roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Error in Business Rules

Post by roteague » Mon May 09, 2011 8:22 pm

Sorry, this is still outstanding, and hasn't been resolved.
Robert

Mark McKenna

Re: Error in Business Rules

Post by Mark McKenna » Tue May 10, 2011 1:47 pm

kqian wrote:We are now running into the same problems.
This is an issue that until now was known to be limited to one customer, which our Critical Issues team has been investigating. If you have any details to share, such as stack traces, or even a summary of how often this happens, to how many orders, Select vs API, etc. that would help our efforts.

Thanks!

Post Reply