Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BusinessProcess apparently not saving
Message
From
11/07/2012 08:52:25
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01547911
Message ID:
01548170
Views:
44
Hi Kevin,

I've sorted out my debugging problems and apparently my problem is that when the parent bizobj is being saved an dit subsequently calls the child bizobj's save, the child bizobj's entitylist is apparently null, which is weird as I've set a value on the entity successfully just prior to saving. Is there any where you see in my code that I am either passing the wrong thing or setting it to null?

>Frank,
>
>First of all, when you run this line of code:
>
>
mmSaveDataResult result = this.oPolicyHeader.SaveEntity();
>
>Some of the possible results in the mmSaveDataResult enum are SaveCanceled and Exception. Looks like you're not checking for either of these, so either condition could be occurring and you wouldn't know it.
>
>If after checking for these conditions, and you're still not saving, I recommend setting a breakpoint on the above line of code and stepping through to take a closer look at what's happening.
>
>Best Regards,
>
>
>
>
>>I have a Business Process defined like this:
>>
>>
    public partial class PolicyDailyBusinessProcess : mmBusinessProcess
>>    {
>>        protected PolicyHeader oPolicyHeader;
>>        protected Policy oPolicy;
>>        protected PolicyLoan oPolicyLoan;
>>        protected Receipt oReceipt;
>>        protected ReceiptDetail oReceiptDetail;
>>        protected PolicyRider oPolicyRider;
>>
>>        protected override void DefineParticipatingObjects()
>>        {
>>            this.oPolicyHeader = (PolicyHeader)this.RegisterBizObj(new PolicyHeader());
>>            this.oPolicy = (Policy)this.RegisterBizObj(new Policy());
>>            this.oPolicyLoan = (PolicyLoan)this.RegisterBizObj(new PolicyLoan());
>>            this.oReceipt = (Receipt)this.RegisterBizObj(new Receipt());
>>            this.oReceiptDetail = (ReceiptDetail)this.RegisterBizObj(new ReceiptDetail());
>>            this.oPolicyRider = (PolicyRider)this.RegisterBizObj(new PolicyRider());
>>
>>            this.oPolicyHeader.RegisterChildBizObj(this.oPolicy);
>>            this.oPolicyHeader.RegisterChildBizObj(this.oPolicyLoan);
>>            this.oPolicyHeader.RegisterChildBizObj(this.oReceipt);
>>            this.oReceipt.RegisterChildBizObj(this.oReceiptDetail);
>>            this.oPolicy.RegisterChildBizObj(this.oPolicyRider);
>>        }
>>
>>        public void ProcessAllActivePolicies(int userPK)
>>        {
>>            mmBindingList<PolicyHeaderEntity> PolicyHeaderList = this.oPolicyHeader.GetActivePolicies();
>>            foreach (PolicyHeaderEntity oPolicyHeaderEntity in PolicyHeaderList)
>>            {
>>
>>                mmSaveDataResult result = DailyProcessPolicy(oPolicyHeaderEntity, userPK);
>>                if (result != mmSaveDataResult.RulesPassed)
>>                {
>>                    string rules = this.Rules.GetAllBrokenRules();
>>                }
>>
>>            }
>>
>>        }
>>
>>        public mmSaveDataResult DailyProcessPolicy(PolicyHeaderEntity oPolicyHeaderEntity, int userPK)
>>        {
>>            this.oPolicyHeader.GetEmptyDataSet();
>>            this.oPolicyHeader.GetPolicyHeaderByPolicyHeaderPK(oPolicyHeaderEntity.PolicyHeaderPK);
>>
>>            this.oPolicy = new Policy();
>>            this.oPolicy.GetEmptyDataSet();
>>            this.oPolicy.GetPolicyByPolicyHeaderFK(oPolicyHeaderEntity.PolicyHeaderPK);
>>            
>>            Boolean saveChanges;
>>            saveChanges = false;
>>            // still to do:
>>            // adjustments to the premiums due to dependants’ ages, and other factors causing riders to be dropped off.
>>
>>            // Check if to send a notice of payment due
>>            if (PremiumIsDue()) //oPolicy, oPolicyHeader))
>>            {
>>                SendPremiumDueNotice();  //oPolicy);
>>                saveChanges = true;
>>            }
>>            else
>>                // Check if to send a notice of payment late
>>                if (PremiumIsLate())    //oPolicy, oPolicyHeader))
>>                {
>>                    SendPremiumLateNotice();
>>                    saveChanges = true;
>>                }
>>                else
>>                    // Check if lapsing
>>                    if (Lapsing())  //oPolicy, oPolicyHeader))
>>                    {
>>                        Lapse(userPK);    //oPolicy, oPolicyHeader, userPK);
>>                        saveChanges = true;
>>                    }
>>                    else
>>                        // Check if Scheduled Termination
>>                        if (Terminating())
>>                        {
>>                            Terminate();
>>                            saveChanges = true;
>>                        }
>>                        else
>>                            // check for change in premium
>>                            if (PremiumNeedsChanging())
>>                            {
>>                                ChangePremium();
>>                                saveChanges = true;
>>                            }
>>
>>            if (saveChanges == true)
>>            {
>>                mmSaveDataResult result = this.oPolicyHeader.SaveEntity();
>>                // Return a result that indicates if there were any broken rules or warnings
>>                if (this.BusinessRuleObj.HasBrokenRules)
>>                {
>>                    string rules = this.BusinessRuleObj.GetAllBrokenRules();
>>                    return mmSaveDataResult.RulesBroken;
>>                }
>>                if (this.BusinessRuleObj.HasWarnings)
>>                {
>>                    return mmSaveDataResult.RuleWarnings;
>>                }
>>
>>            }
>>            return mmSaveDataResult.RulesPassed;
>>        }
>>
>>
>>My particular problem is that during a call to ProcessAllActivePolicies a value gets changed in oPolicy, but this change is not getting saved. Any ideas what could be causing this?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform