Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BusinessProcess apparently not saving
Message
De
16/07/2012 10:00:52
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01547911
Message ID:
01548649
Vues:
54
Hi Kevin,

have you got any more ideas for me on this, please? The problem is that apparently the child biz objects do not have any changes made in their entity lists. I was making changes in their entities, not the entity lists. Can you tell me how I should be doing this, please?


>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform