Opening an Order

Discussions related to SoftPro Select Server development.

Moderator: Phil Barton

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

Opening an Order

Post by roteague »

In the help file, under the section titled "Open an Order" we have the following code listing:

Code: Select all

NetworkCredential credential = new NetworkCredential(@"<username>", @"<password>", SoftPro.Select.Client.Constants.SelectDomain);
SelectServer server = new SelectServer(null, new Uri(@"http://localHost:80/SelectServer"), credential);

// Create the order tracking client
SoftPro.OrderTracking.Client.OrderTracking ot = server.GetService<SoftPro.OrderTracking.Client.OrderTracking>();

// Create the specification for the existing order.
OrderQuerySpec spec = new OrderQuerySpec()
{
          BaseOrderNumber = @"MyOrderNumber",
          Prefix = @"Pre",
          Suffix = @"Suf"
};

// Open the order
using (IOrder order = ot.GetOrder(spec, true))
{
try
       {
          // TODO: Manipulate the order
       }
       finally
       {
          // This MUST be called to release any locks on the order
          ot.CloseOrder(order);
       }
}
I have created a custom user and password, and specified this in the call to create the Network credential.

However, when calling

Code: Select all

ot.GetOrder(spec, true)
I get the following error:
Failed to load the SoftPro business rules for order.
What does this mean, and how can I successfully open the order?

Thanks,
Robert
Mark McKenna

Re: Opening an Order

Post by Mark McKenna »

That error occurs when our Rules Engine does not load any business rules from the targeted assemblies. The assemblies we reflect upon to gather the rule definitions are identified by the Select Server - there is a "BusinessRuleAssemblies" attribute on the Integration service. Please provide the attribute values for your Integration service by running the SPS utility:

Code: Select all

sps.exe services /s:(server)
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Opening an Order

Post by roteague »

Here is the result I get:

Code: Select all

Service      : OrderTracking
-------------------------------------------------------------------------------
Guid         : c4c55687-a771-42f4-8feb-3ec0640f3afc
Endpoints    : {Count = 2}
               ID                                   Name           Address
               ------------------------------------ -------------- ------------
               688d586d-63c2-410b-af4d-598d7b523a8d ScreenRegistry http://local
               69952518-49d0-4c59-8b2d-b1341720bcfa Lookups        http://local
Events       : {Count = 5}
               ID                                   Name
               ------------------------------------ ---------------------------
               c4edbd4f-f11d-4c48-be08-8c105181f5c9 OrderChanged
               cec82641-2d23-4072-bd81-4ac126ba2567 OrderClosed
               c3088264-4f52-4256-9132-ccb0b9ff0906 TasksChanged
               cacdf1c3-d4be-4471-b345-1f7a81a6fa87 CommitmentChanged
               dc43850f-04c4-4ebc-bc23-7d863462820d InvoiceChanged
Attributes   : {Count = 0}

Service      : Accounting
-------------------------------------------------------------------------------
Guid         : 6b0c588d-9f10-485f-963e-443594479ac0
Endpoints    : {Count = 0}
Events       : {Count = 1}
               ID                                   Name
               ------------------------------------ ---------------------------
               0d670a83-cc37-4d7e-b507-186f2ecf23f4 Disbursement
Attributes   : {Count = 0}

Service      : Integration
-------------------------------------------------------------------------------
Guid         : 3dd607a1-3389-4455-8752-96031a784748
Endpoints    : {Count = 6}
               ID                                   Name              Address
               ------------------------------------ ----------------- ---------
               c1c59a83-2f73-427e-96d8-0151c5510302 ServerStatus      http://lo
               70d05be4-9205-454f-b8e4-26e5d148b55c Authorization     http://lo
               296170c7-93b0-429e-aa53-78cb2677eca1 EventNotification http://lo
               c1270162-acb0-4b05-883a-ad5d6eafb297 Authentication    http://lo
               3bf32ae8-7d7c-477d-809f-bb8bb29adbf4 Licensing         http://lo
               ced8102e-502a-4af3-be7c-ff70bcd963d6 Registration      http://lo
Events       : {Count = 0}
Attributes   : {Count = 10}
               Name                               Value
               ---------------------------------- -----------------------------
               BusinessObjectCollectionAssemblies SoftPro.BusinessObjects.Core
               BusinessRuleAssemblies             SoftPro.BusinessRules.Core
               DocAndReportDefsPath               Data\DocAndReportDefs
               ManagerAssemblies                  SoftPro.SPAdminManagers.Core;
               ManagerControlAssemblies           SoftPro.Administration.Contro
               ManagerObjectMapsPath              Data\ManagerObjectMaps
               RuleInstanceDefsPath               Data\RuleInstanceDefs
               SnapSectionAssemblies              SoftPro.OrderTracking.Control
               StorageSystem                      SoftPro.Documents.Storage.Fil
               DbConnectionString                 Data Source=7S0PYB1\SQLEXPRES
Thanks for you help, and have a great weekend!!
Robert
Mark McKenna

Re: Opening an Order

Post by Mark McKenna »

The assemblies listing from SPS looks to be correct. In addition, the rules assembly file must be in the same directory as the executing assembly, so be sure that the SoftPro.BusienssRules.Core.dll file is in the same location as the Select Server client.
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Opening an Order

Post by roteague »

Thanks Mark it was missing the file. I have it set to Copy Local, but for some reason it still wasn't in the output directory (this is a small Winform demo program).

However, I still can't get the order, and I'm wondering if I have a data configuration issue with my local SP database. The error message I'm getting now is: "Could not find the data value requested: \"AdditionalCharges\"" I'm running build 2.2.20912.77. Nothing in the event log.

Thanks for all your help,
Robert
Mark McKenna

Re: Opening an Order

Post by Mark McKenna »

Be sure all the assemblies are in the same directory. Probably the best way to assure this is to have your custom binaries dropped into our SoftPro installation directory so that all the dependencies may be resolved. There are all sorts of auxiliary files beyond the DLLs that contribute to the framework Select runs under - so even if your binaries compile and the .NET assembly references are resolved, you could be missing out on some critical XML configuration data, for example.
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Opening an Order

Post by roteague »

Thanks Mark, I tried that. I'm still getting the same error:

Code: Select all

Message = "Could not find the data value requested: \"AdditionalCharges\""
Source = "SoftPro.BusinessObjects.Base"
StackTrace = "   at SoftPro.BusinessObjects.Base.BusinessObjectBase.GetDataValue(String dataItemName)\r\n   at SoftPro.BusinessObjects.Base.Engine.WalkPathToLeafObjects(PathStep[] path, IBusinessObject startContext, IBusinessObject[]& foundObjects, List`1& valsEncounter...


I'm working on a proof-of-concept application, so this isn't a show-stopper, but I could see it as a problem in the future when we start implementing our Order notification event handler.
Robert
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Opening an Order

Post by roteague »

I need to re-open this thread, since I'm now working on our Order Notification Event Handler. I'm running into the same issue I was before, not being able to get the Business Rules loaded. The error message is simply: "Failed to load the SoftPro business rules for order."

I ran the sps command, and I notice this that the BusinessRuleAssemblies attribute is not listed.

Code: Select all

C:\Program Files\SoftPro\Select>sps services /s:http://localhost/SelectServer
Service      : OrderTracking
-------------------------------------------------------------------------------
Guid         : c4c55687-a771-42f4-8feb-3ec0640f3afc
Endpoints    : {Count = 2}
               ID                                   Name           Address
               ------------------------------------ -------------- ------------
               688d586d-63c2-410b-af4d-598d7b523a8d ScreenRegistry http://local
               69952518-49d0-4c59-8b2d-b1341720bcfa Lookups        http://local
