Quick Guide to Decision Modeling using DMN 1 - Signavio · Quick Guide to Decision Modeling using...
Transcript of Quick Guide to Decision Modeling using DMN 1 - Signavio · Quick Guide to Decision Modeling using...
Quick Guide toDecision Modelingusing DMN 1.0
A White Paper February 2017, 2nd Edition
Gero Decker, Signavio, Inc.
Tom Debevoise, Signavio, Inc.
Page 2 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Table of Contents
1. WhyreadthisQuickGuide?...............................................................................................3
2. GettingStartedwithDMN1.0.............................................................................................4
3. DMNDiagrams:Focusingonthequestionstobeanswered....................................8
3.1FromProcessModelstoDecisionModels............................................................... 8
3.2Divide&Conquer...........................................................................................................9
3.3WhentodivideDecisionsintoSub-decisions........................................................10
3.4NamingConventionsforDecisions............................................................................11
3.5Inputs:SimpleTypesvs.ComplexObjects(BusinessObjects)..........................12
3.6WhentouseKnowledgeSources..............................................................................13
3.7WhentouseBusinessKnowledgeModels.............................................................13
4. WorkingwithDecisionTables...........................................................................................14
4.1CompleteorIncomplete?............................................................................................15
4.2ChoosingtherightHitPolicy.......................................................................................15
4.3FromDecisionTreestoDecisionTables..................................................................17
4.4FromCheckListstoDecisionTables:ThecaseofUniquevs.Anyvs.First.....18
4.5FromInputObjectstoInputExpressions..............................................................20
5. Conclusion.............................................................................................................................21
6. Contact..................................................................................................................................22
Page 3 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
1. WhyreadthisQuickGuide?
TherearemanyreasonswhyBusinessDecisionManagement(BDM)shouldbehighonbusinessleader’sobjectives:
› Theavailabilityofbigdataandpowerfulanalyticstechnologythatuncoversnewopportunitiesfor“smarterdecisions”and
› ComplexrequirementsforcompliancerequireequallycomplexdecisionsthatarefulltraceablefrombusinessrequirementstoITimplementations.
Toreapthestrategicbenefitsofbigdataanalytics,businessesneedtoconnecttheoutputtotheoperationaldecisionsthatdriveprocesses.Tomaketheconnectionsbusinessesmusthaveadeepunderstandingofthesedecisionsandthelogicbehindthem,thedatathatdrivesthemandtheprocessestheydirect.BDMisanewdisciplinethatidentifiescataloguesandmodelsdecisions,partic-ularlyoperationaldecisions,intheenterprise.
Theobjectiveofadecisionmodelistocreateasharedunderstandingaboutitsdrivingfactors:thelogic,dataandprocesses.TherecentlyapprovedDecisionModelingandNotation(DMN)1.0standardfromtheObjectManagementGroup(OMG)isanotationthataccomplishesthesegoals.
DMN1.0helpsyouto
› discoverandoptimizeoperationaldecisionsinyourorganization
› documentbusinesslogicforregulatorycompliance
› designdecisionlogicforrules-centricautomationprojects
› driveperformanceusinganalytics
TheDMNstandardalsoprovidesapowerfulmeta-model,notationandsemanticsfordecisionmodeling.However,italsoofferslittleguidance.Likemoststandards,therearenobestpracticesorusagestyles.
ThisQuickGuideservesasanintroductiontodecisionmodelinginDMNfornovicemodelers.Itaimsforguidance,notforcompleteness.ItfocusesonfrequentlyaskedquestionsandoffersavarietyofpracticalrecommendationssothatyoucanimmediatelystartusingDMN. Happydecisionmodeling!
Page 4 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
2.GettingStartedwithDMN1.0
DMNisacriticaladditionforthebusinessanalyststhatwishtomodelandimprovethedecisionsthattheirbusinessesmake.PriortotheDMNstandard,therewerenoopenstandardsformodeling thedataandlogicassociatedwiththeprocesses.Inthisquick-startguide,wewilllearnhowtomodeldecisionsbyimmediatelylookingatausecase:
Imagineyouareworkingatabank.Acustomermakesarequesttowithdraw$9,000fromhissavingsaccount.Canyouaccepthisrequest,processthetransactionandhandhimthemoney?
Youhavetomakeabusinessdecision.
Whatarethecriteriaforthecorrectdecisionandwhatinformationisyourchoicebasedon?Isitrelevantthatthecustomerhaswithdrawnalargesumlastweek?Isthereanupperbound?
Thebankhasstandardrulesforhandlingtherequest:
› Thereneedtobesufficientfundsintheaccount.
› Theidentityofthecustomerhastobeproperlyverified.Certaindocumentsmustbepresentfortransactionsgreaterthan$5,000.Moreover,whichtypeofdocumentisalloweddependsonthecustomer’snationality.
Yet,theserulesarejustaportionofthelogicneededtomakeadecisionaboutthewithdrawaloffunds.Businessesmakemanydifferentdecisionsthattakeplaceatthethreelevelsofbusiness:
› Strategic,thesedecisionshavelong-rangeimpacts.Theymightincludeenteringnewlinesofbusiness,acquisitionofcompaniesandassets
› Tactical,thesedecisionsinvolveexistinglinesofbusiness.Tacticaldecisionsincludego-to-marketplans,respondingtoimmediateopportunitiesandtakingadvantageofshort-termmarketadvan-tages.Tacticaldecisionsoccurmorefrequentlythanstrategicdecisions
› Operationaldecisions.Operationaldecisionsare‘baked’intoexistingbusinessprocessesandpractices.Operationaldecisionsoccurveryfrequently,sometimesscoresofthousandseachday.Examplesincludethepricesofitems,thediscountsoffered,andbasicbusinessdecisions.
Sothewithdrawaldecisionisasimpleexampleofanoperationaldecision.Itisconnectedtoaprocessthatvalidatesandtracksthewithdrawaloffundsfromcustomeraccounts.Basedoninputfacts,adecisionoutcomeisderived,leadingtoanactioninaprocess.Figure1presentsaDMNmodelofthisdecision.DMNisaninternationalstandardandversion1.0wasreleasedbyOMGinDec2014.
Page 5 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Figure1DMNdiagram
DMNdistinguishesbetweentwolevels:decisionrequirementsdiagrams(wewillsimplycallthemDMNdiagrams)anddecisionlogic.
Decisionsarerepresentedbyrectanglesandinputdatabyroundedrectangles.Inthisexample“Approvemoneywithdrawal”isthetop-leveldecision.“Sufficientfunds”and“Valididentification”aresubdecisions,theoutcomeofwhichisconsideredbytop-leveldecision.Theyarealsosubdecisionsbecausethequestionstheyposemustbeansweredbeforethemainquestion,“Approvemoneywithdrawal”,isanswered.Thearrowsdepictaflowofthedecisionsintothetop-leveldecision.Therecanalsobemorethanonetop-leveldecision.
Thirdelementtypes,calledknowledgesourceshelpusdepictdependenciesonpoliciesorregula-toryrequirements.Inthiscase,thelattertwosubdecisionsdependon“§154AO”,aparticularretailbankingregulation.
DMNdiagramsprovideahigh-leveloverviewofhowadecisiondependsonotherdecisions,policiesorregulationandinputdata.Decisionlogicspecifiesthedetailsofonedecision,sothatitcanbe easilyandunambiguouslyunderstoodbyahuman.Decisionmodelscanalsobeexecutableandincludedsystemcomponents.
Asshownintheprocessdiagrambelow,decisionscanbetightlyconnectedtobusinessprocesses.Operationaldecisionscanaffectaprocessinanumberofdistinctiveways.Decisionscandirectthenextsteporactivitytobetaken,whoisresponsiblefortheactivity,thecourseofactiontobetakenandthedatarequiredtocompletetheactionsofthedecision.
Page 6 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Figure1a,thedecisioninfigure1controlsthisprocess.
DMNelement Description
Adecisionistheactofsettlingaquestionormakingadetermination,fromanumberofinputvalues,usinglogicdefininghowtheoutputisdeterminedfromtheinputs.
Decisionscandependonotherdecisions(subdecisions).
Decisionsdependoninputdatafordeterminingtheoutput.Wewillusetheterm“input objects”inthisdocument.
Knowledge sources areauthoritiesfordecisions.Often,itissourcedocuments,suchasinternalpoliciesorexternalregulationthatwereusedtoderivethedecis-ionlogic.
Information Requirementsshowtheneedinputofinformationfromeitherasub-decisionsorinputdata
Table1DMNelements
Page 7 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
ADMNdiagramdoesnotdepictthedecisionlogicofaparticulardecision.Thisisdonethrougheitherlogicalexpressionsorthedecisiontablesthatareattachedtothedecision.Thedecisiontablefor“Approvemoneywithdrawal”isshowninfigure2.
Figure2Decisiontablefor“Approvemoneywithdrawal”
TheACcolumnorderstherulesinthetable.Undercertainconditions,thisorderisimportantfordeterminingwhichrule‘fires’.Thetwocolumnsontheleftaretheinputs.Thecolumnontherightistheoutputofthedecision.Eachrowisarule:Itshowswhichcombinationofinputvaluesleadstowhichoutputvalue.
Inthisexample,moneywithdrawalisonlyapprovediftherearesufficientfundsandthereisvalididentification.
Therulethatnoidentitydocumentisrequiredforwithdrawalsoflessthan$5,000ispartofthe“Valididentification”decision.Theemptycellsdenoteawildcardmatchforanyvaluethatisprovided.Thecorrespondingdecisiontableisshowninfigure3.
Figure3Decisiontablefor“Valididentification”
Page 8 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
3.DMNDiagrams:Focusingonthequestionstobeanswered
Everydecisionresolvesorsettlesaquestion.Let’sconsiderthemoneywithdrawalexampleagain.Here,thequestionis:Isthecustomerallowedtowithdrawtherequestedamountfromhissavingsaccount?Thetwopossibleanswersare:“Approved”and“Notapproved”.
QuestionsandanswersarenotgraphicallyshowninDMNdiagrams.Theyareattributesofdecisions.
3.1FromProcessModelstoDecisionModels
Businessprocessmodelsareagreatwaytoshowthedecisionresponse.Mostdecisionsrespondtoanddirectabusinessprocess.Hereisanotherexamplefromthefinancialsector:Whendevelopingabusinessprocess,theobjectivesofthestorywillsuggestthecorrectquestionforthedecisions.Considerthefollowingstory:
Whenaninvestmentadviserentersintobusinessorexpandshisoperations,hemustregisterwithdifferentauthorities.EspeciallylargeadvisersoftenregisterwiththeSecuritiesandExchangeCommission(SEC),whileothersonlyregisteronthestatelevelorevennotatall.
Figure4BPMNdiagram
Thelabelofthegatewaydirectlyreferstotheoutputofthedecision.Thebranchingconditionsattachedtothesequenceflowedgesdescribethefourpossibleanswers.
Page 9 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Question:Wheremusttheadviserregister?
Processresponses(Answers):
› Statelaw
› Statelaw,SECpotential
› Nonerequired
Therefore,theprocessobjectivedeterminesthequestiontobeanswered.Iftheprocesswasstruc-tureddifferently,thequestionwouldhavelookeddifferent,too.Forinstance,alternativequestions couldhavebeen“DoIneedtoregister?”(Answer:Yes/No)or“WhichstatesdoIhavetoregisterwith?”(Answer:listofcorrespondingstates).
3.2Divide&Conquer
Alwaysfocusingonthequestionalsohelpstosubdividecomplexdecisionsintosubdecisions.Figure5showsaDMNdiagramfortheexample.
Figure5Masteringcomplexdecisionsthroughsubdecisions
ThequestionwhethertheAdviserActisapplicabletotheadviserhasalargeimpactontheregistra-tionrequirement:IftheadviserdoesnotqualifyaccordingtoSection202thennoregistration isrequiredatall.Therefore,“ApplicabilityofSection202(a)(11)AdviserAct”wasintroducedasasubdecision.
Page 10 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Thesizecategoryoftheadvisoriscriticaltothetopdecision.Thesizeclassifiesthecategoryanddifferentrulesapplytotheadviser.Wheretheadviserhastoregisterissplitintothethreesubdecisions:
› “Registrationrequirement(smalladviser)”,
› “Registrationrequirement(medium-sizedadviser)”
› “Registrationrequirement(largeadviser)”.
Slicingupalargerscenariointosmallerpieces,whichcanthenbetreated(“managed”)individually,isacommonmodelingpatternthatisnotonlyfoundindecisionmodeling:Divide&conquer.
Youcanapplydivideandconquerwhenmovingfromthetop-leveldecisiontosubdecisions(verticaldivide&conquer).Agoodexampleisthesub-decision“ApplicabilityofSection202(a)(11)AdviserAct”.Divide&conquercanalsobeusedinsegmentation(horizontaldivide&conquer).Slicingupthedecisionaccordingtothesizeclassificationisanexample.
3.3WhentodivideDecisionsintoSub-decisions
Findingthecorrectlevelofabstractionisanimportantsuccessfactorineverymodelingendeavor.Thisisespeciallytruewhendecidingtouseone“bigger”DMNdecisionorratherseveral“small”DMN.
ConsidertheinvestmentadviserDMNdiagraminfigure5.Here,thedifferentdecisionsaresmallenoughtodefinethedecisionlogicatalatterpoint.Also,thedecisionsarebigenoughnottogetlostinhugediagrams,Herearesomehintsthatcanhelpyoudecidewhentosplitupdecisionsintosubdecisions:
Criterion Description
Necessity Subdecisionsareoftennecessitatedbytheobjectivesoftheto-leveldecision.IfIntheexample,differentsize-specificregistrationrequirementsneededtobedecidedbeforethetop-leveldecisioncouldbemade.Simplyput,mostbusi-nessdecisionsneedtheinputofsubdecisions.
Reusability Subdecisionscanbereusedindifferentdecisionmodelsanddifferentcontexts.
Forinstance,the“Investmentadvisersizeclassification”mightnotonlyberele-vantforthequestionregisteringanadviserbutalsoforothercontexts.
Complexity Onceadecisionhasmorethan7inputsand/orsubdecisions,thisisaclearsignthatthedecisionlogicwillmostlikelybeverycomplex.Theideaisthathumansarestillabletounderstandthedecisionlogic–andnotonlymachines.Sobettersplitaverycomplexdecisionintotwoormoredecisions.
Authority DMNKnowledgeSourcescanbeusedtodepictpoliciesorregulatoryrequi-rementsthatinfluence/guideadecision.Toshowthatpartofthedecisionmakingisbasedonaninternalpolicyandanotherdependsonsomeexternalregulation,couldbeagoodreasonforsplittingupthedecisionintotwodecis-ions.
Page 11 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Decision maker Whoismakingthedecision?Isitapersonorisitamachine?Ifdifferentpeopleordifferentsystemsaremakingdifferentpartsofadecision,thenyoumightneedtosplitupthedecisionintodecisionsmadebyonemachineoroneroleonly.
“Decisionmaker”isanattributeofdecisionsinDMNdiagrams(nographicalrepresentation).
Decision owner Everydecisioncanhaveadecisionowner.Thisisthepersonresponsibleforthedecisionoutcome.Iftherearedifferentpartsofadecisionwhichdifferentowners,youmightwanttosplitthedecisionupaccordingtoownership boundaries.
“Decisionowner”isanattributeofdecisionsinDMNdiagrams(notgraphicalrepresentation).
Table2Criteriaforsplittingupdecisionsintosubdecisions
Recommendation:Decisionmodelingisaniterativeexercise.Inmanyprojects,therightlevelofgranularitycomesnaturally.Thekeycriterionofthemodelisclarity:shareyourdecisionmodelwitha
colleagueandobservewhetherhe/sheunderstandsit.
3.4NamingConventionsforDecisions
WorkingwithdecisionsandsubdecisionssuggestsaneedfornamingconventionsinDMN.Table2showsthemostpopularlabelingstylesfoundinDMNdiagrams.
Namingstyle Example Description
Activity style Determinewhereto register
ThedecisionhasthesamelabelasthecorrespondingBPMNtask.Theactofdecisionmakingmovesintothecenter. Thisisa“verbobject”style.Typicalverbsare“check”,“determine”or“calculate”,“select’,“choose’.
Output style Investmentadvisersizeclassification
Thedecisionhasthesamelabelliketheoutputvariableofthedecisionlogic.
Often,youcanfindwordslike“applicability”,“eligibility”,“score”or“ranking”aspartofthislabelingstyle.
Page 12 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Question style Providesadvicetoregisteredinvestmentcompaniesonly
Thedecisionlabelequalsthequestionoratleastisanabbreviatedversionofthequestion.
Thislabelingstyleisoftenobservedwhenturningcomplex/rawinputdata(suchascustomerbaseinthisexample)intosomethingmeaningful.
Attention:Questionsareoftenverylongandthereforeleadtoverylongdecisionlabels.
Table3Labelingstylesfordecisions
Recommendation:Usetheactivitystyleforthetop-leveldecision,tohighlighttheconnectiontothesurroundingprocess.Usetheoutputstyleforallotherdecisions.Insomecases,thequestionstyleismoreintuitivethantheoutputstyle.
3.5Inputs:SimpleTypesvs.ComplexObjects(BusinessObjects)
OntheDMNdiagramlevel,themodelercanselectthelevelofgranularityofinputobjects.FromthegraphicalrepresentationintheDMNdiagram,wecannottellwhetheraninputobjectisacomplexobjectorasimpletype.
Intheexampleabove,“AUM”(whichistheabbreviationfor“AssetsunderManagement”)ismostlikely asimpletype,namelyaUSDamount.Thecaseof“Location”isnotsoeasy:Itcouldeitherbeasimpletype(e.g.oneoftheUSstates)oracomplexobjectconsistingofastructuredaddress,includingstreet name,zipcode,state,countryorevengeolocation.Somebusinessanalystscallthesebusinessobjects.
Eachcomplexobjecthasmultiplefields.Everyfieldinturncanbeacomplexobjectorasimpletype.Zipcodeandstateareexamplesforsimpletypefields.Geolocationisanexampleforacomplexobjectfield:Itconsistsofthelatitudeandlongitude.
Manytimes,thedecisionrequirementsmodelersmightlackdetailedunderstandingofthestructureofthedata.Therefore,theymightnotknowwhetheritisasimpletypeoracomplexobject.
Thisisnotaproblemwhendraftingthefirstversionofadecisionmodel.InearlyphasesofDMNdiagrammodeling,itismoreimportanttoidentifytherightquestionsandanswers(thedecisions)andtheirdependencies.
Whendefiningthedetaileddecisionlogic,anunderstandingoftheunderlyingdatamodelisrequired.Decisionmodelingshouldbeacollaborativeeffortbetweenrequirementsmodelers,peoplewithdeepunderstandingofthedatamodelandsubjectmatterexpertswhocanexplainintricatedetailsofthedecisionlogic.
Page 13 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Someorganizationshaveacentraltaxonomyordatadictionary,whichcontainsthemostrelevantterms/objectsandtheirrelationships.Thisisvaluableinputfordecisionmodeling.Ifproperlydone, adatadictionaryacceleratestheselectionoftherightinputobjectsandmapshigh-levelconceptstotechnicalobjectsinlaterstages.
Recommendation: Buildingadecisionmodelisaniterativeprocess.Donotwaitfortoomanyprerequisites(e.g.propercentraltaxonomy)tostartmodeling.Ratheruseacollaborativeapproachthatinvolvestherightpeople.
3.6WhentouseKnowledgeSources
Manydecisionsaredrivenbyexternalregulationandinternalcompliancepolicies.Earlycollectionoftheregulatoryrequirementsanddependenciesonpoliciesearlyonhelpscreateameaningfuldecisionmodel.
Aquestionoftenaskedwhethertonametheentireregulation/policyortodirectlypointtoaspecificchapter/section/paragraphwithinsuchadocument.Organizationsfrequentlyconnecttheirdecisionslogicwiththeproperregulations.
Recommendation:Useknowledgesourcestolisttherelevantdependenciesoninternalpoliciesorexternalregulation.
3.7WhentouseBusinessKnowledgeModels
ReuseofdecisionsisoneofthestrengthsofDMN.ManyDMNdiagramscontainsubdecisionswhicharespecifiedinadifferentDMNdiagram.Thequestion/answersandthedependenciesonsubdecisions,knowledgesources,inputobjectsanddecisionlogicareinheritedfromtheotherDMNdiagram.
DMNoffersyetanotherreusabilitymechanism,whichwehavenottalkedaboutsofar.The“businessknowledgemodel”representsreusabledecisionlogic.
BusinessKnowledgeisusedwheretwodecisionssharethesamedecisionlogic,butdependondifferentsubdecisionsandondifferentinputobjects,i.e.differentvariables.Inthiscase,businessknowledge modelscanbeusedtocreateacentraldefinitionofthedecisionlogicwhichcanthenbe“invoked”by twodifferentdecisions.
Reusabledecisions(sameinputobjects,samedependencyonsubdecisions,samedecisionlogic)iscommon,reusabledecisionlogicwithdifferentinputobjects/subdecisionsisrare.Thedecisionlogicembeddedinadecisionmodelcanbereusableacrossmodels.AnalternatetotheBusinessKnowl-edgeistoconnecttotheembeddeddecisiontable.
Page 14 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
4.WorkingwithDecisionTables
Acolleagueofyourssendsyouanemailabouthowdiscountsarecalculatedforcustomers:
› Adultswhoarenotmarriedgeta10%discount.
› Ifyouaremarried,yougetatleasta20%discount.
› Ifyouhavekids,youevengeta30%discount.
Accordingtothisdescription,thedecisiondependsonthefollowinginputs:Age(adult/child),maritalstatus(married/notmarried),parentalstatus(kids/nokids).
DecisiontablesarethenotationofchoicetospecifydecisionlogicinDMN.Whendirectlytranslatingtherulesfromtheexample,Figure6showstheresultingdecisiontable.
Whenstartingtodevelopthe‘rules’orlogicforthesewordproblems,youshoulddiscernwhatinputswillsettlethequestionsposedbythedecision.Inthiscaseourquestionis‘Whatdiscountshould wegivetoourcustomer’.Inourassignmentofoutput,wecanseethatitshouldbepossibletocreatearuleforeachcombinationoftheinputs.Inthisanalysiswedecideonthewaytherulesareevalu-atedinadecisiontable.Forinstance,theremightbearestrictionthatonlyonerowinthetablewillreturnanoutputresult.Thisisknownasa‘Uniquehit’policy.Thatsaid,theteamhasnotarticulatedalltherulecombinations.Asaruleanalyst,youhavetheoptionofexplicitlyaskingforthedesiredruleoutputforallthecombinations,oryoucanhavethecolleaguesdeveloptherules,basedonananalysisofthewrittenrequirements.Frequently,thelatteranalysisishoworganizationsdeveloptheirlogic.
Figure6Decisiontablewitherrors:incompletenessandoverlappingrules,thisisapartialeffort
Wherethereisnoentryinaninputcell,thereisanimplicit‘wildcard’thatmatchesanyvalue.Forinstance,rule2matchesanypersonwithamaritalstatusof“Married”.Thereareseveralerrorsoroverlapsinthisdecisionlogic.ThedecisionlogicverificationfunctionalityofSignavioidentifiesthefollowingproblems:
› Thefollowingcombinationsofinputvaluesarenotcoveredbyanyrule(Age=Child,Maritalstatus=Notmarried,Parentalstatus=Nokids)
› UniquehitpolicyviolatedforRule1and3,thesecombinationsofinputvaluesarecoveredbymorethanonerule:(Age=Adult,Maritalstatus=Notmarried,Parentalstatus=Kids)
› UniquehitpolicyviolatedforRule2and3,thesecombinationsofinputvaluesarecoveredbymorethanonerule:(Maritalstatus=Married,Parentalstatus=Kids)
Page 15 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Becauseweareseekingtocreatea‘unique’policyfortherulesinthetables,thesestatementssuggestthisdecisiontableis“incomplete”(error1).Also,thereareinputcombinationsthatarecoveredbyseveralrulesinthedecisiontable(errors2and3).
Decisiontablesarenotrequiredtobecompleteorgapfree:Inadiscountcalculationexample,aninputvaluecombinationthatisnotcoveredbyanyrulecouldeasilybeinterpretedas“nodiscount”.Overlappingrulesarepermitted,iftheyallhavethesameoutput,orifthereisacertainpriorityconfiguredforwhichofthematchingrulesactuallyapplies.YoucanconfigureaDMNdecisiontableregardingcompletenessandhitpolicy.
ThehitpolicyinaDMNDecisionTablespecifieshowthetheresultofthedecisiontablewillbeevalu-atedwheretherearemultiplematchesforagivensetofinputs.Thehitpolicycontainsadditionalinformationthatcanbeusedtocheckcorrectnessofdecisiontableatdesign-time.
4.1CompleteorIncomplete?
Inourexample,thereisnoruleforchildrenwhoarenotmarriedandwhodonothavekids.AccordingtotheDMNstandard,thisisan“incomplete”decisiontable.Thesimpleresolutionforthisexamplewouldbetoaddanotherruleforexactlythiscase.Thiswouldturnitintoacompletedecisiontable.
Completenessisonlypossibleifthevaluedomainsforallinputsareknown.Inourexample,thisisthecase:eachinputhasavaluedomainconsistingoftwovalues.
Recommendation: Usecompletedecisiontables,wheneverpossible.Thisavoidsmisunderstandingsaboutthedecisionlogic.
4.2ChoosingtherightHitPolicy
Hitpoliciesandtheproblemwearesolvingdeterminethesemanticsofadecisiontable.Theyalsoimposerequirementsonhowrulesmustbestructured.Theconditionsofthebusinessrulesalsocandictatethehitpolicyandtheruleswithinthetable.
Hitpolicy Description Application
Unique (single) Onlyoneruleisallowedtofireforanyonecombi-nationofinputs.
Inthiscontext,allinputsareassumedtobeindepen-dentlypartitionedfromeachother,i.e.thatanycombinationisactuallypossible.Forourexample,itisassumedthatchildrencanalsobemarried.
OurexampledecisiontableviolatestheUniquerequirement,astherearerulesthatoverlap.
Unique(single)isthedefaultintheDMNstandard.
Whereauniformpolicyisrequiredforthecombinationofinputs
Page 16 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Any (single) Multiplerulescoverthesamecombinationofinputvalues.However,thisoverlapisonlyallowediftheoverlappingruleshavethesameoutput.
Figure2showsavalidexampleofadecisiontablewithhitpolicyAny.
Adiagnosisofamedicalcon-ditionoftheortheoutputoflabresultsmightneedanAny’policyifvariousrangesofsimilardiagnostictestidentifythesamecondition
Priority (single) Rulescanoverlapwithdifferentoutputs.
Inordertodeterminetheresultingoutput,outputsareorderedaccordingtopriority(e.g.thehighestdiscountwins).
Priorityrulesresolve‘race’conditions,suchasevaluatingtheweightedscoresofvariouspriorities.
First (single) Rulesmightoverlap.Butonlyonerulefires:TheFirsthitpolicysimplyassumesanorderingoftherules–theyareevaluatedfromtoptobottom.Assoonasonerulefires,theoutputofthatruleisusedasresultofthedecision.Onceonerulehits,nootherruleischecked.
Wheninterpretingourexampledecisiontableusingthefirsthitsemantics,adultswhoarenotmarriedbuthavekids,wouldonlyget10%discount(insteadof30%).
No Order (multi)
Multiplerulescanfirewithoutanexplicitorder.Multihittableseitherreturnasetoraggregatethefinalresultsofthedecisions.DMN’sdefaultisprovidethesetofoutputvaluesasresult.Inourexamplethiswouldbe{10%,30%}fornotmarriedadultswithkids.Multi-ruletablecanapplyaggre-gationfunctionssuchasmin,max,avgtoderiveasinglevaluefromasetofoutputvalues.
Multihitpoliciesaregoodforscorecardsthataccumulateformatchinginputs.Forinstancetheconditionofaninspecteditemmightbebasedonmulti-plechecksandwithpointsoffforvariousdefects.
Table4themostrelevantDMNhitpolicies
Allofthesehitpolicies(exceptfortheFirsthitpolicy)aredeclarativeinnature,i.e.theorderingoftherulesdoesnothaveanysemantics.TheFirsthitpolicyisnotdeclarative,butprocedural.Thishit policymightbeusedbypeoplewithatechnicalbackground(whereifthenelsestatementsarealsoevaluatedinaparticularorder),butitiscountertothedeclarativenatureofDMN.
Recommendation: Ifyouareunsureofthehitpolicy,startwiththeUniquehitpolicy.Thisforces youtodefinerulesthatdonotoverlapeachother.Asshownabove,someapplicationsneedoverlap-pingandadditiverules.Makecertaintherulesspecifythedesiredresults.Insomecases,the“Any” hitpolicyleadstomorecompactandmoreeasilyunderstandabledecisiontables.Donotusethe“Firsthit”policyandtrytoavoidthePriorityhitpolicy.Multihitistypicallyonlynecessaryforcertainscoringandcalculationscenarios.
Page 17 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
4.3FromDecisionTreestoDecisionTables
Decisiontablesareequivalenttodecisiongraphs(andviceversa).Itisalmostascommontousedecisiontreestodescribingdecisionlogicasitistouseworkflowdiagrams.
Youreturntotheteamtodiscussyourfindingsregardingincompletenessandthemissingrules.Obviously,therehasbeensomemisunderstanding.Toresolvethis,yourcolleaguedrawsasmallflowcharttoclarifythesemanticsofthediscountcalculation.
Figure7:BPMNdiagramusedasdecisiontree
BPMNwasusedtodrawthisdecisiontree.BPMNisnotmeanttobeusedformodelingdecisionlogic.AnupcomingversionofDMNwillmostlikelyincludegraphicaldecisiontreesasanalternativenotationofdecisionlogic.
Decisiontreescanveryeasilybetranslatedintodecisiontables.Eachdecisionnodefromadecisiontreeistranslatedintoacolumninthedecisiontable.Then,thetableisfilledfromlefttoright.
Page 18 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
Figure8Decisiontable(Unique,complete)derivedfromdecisiontree
Whenadecisiontreeistranslatedintoadecisiontable,theresultingdecisiontableautomaticallyfulfillstheUniquenessrequirement.Thecompletenessrequirementisalsofulfilledifeachdecisionnodesofthetreecoversthecompletevaluedomainofthecorrespondinginput.
Recommendation: DonotencodedecisionlogicinBPMNdiagrams.UseDMNdecisiontablesinstead.
4.4FromCheckListstoDecisionTables:ThecaseofUniquevs.Anyvs.First
Let’sassumethatapurchaseordercanbeacceptedif
› avalidquotationnumberisreferenced,
› thepricingmatchesthequote,
› allrequireditemsareincludedintheorder,and
› thequotationhasnotexpiredyet.
Thedecisionlogicbehindthischecklistis:Ifallconditionsaremet,thenthepurchaseorderis“acceptable”.Ifatleastoneconditionisnotmet,thepurchaseorderis“notacceptable”.
Translatingthisexampleusingfirsthitsemanticsleadstothedecisiontableinfigure9.
Figure9Firsthitdecisiontablederivedfromchecklist
Page 19 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
ThisexamplecaneasilybetranslatedintoanAnyhitdecisiontableandaUniquehitdecisiontable,whichisillustratedinfigures10and11.
Figure10Anyhitdecisiontablederivedfromchecklist
Figure11Uniquehitdecisiontablederivedfromchecklist
ThebigdifferencebetweentheFirsthittableandtheothertwoisthattheFirsthittableisconsider-ablysmaller.Thesecondrulefiresforallinputcombinations,servingasa“catchall”rule.
TheAnyhittablehasoneruleforeveryinput,coveringallnegativecasesforthatinput.
TheUniquehittablehasastructurelikeifitwasderivedfromadecisiontree(seeabove).Therequire-mentthattherulesmustnotoverlap,makesthedecisiontableappearmorecomplicatedthantheAnyhitdecisiontable.
Ingeneral,decisiontablesarenotthemostintuitivewayofrepresentingasimplechecklist.Decisiontablesarethebusinessuser-friendlyoptionwehaveinDMN.
Recommendation:Use“Any”hittablestorepresentchecklist-likescenarios.
Page 20 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
4.5FromInputObjectstoInputExpressions
Intheprevioussectionwehavebrieflytouchedonthequestionofsimpletypesvs.complexobjects.WhenrelatingDMNdiagramstodecisiontables,thisisoneofthecentralquestions.
Inputstodecisiontablesmustalwaysbeasimpletype.Table5showsalistoftypicalexamplesforsimpletypes.
Type Example Operators Description
Boolean Valididentification={true,false}
=(equals) Trueorfalse.
Enumeration of values
CurrencyofTrade={EUR,USD,CHF,GBP,…}
=(equals)≠(notequals)∈(elementof)∉(notelementof)
Listofvalues.
Number Requestedamount=USDdollaramountwith2decimals
=(equals)<>(less,greater)∈(inrange)
Numberwithunit.
Text (String) ProductID ∋(contains)∌(notcontains)*T(startswith)T*(endswith)
Mostlyusedfordataaccep-tance/validationtesting.
Table5Simpletypes
Asdiscussedabove,inputobjectsinDMNdiagramscaneitherbesimpletypesorcomplexobjects.Inthecaseofsimpletypes,theinputvalueispasseddirectlyintothedecisiontable(e.g.AUM).Inthecaseofacomplexobject,oneormanyfieldsmustbechosenwhicharesimpletypes(e.g.Customer.age,Location.state).
Sometimes,complexobjectsmaptotechnicalobjects(e.g.JavaclassCustomer).Inothercases,complexobjectsareonlyaconvenientgroupingforbusinesslevel-modelingandonlythefieldsareactuallymappedtotechnicaldatastructures.
Whendevelopingbusinessrules,itisbesttouseasmanywelldefinedlists(enumerations)andnumberranges.Listsandnumberrangescanprovideawiderangeofchoiceindetailingbusinessrules.Inadditiontheserulescanbecheckedforuniquenessandcompleteness.
Recommendation: AvoidusingsimpletypeText,asitdoesnotallowforsophisticatedcompletenessandoverlappingrulesanalysis.Applyenumerationsandnumbersasmuchaspossible.
Page 21 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
5.Conclusion
This“quickstart”setoutthecoreelementsoftheDecisionModelandNotationstandard—decisions,inputdata,knowledgesources,andbusinessknowledgemodels.Theseelementscanbecombinedintodecisionrequirementsdiagramstodescribethedecisionmaking.
Decisionrequirementsdiagramscanspecifyhowdecisionsinaprocessshouldbemade.Theycanalsospecifythelogicsrequirementsfordecisionautomationusingadecisiontable.TheDRDbreaksdowndecisionmakingintoitscomponentpiecesforclarity.Theyshowwhatinformationisrequiredforeachpartofthedecision,aswellaswheretherules,guidelines,policies,andknow-howtomakethedecisioncorrectlycanbefound.
Decisionmodelingisarelativelynewapproachformostorganizations.Thiswhitepaperprovidesthe toolsforuserstoreaddecisionmodelsandrepresentdecisionmodelsinastandardwayasdecisionmodelingisdevelopedasadisciplinealongsideprocessmodeling.Knowingthenotationfordecisionmodelsisnecessaryfordecisionmodeling,butjustaswithprocessmodeling,thenotationisnotamethodology,anddevelopingeffectivemodelswilllikelytakepracticeandtraining.
Wealsosetoutthelogicelementsofadecisionmodel,especiallythedecisiontable.Logicelementscanbecombinedintodecisionrequirementsdiagramstodescribepreciselyhowadecisioncan beexecuted.Thatis,diagramscanbeextendedwithdecisionlogictoformacompletedefinitionofexactlyhowthebusinesswishestomakeadecision.
TheSignavioProcessManagersupportstheDMNmodelingdescribedhere.Itcreatesacompre-hensiveenvironmentforcollaboratingonthediscovery,managementandimprovementofyourdecisions.WiththeProcessManager,decisionscanbereusedacrossotherdecisionsandtheycanevenbeconnectedwiththeprocessestheydrive.ProcessManagerempowersthepeopleinyourorganizationthatmustmanageeventhemostcomplexdecision.
Page 22 of 22Quick Guide to Decision Modeling using DMN 1.0 – Signavio, Inc., April 2015
6. Contact
Publisher
Signavio GmbH
Germany
www.signavio.com
Worldwide business transformation!
Discover more great DOWNLOADS