Events       : {Count = 5}
               ID                                   Name
               ------------------------------------ ---------------------------
               c4edbd4f-f11d-4c48-be08-8c105181f5c9 OrderChanged
               cec82641-2d23-4072-bd81-4ac126ba2567 OrderClosed
               c3088264-4f52-4256-9132-ccb0b9ff0906 TasksChanged
               cacdf1c3-d4be-4471-b345-1f7a81a6fa87 CommitmentChanged
               dc43850f-04c4-4ebc-bc23-7d863462820d InvoiceChanged
Attributes   : {Count = 0}

Service      : Accounting
-------------------------------------------------------------------------------
Guid         : 6b0c588d-9f10-485f-963e-443594479ac0
Endpoints    : {Count = 0}
Events       : {Count = 1}
               ID                                   Name
               ------------------------------------ ---------------------------
               0d670a83-cc37-4d7e-b507-186f2ecf23f4 Disbursement
Attributes   : {Count = 0}

Service      : Integration
-------------------------------------------------------------------------------
Guid         : 3dd607a1-3389-4455-8752-96031a784748
Endpoints    : {Count = 6}
               ID                                   Name              Address
               ------------------------------------ ----------------- ---------
               c1c59a83-2f73-427e-96d8-0151c5510302 ServerStatus      http://lo
               70d05be4-9205-454f-b8e4-26e5d148b55c Authorization     http://lo
               296170c7-93b0-429e-aa53-78cb2677eca1 EventNotification http://lo
               c1270162-acb0-4b05-883a-ad5d6eafb297 Authentication    http://lo
               3bf32ae8-7d7c-477d-809f-bb8bb29adbf4 Licensing         http://lo
               ced8102e-502a-4af3-be7c-ff70bcd963d6 Registration      http://lo
Events       : {Count = 0}
Attributes   : {Count = 8}
               Name                               Value
               ---------------------------------- -----------------------------
               BusinessObjectCollectionAssemblies SoftPro.BusinessObjects.Core
               DocAndReportDefsPath               Data\DocAndReportDefs
               ManagerAssemblies                  SoftPro.SPAdminManagers.Core;
               ManagerControlAssemblies           SoftPro.Administration.Contro
               ManagerObjectMapsPath              Data\ManagerObjectMaps
               RuleInstanceDefsPath               Data\RuleInstanceDefs
               StorageSystem                      SoftPro.Documents.Storage.Fil
               DbConnectionString                 Data Source=7S0PYB1\SQLEXPRES
I'm now running SoftPro 2.3. Any help you could provide would be appreciated.

Thanks,
Robert
Mark McKenna

Re: Opening an Order

Post by Mark McKenna »

The BusinessRuleAssemblies service attribute you noted has been deprecated. When the application starts, Select will look in the application directory for any files matching the pattern *.rules. Any files found must contain a line-delimited listing of assemblies (without file extensions) that will be reflected upon, from which Select will attempt to discover business rules. We provide one default file named SoftPro.rules that defines one rules assembly (SoftPro.BusinessRules.Core). If you are providing your own set of business rule assemblies, then you should provide your own rules file that identifies your custom rule assemblies.

Note that the rules file and the targeted rules assembly must both exist in the Select.exe application directory.
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Opening an Order

Post by roteague »

Mark,

Thanks that gets me closer. I'm getting the business rules to load now. But, I'm back to the issue I reported before:

Code: Select all

LoadOrderActivity:: Error: Could not find the data value requested: "AdditionalCharges", 

Stack Trace:    

at SoftPro.BusinessObjects.Base.BusinessObjectBase.GetDataValue(String dataItemName)     at SoftPro.BusinessObjects.Base.Engine.WalkPathToLeafObjects(PathStep[] path, IBusinessObject startContext, IBusinessObject[]& foundObjects, List`1& valsEncountered, Int32& maxChildrenFound)     at SoftPro.BusinessObjects.Base.Engine.GetDependencyValues(DataItemReference dataItem, IBusinessObject start, List`1& depen
Any idea where I can go from here?

Thanks,
Robert
Post Reply