API Dev Guide
API Dev Guide
6.5
This document is the confidential, unpublished property of Fair Isaac Corporation. Receipt or possession of it does not convey rights to divulge, reproduce, use, or allow others to use it except as expressly provided in the license agreement between user and Fair Isaac Corporation. The information in this document is subject to change without notice. If you find any problems in this documentation, please report them to us in writing. Fair Isaac Corporation does not warrant that this documentation is error-free, nor are there any other warranties with respect to the documentation except as may be provided in the license agreement. 2005-2008 Fair Isaac Corporation. All rights reserved. Fair Isaac is a registered trademark of Fair Isaac Corporation in the United States and may be a trademark or registered trademark of Fair Isaac Corporation in other countries. Other product and company names herein may be trademarks of their respective owners. Blaze Advisor business rules management system is covered by Fair Isaac U.S. Patents: 6865566, 6965889, 66968328, 6944604, and others listed in Fair Isaac documentation.
Product Name: Blaze Advisor 6.5 for Java - Service Pack 5 Last Revised 12/20/2007 Version 6.5 Template LG5.0
Contents
Contents
CHAPTER 1
TheRepositoryObjectModel(ROM)...................................................7 ConnectingtoaRepository.........................................................7 ExploringtheROMModel..........................................................8 RepositoryItemTypingAttributes...................................................8 ProjectRepositoryObjectModel(PROM) ...............................................9 ThePROMProject(NdPromProject) .................................................9 ExploringthePROMModel .......................................................10 PROMItemContent(NdPromItemContent) ............................................11 NdPromEntity(anditssubinterfaces)...............................................11 NdPromTemplate................................................................12 NdPromInstance.................................................................12 NdPromProvider .................................................................12 EntityObjectModel .................................................................12 AccessingEntityContent ..........................................................12 SRLEntityObjectModel ..........................................................14 RuleflowObjectModel ............................................................15 QuestionSetObjectModel.........................................................15 CommonROMAPIandPROMAPITasks .............................................15 SpecifyingaLocation(NdLocation) .................................................15 CreatingDirectories ..............................................................16 CreatingaPROMProject..........................................................17 LoadingaPROMProject ..........................................................18 CreatinganSRLRuleset ...........................................................18 CreatinganSRLFunction(NdPromSrlFunction)......................................20 CreatingaRuleflow(NdPromFlowRuleflow) ........................................21 CreatingaQuestionSet(NdPromAaiQuestionSet) ....................................22 CreatinganSRLClass(NdPromSrlClassContent) .....................................23 CreatinganSRLEnumeration(NdPromSrlEnumerationContent).......................24
CHAPTER 2
Metaphor APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
LoadingaMetaphorInstance.........................................................25 CreatingaMetaphorModel ..........................................................25 DecisionTableEditingAPI...........................................................26 Example:DisplayanOverviewofaDecisionTable ...................................28 DecisionTreeEditingAPI............................................................28 Example:CreateaSubtree.........................................................30 ScoreModelEditingAPI.............................................................31 Example:ListContentsofaScoreModel ............................................34
Contents
CHAPTER 3
ResponsibilitiesofProviderClasses.................................................... 37 OverviewoftheCustomProviderAPI ................................................. 38 NdTemplateValueProviderInterface............................................... 38 NdDefaultTemplateValueProvider ................................................. 39 NdConstrainedListProviderInterface............................................... 39 NdDefaultConstrainedListProvider................................................ 40 NdDesignProviderInterface ...................................................... 40 NdProvidesDefaultValueInterface ................................................. 41 CreatingCustomProviderClasses..................................................... 41 SimpleValueListProvider ........................................................ 42 SimpleSRLandDisplayListProvider.............................................. 43 CustomizingProviderBehaviorUsingArguments................................... 45 DefiningArgumentDescriptors................................................. 46 ProcessingArguments......................................................... 49 TheExampleBaseClass.............................................................. 50 CustomProviderImplementationGuidelines ........................................... 51
CHAPTER 4
TheRMARepository(NdRmaRepository) .............................................. 53 RMAProject(NdRmaProject) ..................................................... 54 RMAEntry(NdRmaEntry)........................................................... 56 RMADirectory(NdRmaDirectory).................................................... 57 RMAFiles.......................................................................... 57 File(NdRmaFile) ................................................................ 58 ProjectFile(NdRmaProject) ....................................................... 58 TemplateFile(NdRmaTemplateFile)............................................... 58 InstanceFile(NdRmaInstanceFile)................................................. 58 EditableFile(NdRmaEditableFile)................................................. 59 FileContent(NdRmaFileContent)..................................................... 59 RMATemplate(NdRmaTemplate) ................................................. 59 RMAInstance(NdRmaInstance) ................................................... 60 DisplayingtheContentsofanInstance........................................... 61 EditingtheContentsofanInstance.............................................. 61 InstanceElementNode(NdInstanceElementNode)...................................... 62 Versioning ......................................................................... 63 VersioningOperations(NdRmaEntryVersioningOperations).......................... 64 VersioningInformation(NdRmaEntryVersioningInfo)................................ 64 RMAQuery........................................................................ 65 QueryInstance(NdRmaQueryInstance) ............................................ 65 QueryResults(NdRmaQueryResultItem) ........................................... 66 EntryExclusionFilter(NdRmaEntryExclusionFilter) ..................................... 66
CHAPTER 5
Contents
CHAPTER 1
Connecting to a Repository
TheNdRomConnectionManagerinterfaceprovidesmethodstoconnectanddisconnect fromarepository.PassanNdWorkspaceConnectionobjecttothe newRepositoryConnectionManager()methodofNdRomFactorytoobtainan NdRomConnectionManagerinstance.Theconnectioncontext(NdRomConnectionContext) isusedtoaccessROMonceyouareconnected. Theexamplecodebelowshowshowtoobtainaconnectiontoafilebasedrepository.
//NdFileRepositoryConnection extends NdWorkspaceConnection NdFileRepositoryConnection connection = new NdFileRepositoryConnection(); // Change the path to the repository as appropriate. The repository should exist.
connection.setRepositoryFolder("C:/repository"); // Connect to repository NdRomConnectionManager connectionMgr = NdRomFactory.newRepositoryConnectionManager(connection); connectionMgr.connect(); NdRomConnectionContext conContext = connectionMgr.getConnectionContext(); NdRomDirectory romRoot = conContext.getRoot();
Decision Tree Template: SRL ruleset, Decision tree, Template, SRL Decision Tree Instance: SRL ruleset, Decision tree, Instance, SRL Ruleset Template Instance: SRL Ruleset, No subtype, Instance, SRL SRL Class: SRL Class, No subtype, Fixed, SRL SRL Function with Fixed Content: Function, No subtype, Fixed, SRL Custom Date Provider: Date, No subtype, Provider, SRL Project: Project, No subtype, Fixed, Repository
Theintegerconstantsfortherepositoryschematypingattributes,includingthoseinthe codeabove,aredeclaredintheNdRomSchemaConstantsinterface.
ThetopicsofloadingandcreatingaprojectarediscussedingreaterdetailinLoadinga PROMProjectonpage18andCreatingaPROMProjectonpage17.
NdPromProjectonlydefinesascope.Itisnotspecifictoanydomain.Ithasa subinterfaceNdPromRulesProject,whichcanprovideadditionalinformationand servicesspecifictotherulesdomain.
10
Hereisanexampleofcreatingarepositoryitemandaddingittoaprojectdirectory.
// project is an NdPromProject NdLocation location = NdLocationFactory.createLocation(directory); NdPromDirectory directory = (NdPromDirectory)project.lookupEntry(location); NdPromItem item = factory.newItem(content, project); directory.addItem(item); item.save();
11
MoredetailsoftheentityAPIcanbefoundinEntityObjectModelonpage12.
NdPromTemplate
IfthecontentoftherepositoryitemisanInnovatortemplateofanentity,thecontent objectmustbeanNdPromTemplateobject.NdPromTemplategivestheclientaccesstothe templatizedentitythroughgetEntityContent()method,whichreturnsaspecific instanceofNdPromEntityContent.Forexample,ifthecontentoftherepositoryitemis anInnovatortemplateofanSRLruleset,getEntityContent()methodreturnsan instanceofNdPromSrlRulesetContent,whichextendsNdPromEntityContent.
NdPromInstance
Ifthecontentoftherepositoryitemisaninstanceoftemplate,thecontentobjectmustbe anNdPromInstanceobject.NdPromInstancegivestheclientaccesstotheinstantiation objectmodel,i.e.,atreeofinstancenodes.Itallowsaccesstotheentityresolvedfrom thisinstanceanditslinkedtemplate.Theresolvedentitycanbeobtainedthrough getResolvedEntity()method,whichreturnsaspecificinstanceofNdPromEntity.For example,ifthecontentoftherepositoryitemisanInnovatorinstanceofanSRLruleset, getResolvedEntity()returnsaninstanceofNdPromSrlRuleset,whichextends NdPromEntity.
NdPromProvider
Ifthecontentoftherepositoryitemisaprovider,thecontentobjectmustbean NdPromProviderobject.NdPromProvidergivesclientaccesstotheprovidersdefinition, includingtheproviderclassname.
12
placeholders.ThesubinterfacesofNdPromTextContentrepresentspecializedtext content.Forexample,thebodyofanSRLfunctionisrepresentedby NdPromSrlBodyTextContent.ThecontentbasedAPIisusedtoaccesstemplatized entities.Itprovidesmethodstoreadandwritethecontentofbothtemplatizedand fixedcontententities. ThesetwosetsofAPIsarealmostparalleltoeachother.Thenamingconventionisthat theinterfacenamesandmethodnamesinthecontentbasedAPIhavethewordContent appendedtotheircounterpartsinthestringbasedAPI.Forexample,thecontentbased counterparttothestringbasedinterfaceNdPromSRLRulesetis NdPromSRLRulesetContent.NdPromSrlRuleisthestringbasedcorrelaryto NdPromSrlRuleContent,andsoon. Thefollowingcodedemonstrateshowtoaccessarulesetusingstringbasedinterfaces. ArulesetisrepresentedbythestringbasedNdPromSrlRulesetinterface.Themethod getName()returnstherulesetnameasaString.
// item is an NdPromItem NdPromSrlRuleset ruleset = (NdPromSrlRuleset) item.getItemContent(); String name = ruleset.getName();
ThegetSrlRulesetItems()methodreturnstherulesetitemsasanarrayof NdPromSrlRulesetItem.
NdPromSrlRulesetItem[] items = ruleset.getSrlRulesetItems();
Therulebody(NdPromSrlRuleBody)isobtainedfromaruleinarulesetthatisnot templatizedusingthegetSrlRuleBody()method.
NdPromSrlRuleBody ruleBody = rule.getSrlRuleBody();
Asalreadymentioned,thecontentbasedAPIcontainsmethodsforcreatingand modifyingtheentitycontent.UsethestaticnewTextContent()methodofthe
13
NdPromTextContentFactoryclasstocreateNdPromTextContentfortextbasedentity propertiessuchasnameandcomment.
ruleset.setNameContent (NdPromTextContentFactory.newTextContent("Ruleset name"); rule.setNameContent (NdPromTextContentFactory.newTextContent("Rule name"); rule.setCommentContent (NdPromTextContentFactory.newTextContent("// Sample rule");
interfacesfortheSRLentitiesaswellasvariousconstructsliketheexpressionsand statements. TheSRLentitiesinclude: SRLruleset(NdPromSrlRuleset) Therulesetitemswithinaruleset(NdPromSrlRulesetItem),whichare: SRLrule(NdPromSrlRule) SRLeventrule(NdPromSrlEventRule) SRLnamedobject(NdPromSrlNamedObject) SRLpattern(NdPromSrlPattern) SRLvariable(NdPromSrlVariable) SRLfunction(NdPromSrlFunction)
14
Foranexampleofhowtocreatearuleflow,seeCreatingaRuleflow (NdPromFlowRuleflow)onpage21.
15
Thesemethodcallsarealsoequivalent.TheycreateanNdLocationthatisanabsolute location.
// projectFactory is an NdPromProjectFactory NdPromProject project = projectFactory.createProject(NdLocationFactory.createLocation( new String[]{"PROM API Example", "Entity Creation"}, true)); NdPromProject project = projectFactory.createProject(NdLocationFactory.createLocation( "/PROM API Example/Entity Creation"));
InthefirstmethodcallthecomponentsareelementsinaStringarray.Thelatter methodcallrepresentsthecomponentsinaString.Theleading/characterindicates thatthelocationisabsolute. Whetheryoushouldspecifythelocationasabsoluteorrelativewilldependonthetask athand.Asmentioned,relativelocationsareprocessedinthecontextofanother location.Whenadirectoryiscreatedthelocationisprocessedinthecontextofaparent directoryortherootoftherepository.Forthisreason,youmustusearelativelocation whencreatedadirectory.Whenlookinguparepositoryitemordirectoryinaproject usingthelookupEntry()methodoftheNdPromProjectinterface,thelocationisrelative sincetheprojectprovidesthecontext.ThelookupEntry()methodofthe NdRomDirectoryinterface,however,looksuptheentryfromtherootoftherespository whenthesuppliedlocationisabsolute.Ifthelocationisrelativethelookupisperformed fromthedirectory.TheNdPromProjectinterfaceaddDirectory()method,whichisused toaddadirectorytotheproject,requiresanabsolutelocation.TheBlazeAdvisorAPI ReferenceentryforeachmethodthattakesanNdLocationparameterspecifieswhetherto useanabsoluteorarelativelocation.
Creating Directories
YoucancreatedirectorieswiththecreateDirectory()methodofthe NdRomMutableDirectoryclass.NdRomMutableDirectoryisarepositorydirectorythatis mutable.NdRomMutableDirectoryextendsNdRomDirectory.Amutabledirectoryallows entriestobeaddedordeleted.Recallthatadirectorycontainsentries,whichareeither otherdirectoriesorrepositoryitems.NdRomMutableDirectoryhasmethodsforcreating both.ThedeleteEntry()methodphysicallydeletesthegivenrepositoryentryfromthe directory.
NdRomDirectory createDirectory(NdLocation location) NdRomItem createItem(NdLocation location)
16
Tocreateadirectoryundertherepositoryrootdirectory,obtaintheroot NdRomDirectorybycallinggetRoot()ontherepositorycontextobject (NdRomConnectionContext).CallcreateDirectory()ontherootdirectorywiththe NdLocationparameterthatspecfiesthelocationofthenewdirectory.Wheneveryou createadirectory,thelocationmustberelativeandcontainonlyoneelementinthe Stringarray.TheabsoluteparametertocreateLocation()isfalsewhenthelocation isrelative.AnewdirectoryisalwayscreatedwiththeNdRomMutableDirectoryobjectof theparentdirectoryandthereforethelocationisrelativetotheparentdirectory.See SpecifyingaLocation(NdLocation)onpage15fordiscussionofrelativeandabsolute locations.
// conContext is an NdRomConnectionContext NdRomDirectory romRoot = conContext.getRoot(); NdLocation topDirectoryLocation = NdLocationFactory.createLocation( new String[]{"Prom API Example"}, false);
NdRomDirectory topDirectory = ((NdRomMutableDirectory) romRoot).createDirectory(topDirectoryLocation);
AddthedirectorytoaPROMprojectandobtainanNdPromDirectory.
// project is an NdPromProject NdPromDirectory projectDirectory = project.addDirectory(entityCreationDirectory.getLocation());
Thenextsection,CreatingaPROMProjectonpage17,completesthediscussionof creatingadirectorystructureforyourproject.
17
// Create a PROM project in the "Entity Creation" directory // conContext is an NdRomConnectionContext // entityCreationDirectory is an NdRomDirectory NdPromProjectFactory projectFactory = conContext.getProjectFactory(); NdPromProject project = projectFactory.createProject(NdLocationFactory.createLocation( new String[]{"Prom API Example", "Entity Creation"}, true)); project.setDisplayName("Entity Creation"); // Add directory to project NdPromDirectory projectDirectory = project.addDirectory(entityCreationDirectory.getLocation());
18
TheexampleinthissectioncreatesafixedcontentSRLruleset.ThepublicPROMAPIs inthecurrentreleaseofBlazeAdvisordonotsupportcreatingtemplatizedcontent. TheNdPromSrlConstructContentFactorymethodnewSrlRulesetContent()isusedto createaruleset,whichisanNdPromSrlRulesetContentobject.Amongthemethods availableinNdPromSrlRulesetContentaresetNameContent(),setCommentContent(), andinsertSrlRulesetItemContentAt().Thelatermethodisusedtoaddtheruleset itemstotheruleset. Rulesetitems(NdPromSrlRulesetItem)arecontainedwithinaruleset.Arulesetisa repositoryitem,butrulesetitemsarenotrepositoryitems.Thetwosensesofthetermitem shouldnotconfused.Thecontentofrulesetitemsarerepresentedbythe NdPromSrlRulesetItemContentinterfaceandincludeSRLrule (NdPromSrlRuleContent),SRLnamedobject(NdPromSrlNamedObjectContent),SRL pattern(NdPromSrlPatternContent),SRLeventrule(NdPromSrlEventRuleContent),and SRLvariable(NdPromSrlVariableContent). Creatingarulesetandrulesetitemsfollowsthegeneralpatternofcreatingtheruleset withtherewSrlRulesetContent()ofNdPromSrlConstructContentFactoryinterface; creatingeachrulesetitemwiththeappropriateNdPromSrlConstructContentFactory method;creatingthecontentfortherulesetitem,usuallywithmethodsof NdPromSrlConstructContentFactoryandNdPromTextContentFactory;settingthe contentontherulesetitem;andtheninsertingtherulesetitemintotherulesetand savingtheruleset. AruleiscreatedwiththenewSrlRuleContent()methodofthe NdPromSrlConstructContentFactoryinterface.ThenewTextContent()and newSrlRuleBodyContent()methodsoftheNdPromTextContentFactoryinterfaceare usedtocreatecontentfortherulenameandrulebody,respectively.Aftersettingthe contentontherule,theruleisaddedtotherulesetwiththerulesets insertSrlRulesetItemContentAt()method. BothNdPromPattern(apattern)andNdPromParameter(aparameter)extendthe NdPromSrlTypedContentinterfaceandcontaintypedcontent.Typedcontentcanbea simpletypereferencetoaprimitivetype,aclass,oranenumeration.Typedcontentis obtainedwiththeNdPromSrlConstructContentFactoryinterface newSrlGenericTypeContent()method.Thetypedcontentissetonthepatternwith setSrlGenericTypeContent()methodwhichisinheritedfrom NdPromSrlTypedContent.Theexamplecodeshowshowtosetacollectionanda constraintonapattern.
// project is an NdPromProject // Create 'Cross-sell' ruleset, with rule and two patterns, in 'Cross-sell Rules' directory NdPromSrlRulesetContent ruleset = NdPromSrlConstructContentFactory.newSrlRulesetContent(project); ruleset.setNameContent(NdPromTextContentFactory.newTextContent("crossSell")); // Create 'rule1' rule NdPromSrlRuleContent rule = NdPromSrlConstructContentFactory.newSrlRuleContent(project); // set rule name rule.setNameContent(NdPromTextContentFactory.newTextContent("rule1")); // set rule body String ruleBodyString = "if boughtProducts.primaryDemographic = promoProducts.primaryDemographic \n" + "then { \n" +
19
"shopper.recommendedProducts.append(promoProducts),\n ignore(boughtProducts).\n}"; NdPromSrlRuleBodyTextContent ruleBody = NdPromSrlConstructContentFactory.newSrlRuleBodyContent(ruleBodyString); rule.setSrlRuleBodyContent(ruleBody); // A rule is a ruleset item (NdPromSrlRuleContent extends NdPromSrlRulesetItemContent) ruleset.insertSrlRulesetItemContentAt(rule, 0); // Add 'shopper' parameter to ruleset NdPromSrlParameterContent parameter = NdPromSrlConstructContentFactory.newSrlParameterContent(); parameter.setNameContent(NdPromTextContentFactory.newTextContent("shopper")); NdPromSrlGenericTypeContent parameterType = NdPromSrlConstructContentFactory.newSrlGenericTypeContent("Shopper"); parameter.setSrlGenericTypeContent(parameterType); ruleset.insertSrlParameterContentAt(parameter,0); // Create 'boughtProducts' pattern NdPromSrlPatternContent boughtPattern = NdPromSrlConstructContentFactory.newSrlPatternContent(project); boughtPattern.setNameContent(NdPromTextContentFactory.newTextContent("boughtProducts")); NdPromSrlGenericTypeContent patternType = NdPromSrlConstructContentFactory.newSrlGenericTypeContent("Product"); boughtPattern.setSrlGenericTypeContent(patternType); // set collection NdPromSrlCollectionTextContent collection = NdPromSrlConstructContentFactory.newSrlCollectionContent("shopper.purchasedProducts"); boughtPattern.setSrlCollectionContent(collection); // A pattern is a ruleset item (NdPromSrlPatternContent extends NdPromSrlRulesetItemContent) ruleset.insertSrlRulesetItemContentAt(boughtPattern, 0); // Create 'promoProducts' pattern NdPromSrlPatternContent promoPattern = NdPromSrlConstructContentFactory.newSrlPatternContent(project); promoPattern.setNameContent(NdPromTextContentFactory.newTextContent("promoProducts")); //set the type NdPromSrlGenericTypeContent patternType1 = NdPromSrlConstructContentFactory.newSrlGenericTypeContent("Product"); promoPattern.setSrlGenericTypeContent(patternType1); //set the constraint NdPromSrlConstraintTextContent constraint = NdPromSrlConstructContentFactory.newSrlConstraintContent("promotion = true"); promoPattern.setSrlConstraintContent(constraint); ruleset.insertSrlRulesetItemContentAt(promoPattern, 1); // Create NdPromItem for the ruleset, add to a PROM directory and save. // schemaManager is an NdRomSchemaManager NdRomSchemaElement schemaElement = schemaManager.lookupSchemaElement(TYPE_SRL_RULESET, SUB_TYPE_NONE, CONTENT_TYPE_FIXED, TARGET_SRL); NdPromItemFactory rulesetFactory = schemaElement.getItemFactory(); NdPromItem rulesetItem = rulesetFactory.newItem((NdPromItemContent)ruleset, project); // crossSellDiretory is an NdPromDirectory crossSellDirectory.addItem(rulesetItem); rulesetItem.save(); // project is an NdPromProject project.save();
20
21
22
NdPromAaiConstructContentFactory.newAaiQuestionContent(); question.setPromptContent( NdPromTextContentFactory.newTextContent("What is the driver's age?")); NdPromAaiClassPropertyContent classProperty = question.getAaiClassPropertyContent(); classProperty.setClassNameContent( NdPromTextContentFactory.newTextContent("Driver")); classProperty.setPropertyNameContent( NdPromTextContentFactory.newTextContent("age")); questionSet.insertAaiQuestionContentAt(question, 0); schemaManager = project.getRomConnectionContext().getSchemaManager(); schemaElement = schemaManager.lookupSchemaElement(TYPE_QUESTION_SET, SUB_TYPE_NONE, CONTENT_TYPE_FIXED, TARGET_SRL); NdPromItemFactory factory = schemaElement.getItemFactory(); NdPromItem item = factory.newItem((NdPromAaiQuestionSet) questionSet, project); testDirectory.addItem(item); item.save();
23
CONTENT_TYPE_FIXED, TARGET_SRL); factory = schemaElement.getItemFactory(); NdPromItem classItem = factory.newItem((NdPromEntity)classContent, project); targetDirectory.addItem(classItem); classItem.save();
24
CHAPTER 2
Metaphor APIs
TheMetaphorAPIsprovideprogramaticaccesstotheBlazeAdvisormetaphors: decisiontable,decisiontree,andscoremodel.TheAPIsenableyoutoexamineandedit thecontentsofmetaphorinstancesaswellascreatenewinstances.Thischapter providesanintroductiontosomeofthosecapabilities.ConsulttheBlazeAdvisorAPI Referenceformoredetailedinformation.TheAPIReferenceisavailablebyselectingAPI ReferencefromtheBuilder Helpmenu.
25
NdDecTableModelFactory.createDecTableModel()
Createsanewinstanceofadecisiontablemodel,returnedasanNdDecTableModel.
NdDecTreeModelFactory.createDecTreeModel()
Createsanewinstanceofadecisiontreemodel,returnedasanNdDecTreeModel.
NdScoreModelModelFactory.createScoreModelModel()
Createsanewinstanceofascoremodel,returnedasanNdScoreModelModel. Eachfactoryclasshasamethodtosettheinstantiationelementonthemodel. Foradecisiontable,calltheNdDecTableModelFactory.setDecTableInstance() method. Foradecisiontree,calltheNdDecTreeModelFactory.setDecTreeInstance() method. Forascoremodel,calltheNdScoreModelModelFactory.setScoreModelInstance() method. ThemethodsabovemaythrowanNdMetaphorModelExceptionintheeventsomething iswrongwiththeinstanceandcannotbecorrected.Thisisaterminalerror,andwill preventthemetaphormodelfromusingthemetaphorinstance.Thesemethodsmay alsothrowanNdMetaphorWarningExceptionincaseanerroneoussituationwasfound, butcouldbecorrected.ANdMetaphorModifiedExceptionisthrownwhenthemetaphor instancewasmodifiedbythemetaphormodeltofixpossibleproblems.Thiswould happen,forexample,ifthemetaphortemplatewaschanged. ThedecisiontablemodelinstancedecTableModelinthecodebelowisusedtoeditthe decisiontable,asdescribedinthefollowingsection,DecisionTableEditingAPIon page26.Similarcodeisusedtocreatedecisiontreeandscoremodelinstances.These modelsarediscussedinDecisionTreeEditingAPIonpage28andScoreModel EditingAPIonpage31.
if (NdMetaphorSupport.isDecisionTableInstance(instanceElt)) { NdDecTableModel decTableModel = NdDecTableModelFactory.createDecTableModel(); NdDecTableModelFactory.setDecTableInstance(decTableModel, instanceElt); }
26
ThegetCellFieldValue()methodreturnsacellsfieldvalueandsetCellFieldValue() setsthefieldvalueofthecell.ANdMetaphorModelExceptionisthrownifthevalueisnot oftheappropriatetype.Forexample,theexceptionisthrownifavaluethatisnota numberisusedinacellthathasacelltemplatedisplaynamethatspecifiesanumber, suchas= 'integer'. SeveralofthemethodsinNdDecTableModelaccesscellsinadecisiontablebyrowand columncoordinates.NdDecTableCellCoordinatesrepresentsthecoordinatesofacell. Thisstatementsetsthefieldvalueofthecellatrow2,col3inadecisiontable.Thecell templateforthiscellis= string,whichhasonlyoneplaceholder.Theindexofthe placeholder,orfield,withinthecellis0.
decTableModel.setCellFieldValue(new NdDecTableCellValue(2, 3), 0, "Medical");
method,whichobtainsthelistofallowedcelltemplatedisplaynamesforthecell.The
getCurrentCellTemplateDisplayName()methodofNdRangeTableCellTemplatesInfo
returnsthecelltemplatedisplaynamethatisselectedforthecell.
// getCellInfo(int row, int column) NdDecTableCellInfo cellInfo = decTableModel.getCellInfo(2, 3); String cellTemplateDisplay Name = cellInfo.getTemplatesInfo().getCurrentCellTemplateDisplayName();
TheNdDecTableCellInfomethodgetRenderingInfo()returnsan NdRangeTableCellRenderingInfoobject.TheisEmpty()methodreturnstrueifthecell hasnocontent.TheisLabel()methodsindicateswhetherthecellcontainsalabel.The getRole()methodoftheNdRangeTableCellRenderingInforeturnsaconstantthat indicatestheroleofthecell. TheselectCellTemplate()methodselectsthecelltemplatedisplaynameonthecellat thespecifiedcoordinates.Thisprocessiscalledbinding.Thecelltemplatedisplayname selectedmustbeoneoftheallowedcelltemplatesspecifiedforthecell,justasauserin theGUIselectsacelltemplatefromadropdownlistofallowedcelltemplates.The allowedcelltemplateshavebeendefinedinthedecisiontablewizardormanuallyin
27
thedecisiontabletemplatedesigner.ANdMetaphorModelExceptionisthrownifthecell templateisnotallowedorifthesamecelltemplateisalreadydefinedforthatcell.
decTableModel.selectCellTemplate(new NdDecTableCellCoordinates(row, col), "= 'real'");
28
path2isthefirstchildofthefirstchildoftherootnode.Forthedecisiontreediagramed below,thatisthepathtotheModelYearnodeforCharger.
Youcanobtaintheincominglinkconditionvalue(Charger)andthenodelabel (ModelYear)withthesemethods:
// returns "Charger" String condition = decTreeModel.getIncomingLinkConditionValue(path2,0)); // returns "Model Year" String label = decTreeModel.getNodeLabel(path2));
Thesetofallowedconditiongrouplabelsforoutgoinglinksforthisnodeisobtained withthegetAllowedConditionGroupLabelsForOutgoingLinks()method.
// returns "Make", "Model", "Model Year" String[] allowedLabels = decTreeModel.getAllowedConditionGroupLabelsForOutgoingLinks(path2);
Youcanchangetheconditiongrouptoanyoftheallowedvaluesusingthe selectConditionGroupForOutgoingLinks()method.
decTreeModel.selectConditionGroupForOutgoingLinks(path2, "Model Year");
CallthegetNodeOutgoingLinksCount()methodtoobtainthenumberofoutgoinglinks.
// returns: 2 int count = decTreeModel.getNodeOutgoingLinksCount(path2));
ThisexamplecodeusesthegetNodeOutgoingNodeAt()methodtoobtainthefirst outgoingchildnode(path3)ofthenodeatpath2.
NdDecTreePath path3 = decTreeModel.getNodeOutgoingNodeAt(path2, 0);
29
NdDecTreeNodeRenderingInfocontainsavarietyinformationaboutanode.Welearn
thatpath3,isanactionnode.
NdDecTreeNodeRenderingInfo renderInfo = decTreeModel.getNodeRenderingInformation(path3); // Prints: "Is Rating: 4 an action node? true" System.out.println("Is " + renderInfo.getLabel() + " an action node? " + renderInfo.isActionNode());
ThegetIncomingLinkAllowedConditionFormatLabels()methodofNdDecTableModel returnsanarrayoftheallowedincominglinkconditionformatlabelsforpath3.
// returns: // "Model Year = 'integer'", "Model Year > 'integer'", "Model Year < 'integer'", // "Model Year >= 'integer'", "Model Year <= 'integer', // "Model Year 'integer1' <= .. <= 'integer2', "otherwise" String[] allowedFormats = decTreeModel.getIncomingLinkAllowedConditionFormatLabels(path3);
Toobtainthecurrentactionvalue(therating),usethegetActionValue()method.
// returns: 4 int actionValue = decTreeModel.getActionValue(path3, 0, 0));
Tochangetheratingfrom4to3andsetthenodelabelappropriately,usethiscode.
decTreeModel.setActionValue(path3, 0, 0, "3.0"); decTreeModel.setNodeLabel(path3, "Rating: 3");
30
NdPromItemContent content = (NdPromItemContent) decisionTreeInstanceItem.getItemContent(); NdDecTreeModel decTreeModel = null; if (NdMetaphorSupport.isDecisionTreeInstance((NdInstantiationElement)content)) { decTreeModel = NdDecTreeModelFactory.createDecTreeModel(); } else { System.exit(1); } NdDecTreeModelFactory.setDecTreeInstance(decTreeModel, (NdInstantiationElement)content); NdDecTreePath root = new NdDecTreePath(); NdDecTreePath path1 = decTreeModel.getNodeOutgoingNodeAt(root, 0); NdDecTreePath path2 = decTreeModel.getNodeOutgoingNodeAt(path1, 0); NdDecTreeNodeRenderingInfo renderInfo = decTreeModel.getNodeRenderingInformation(path2); // TASK: Delete the subtree at this node; then re-create it. decTreeModel.deleteSubtree(path2); NdDecTreePath newPath = decTreeModel.insertNewNode(path1, 0, "Model"); decTreeModel.selectConditionGroupForOutgoingLinks(newPath, "Model Year"); decTreeModel.selectIncomingLinkConditionFormat(newPath,"Model = 'string'"); decTreeModel.setIncomingLinkConditionValue(newPath,0, "Charger"); // first condition NdDecTreePath cond1 = decTreeModel.insertNewNode(newPath, 0, "Model Year"); decTreeModel.selectIncomingLinkConditionFormat(cond1,"Model Year = 'integer'"); decTreeModel.setIncomingLinkConditionValue(cond1,0, "1968"); decTreeModel.insertAction(cond1, 0); decTreeModel.selectActionFormat(cond1, 0, "adjustRating(arg0, ...) "); decTreeModel.setActionValue(cond1, 0, 0, "4.0"); decTreeModel.setNodeLabel(cond1, "Rating: 4"); // second condition NdDecTreePath cond2 = decTreeModel.insertNewNode(newPath, 1, "Model Year"); decTreeModel.selectIncomingLinkConditionFormat(cond2,"Model Year < 'integer'"); decTreeModel.setIncomingLinkConditionValue(cond2,0, "1968"); decTreeModel.insertAction(cond2, 0); decTreeModel.selectActionFormat(cond2, 0, "adjustRating(arg0, ...) "); decTreeModel.setActionValue(cond2, 0, 0, "0.0"); decTreeModel.setNodeLabel(cond2, "Rating: 0"); decisionTreeInstanceItem.save(); project.save(); } }
31
TheAcademicScoreInstancefileispartoftheBasicScoreModelexamplein
<ADVISOR_HOME>/examples/repositories/ExamplesRepository/ Metaphors and Templates/Score Models/Basic Score Model.
32
Eachbininascoremodelcontainsoneormoreranges.The
NdRangeTableCellTemplatesInfoclassisusedtosupplyinformationaboutthecurrent
Fortheexample,theprintoutputofthiscodeis:
GPA_Score GPA_Score GPA_Score GPA_Score GPA_Score GPA_Score GPA_Score 'real1' <= .. < 'real2' > 'real' < 'real' >= 'real' <= 'real' 'real1' < .. <= 'real2' 'real1' < .. < 'real2'
33
AfterrunningthecompletedAPIapplicationandreopeningtheprojectintheGUI,you canconfirmthatthebinisredefined.
int binCount = scoreModel.getBinCount(chr); for (int bin = 0; bin < binCount; bin++) { System.out.print(" Bin #" + bin + " '" + scoreModel.getBinLabel(chr, bin)); System.out.print("' Weight: " + scoreModel.getBinScoreWeight(chr, bin));
34
System.out.println(" Reason Code: " + scoreModel.getBinReasonCodeName(chr, bin)); int rangeCount = scoreModel.getRangeCount(chr, bin); for (int range = 0; range < rangeCount; range++) { templatesInfo = scoreModel.getRangeFormatTemplatesInfo(chr, bin, range); System.out.print(" "); System.out.println(templatesInfo.getCurrentCellTemplateDisplayName() + " ("); renderingInfo = scoreModel.getRangeRenderingInfo(chr, bin, range); cellPHValues = renderingInfo.getValues(); for (int ph = 0; ph < cellPHValues.length; ph++) { System.out.print(cellPHValues[ph]); if (ph < cellPHValues.length - 1) { System.out.print(" - "); }
} System.out.println(")"); } } }
ThisistheoutputofthecodewhenrunagainsttheAcademicScorescoremodel:
Characteristic: GPA_Score Bin #0 'Between 3.6 and 4.0' Weight: 50 Reason Code: ACAD01 GPA_Score 'real1' <= .. <= 'real2' (3.6 - 4) Bin #1 'Between 2.9 and 3.6' Weight: 30 Reason Code: ACAD02 GPA_Score 'real1' <= .. < 'real2' (2.9 - 3.6) Bin #2 'Between 2.1 and 2.9' Weight: 20 Reason Code: ACAD03 GPA_Score 'real1' <= .. < 'real2' (2.1 - 2.9) Bin #3 'Less than 2.1 ' Weight: 5 Reason Code: ACAD05 GPA_Score 'real1' <= .. < 'real2' (0 - 2.1) Bin #4 'All Other' Weight: 0 Reason Code: UEXP Characteristic: SAT_Score Bin #0 'Greater than 1400' Weight: 50 Reason Code: ACAD01 SAT_Score >= 'real' (1,400) Bin #1 'Between 1200 and 1400' Weight: 30 Reason Code: ACAD02 SAT_Score 'real1' <= .. < 'real2' (1,200 - 1,400) Bin #2 'Between 1000 and 1200' Weight: 20 Reason Code: ACAD03 SAT_Score 'real1' <= .. < 'real2' (1,000 - 1,200) Bin #3 'Between 800 and 1000' Weight: 10 Reason Code: ACAD04 SAT_Score 'real1' <= .. < 'real2' (800 - 1,000) Bin #4 'Less than 800' Weight: 5 Reason Code: ACAD05 SAT_Score 'real1' <= .. < 'real2' (0 - 800) Bin #5 'All Other' Weight: 0 Reason Code: UEXP <..portion removed..> Characteristic: Academic Honors Bin #0 'National Honors' Weight: 50 Reason Code: ACAD01 Academic Honors = 'string' (AP_Scholar) Academic Honors = 'string' (National_Merit_Scholar) Academic Honors = 'string' (National_Honors_Scholar) Bin #1 'Local Honors' Weight: 40 Reason Code: ACAD01 Academic Honors = 'string' (Honor_Roll) Academic Honors = 'string' (Deans_Award) Academic Honors = 'string' (Citizenship_Award) Bin #2 'Service Awards' Weight: 20 Reason Code: ACAD02 Academic Honors = 'string' (Merit_Award) Bin #3 'No Awards' Weight: 0 Reason Code: ACAD06 Academic Honors = 'string' (none) Bin #4 'All Other' Weight: 0 Reason Code: UEXP
35
36
CHAPTER 3
37
NdTemplateValueProvider Interface
AllprovidersimplementtheNdTemplateValueProviderinterface.Theinterface definesthebasicfeaturesofaprovider.Theinterfaceincludesconversionmethods whicheveryprovidermustsupport.Themethodsallowthevaluespassedinfromthe Innovatorenginetobetransformedinamannerdeterminedbytheprovider.The convertToDisplayValue()methodreturnsthevaluethatshouldbeusedfordisplay purposesinanRMAforagiveninstantiationvalue.Conversely, convertFromDisplayValue()returnsthevaluethatshouldbestoredinthe instantiationobjectforagivendisplayvalue.(Theinstantiationobjectisthebinary representationoftheinstantiationfile.)TheconvertToContentValue()methodisused toconvertaninstantiationvaluetothecontentvalue.However,whentheinstantiation valueandSRLvaluearethesame,whichisusuallythecasewithcustomproviders,no translationoccursandthemethodsimplyreturnstheinstancevaluethatispassedtoit. AnNdProviderContextobjectisanargumentinallofthemethodsofthisinterface.The contextargumentallowstheprovidertoobtaininformationaboutthecontextinwhich theproviderisbeinginvoked.TheNdProviderContextclassincludesthe getContentLocale()methodwhichreturnslocaleinformationasajava.util.Locale object.Theconvertmethodscanusethelocaleinformationtoperformlocalebased conversion. ThesetArgs()methodsetsthevaluesofcontrolvariablesthatcustomizethebehavior oftheprovider.Foradiscussionondesigningcustomproviderswithargumentssee CreatingCustomProviderClassesonpage41. ThevalidateInstantiationValue()methodreturnstrueifthesuppliedvaluefrom theinstantiationobjectsatisfiesalloftheconstraintsthattheproviderhasplacedonthe value.Yoursuppliedinstantiationvaluemustbevalid.Thereforethismethodshould returntrue. OthermethodsreturndescriptiveinformationabouttheprovidertotheInnovator engine.getProviderType()returnsthetypeoftheproviderclassasaString. getValueType()returnsaconstantwhichindicatesthetypeofvalueprovidedbythe provider.
38
com.blazesoft.template.engine public interface NdTemplateValueProvider { public void checkInstantiationValue(NdProviderContext context, String instantiationValue); public String convertFromDisplayValue(NdProviderContext context, Object displayValue); public String convertFromJavaObject(NdProviderContext context, Object javaObject); public String convertToContentValue(NdProviderContext context, String instantiationValue); public Object convertToDisplayValue(NdProviderContext context, String instantiationValue); public Object convertToJavaObject(NdProviderContext context, String instantiationValue); public Class getDisplayValueClass(NdProviderContext context); public String getProviderType(NdProviderContext context); public Class getValueClass(NdProviderContext context); public int getValueType(NdProviderContext context); public void reset(NdProviderContext context); public void setArgs(NdProviderContext context, NdProviderStaticArg[] args); }
NdDefaultTemplateValueProvider
NdDefaultTemplateValueProviderisanabstractclassthatprovidesdefault implementationsofthemethodsintheNdTemplateValueProviderinterface.The convertmethods(convertToDisplayValue(),etc.)passvalueswithoutchange. validateInstantiationValue()doesnotapplyanyconstraintsontheinstantiation value.Itreturnstrueforanyinstantiationvaluepassedtoit.setArgs()doesnotprocess anyarguments.
Asaconvenience,providerscansubclassthisclassandoverrideonlythosemethods neededtodefinetheirspecificfunctionality.
NdConstrainedListProvider Interface
NdConstrainedListProviderisasubinterfacetotheNdTemplateValueProvider
interface.Thisinterfaceisimplementedbyaproviderwhenthevalueitprovidesmust beconstrainedtooneofadiscretesetofvalues. ThegetAllowedInstantiationValues()methodreturnsanarrayofallthevaluesthat canbelegallystoredinthenodesoftheinstantiationobjectforwhichtheprovideris providingvalues.ThegetAllowedDisplayValues()methodreturnsanarrayofallthe valuesthatcanbelegallydisplayedforthenodesoftheinstantiationobjectforwhichthe providerisprovidingvalues.ThegetAllowedJavaValues()methodreturnsanarray ofallvaluesthatcanbelegallysupplied to a Java client forthenodesoftheinstantiation object.Eachmethodshouldreturnnulliftheproviderdoesnotimplementtheconstraint thatthevaluebeamemberofasetofdiscretevalues.
39
com.blazesoft.template.engine public interface NdConstrainedListProvider extends NdTemplateValueProvider { public String[] getAllowedInstantiationValues(NdProviderContext context); public Object[] getAllowedDisplayValues(NdProviderContext context); public Object[] getAllowedJavaValues(NdProviderContext context); }
NdDefaultConstrainedListProvider
NdDefaultConstrainedListProviderisanabstractclassthatextends NdDefaultTemplateValueProviderandimplementsthe NdConstrainedListProviderinterface.Itprovidesdefaultimplementationsfortwoof themethodsintheNdConstrainedListProviderinterface, getAllowedDisplayValues()andgetAllowedJavaValues().Providersthatextend NdDefaultContrainedListProvidermustimplement getAllowedInstantiationValues().ThegetAllowedDisplayedValues()method firstinvokesthegetAllowedInstantiationValues()method(onthesubclasswhich
implementsit)toobtainanarrayoftheallowedinstantiationvalues,andtheninvokes
convertToDisplayValue()oneachelementofthearraytogeneratethearrayof alloweddisplayvalues.ThedefaultimplementationofgetAllowedJavaValue()is identicaltogetAllowedDisplayValues().Bothmethodsreturnanarrayofallowed
NdDesignProvider Interface
TheNdDesignProviderinterfacedefinesthemethodsthatsupplymetainformation abouttheprovider.ThisinterfaceisimplementedbyeverystandardBlazeAdvisor provider,aswellastheexamplecustomprovidersinthe<ADVISOR_HOME>/examples/ customProviders/java/stateProvincedirectory.TheCustomProviderAPIdoesnot includeaclassthatprovidesdefaultimplementationofthesemethods.Yourprovider mustimplementeachofthesemethods. TheNdDesignProviderinterfacedefinesthemethodsthatsupplymetainformation abouttheprovider.ThisinterfaceisimplementedbyeverystandardBlazeAdvisor provider,aswellastheexamplecustomprovidersinthe<ADVISOR_HOME>/examples/ customProviders/java/stateProvincedirectory.TheCustomProviderAPIdoesnot
40
includeaclassthatprovidesdefaultimplementationofthesemethods.Yourprovider mustimplementeachofthesemethods. ThegetDisplayName()methodreturnsthedisplaynameoftheprovider.Thedisplay nameoftheproviderappearsintheprovidereditor.ThegetDisplayKey()method returnsakeyvaluewhichidentifiestheprovidersiconbitmapanditslabel. getDescription()returnsthedescriptionoftheprovider.Thedescriptionisdisplayed InNew Providerdialogboxwhentheprovidersiconisselected.Thismethodisnotused withcustomproviders,sincecustomprovidericonsdonotappearintheNew Provider dialogbox. ThegetArgumentDescriptors()methodreturnsthedescriptionfortheproviders arguments.Ifnoargumentsaresupportedthismethodmustreturnanarrayofzero length(i.e.,return NdDesignProviderArg[0];).
com.blazesoft.template.engine.provider public interface NdDesignProvider { public String getDisplayName(NdProviderContext context); public String getDescription(NdProviderContext context); public String getDisplayKey(NdProviderContext context); public NdDesignProviderArg[] getArgumentDescriptors(NdProviderContext context); }
NdProvidesDefaultValue Interface
TheNdProvidesDefaultValueinterfacedefinesthewayforvalueproviderstoprovide thedefaultvalues.Providersimplementthisinterfaceiftheyarecapableofprovidinga meaningfuldefaultvalueforthetypeofvaluethattheyrepresent. TheprovideDefaultValue()methodreturnsadefaultvalueforthetypeofvalue representedbythisvalueprovider.provideUniqueDefaultValues()returnsa sequenceofuniquedefaultvaluesforthetypeofvaluerepresentedbythisvalue provider.Iftheprovidercannotgeneratethenumberofvaluesspecifiedinthe numValuesparameter,thenitshouldreturnanarrayofsmallersizethatcontainsallof thevaluesthatitwasabletogenerate.
com.blazesoft.template.engine public interface NdProvidesDefaultValue { public String provideDefaultValue(NdProviderContext context); public String[] provideUniqueDefaultValues(NdProviderContext context, int numValues); }
41
Thelistofalloweddisplayvaluesappearsintheprovidereditor,asshownbelow.
42
RecallthattheNdContrainedListProviderinterfaceisimplementedbyaprovider whenthevalueitprovidesmustbeconstrainedtooneofadiscretesetofvalues(see NdConstrainedListProviderInterfaceonpage39).Thethreemethodsofthisinterface returntheallowedsetsofinstantiation,display,andJavavalues.Allconstrainedlist providersmustimplementthegetInstantiationValues()methodoftheinterface, whichreturnsaStringarrayofallvaluesthatcanbelegallystoredintheinstantiation objectforwhichtheproviderisprovidingvalues.TheCustomProviderAPIdoesnot supplyadefaultimplementationofthismethodsincethearraywouldalwaysbe uniquetotheprovider. TheInnovatorenginedeterminesthelistofdisplayvalueswhichappearinadrop downlistinanRMAbycallingconvertToDisplayValue()foreveryvalueinthearray returnedbygetInstantiationValues().Thedefaultimplementationof convertToDisplayValue()inNdDefaultTemplateValueProviderreturnsthevalue thatispassedtoit,sonoconversionoccurs.Thedisplayvalueisthesameasthe instantiationvalue.
describedinCustomProvidersExampleonpage33ofExamples.pdf. DisplayValuesProviderisdiscussedinTheExampleBaseClassonpage50.
43
44
45
Providerargumentdescriptorsaredefinedintheproviders getArgumentDescriptors()method.Youcanchangethedefaultvaluesofthe argumentsintheprovidereditor.Youcanoverridethedefaultvaluesinaprovider valueholderbyusingthevalueholdersSet Argumentsdialogbox.Whenargument valueschange,theInnovatorenginecallstheproviderssetArgs()method.setArgs() isalsocalledwheneveravaluemustbeprovidedtoavalueholder.setArgs()ispassed anarrayofproviderarguments.Inthecourseofprocessingthearguments,setArgs() willtypicallysetthevaluesofvariableswhichareusedelsewhereintheprovidercode tocontroltherequiredbehavior.
46
Asdescribedabove,theConstantDisplayValuesProviderproviderusessingle valuedNdDesignProviderSelectableArg()argumentdescriptorsthatdefine argumentsthatcantaketheirvaluefromalistofchoices.The UserDefinedDisplayValuesProviderproviderinthecustomprovidersexampleuses singlevalueNdDesignProviderTypeArgargumentsdescriptors.Thisclassdefinesa singlevaluedargumentthatisnotrestrictedtoselectionfromapredeterminedsetof choices.Valuesareenteredinatextbox. TheexampleUserDefinedDisplayValuesProviderproviderusesamultivalued argumentdescriptor(NdDesignProviderMultiArg),labeledElement,thatiscomposed oftwosingleargumentsoftypeNdDesignProviderTypedArg,whicharelabeled StoredValueandDisplayedValue.Theuserwhoisconfiguringtheprovidercan createanynumberofElementargumentsintheprovidereditor.EachElementspecifies astateorprovenceabbreviationwiththedisplayedname,suchasABandAlberta.
47
InthecodebelowforthegetArgumentDescriptors()methodofthe UserDefinedDisplayValuesProvider,thenamesofthetwo NdDesignProviderTypedArgsingleargumentsarespecifiedinthecallstothe constructor.Thenames,StoredValueandDisplayedValue,identifythearguments whentheyareprocessedinthesetArgsmethod.ThesetDisplayName()methodis calledtosetthedisplaynamesofthearguments,whichareContentValueand DisplayValue.Thesevaluesareusedaslabelsforthesingleargumentsinthe Elementshownintheimageabove.setDescription()iscalledtosetthedescriptionof eachargument,butthedescriptiondoesnotappearintheprovidereditor.setType()is calledtosettheargumenttypetoString.setDefaultValue()setsthedefaultvalueof theargumenttoanemptystring. Asmentionedabove,theNdDesignProviderMultiArgclassdescribesaproviders multivaluedargument.ThestorednameoftheargumentissettoElementinthe constructor.ThisisthenamethesetArgs()methodusestoidentifytheargument.The setDisplayName()methodiscalledtosetthedisplaynameoftheelements,whichis Element,asshownintheimageabove.ThesetNewCmdName()methodiscalledtoset thevalueofthetooltip,whichisNewElement.ThesetMultiple()methodiscalled tosetwhethertheargumentcanbemultiple,whichistrueinthecaseofthismultiple argument.ThesetArgumentDescriptors()methodispassedanarrayof NdDesignProviderArgwhichincludesthetwosingleNdDesignProviderTypeArg arguments.Finally,thegetArgumentDescriptors()methodreturnsthe NdDesignProviderArgelementargumentdescriptorthathasbeendefined.
// from UserDefinedDisplayValuesProvider.java public NdDesignProviderArg[] getArgumentDescriptors(NdProviderContext context) throws NdTemplateException { NdDesignProviderTypedArg storedValue = new NdDesignProviderTypedArg("StoredValue"); storedValue.setDisplayName("Content Value"); storedValue.setDescription("SRL value generated during runtime"); storedValue.setType(NdTemplateManager.BUILTIN_STRING_PROVIDER); storedValue.setDefaultValue(""); NdDesignProviderTypedArg displayedValue = new NdDesignProviderTypedArg("DisplayedValue"); displayedValue.setDisplayName("Display Value"); displayedValue.setDescription("Value displayed to the user"); displayedValue.setType(NdTemplateManager.BUILTIN_STRING_PROVIDER);
48
displayedValue.setDefaultValue(""); NdDesignProviderMultiArg element = new NdDesignProviderMultiArg("Element"); element.setDisplayName("Element"); element.setDescription("List Element"); element.setDisplayKey("Value"); element.setGroup("Element"); element.setNewCmdName("New Element"); element.setMultiple(true); element.setArgumentDescriptors(new NdDesignProviderArg[]{storedValue, displayedValue}); return new NdDesignProviderArg[]{element}; }
Processing Arguments
Asmentionedabove,thesetArgs()methodofaprovideriscalledbytheInnovator engine.ThesetArgs()methodispassedNdProviderStaticArgargumentswhichare processedinthemethod. TheConstantDisplayValuesProviderproviderdefinestwoStringvariables, displayTypeandlistType.Thevariablesareusedtocustomizethebehaviorofthe provider.TheproviderssetArgs()methodassignsthevalueintheargumentnamed DisplayTypetodisplayTypeandthevalueoftheargumentnamedListTypeto listType.
// from ConstantDisplayValuesProvider.java public void setArgs(NdProviderContext context, NdProviderStaticArg[] args) throws NdTemplateException { if (args != null & args.length > 0) { for (int index = 0; index < args.length; index++) { if (args[index].getName().equals("DisplayType")) { displayType = args[index].getValue(); } else if (args[index].getName().equals("ListType")) { listType = args[index].getValue(); } } } }
49
else { String[] allowedValues = new String[STATES_ABBREV.length + PROVINCES_ABBREV.length]; System.arraycopy(STATES_ABBREV, 0, allowedValues, 0, STATES_ABBREV.length); System.arraycopy(PROVINCES_ABBREV, 0, allowedValues, STATES_ABBREV.length, PROVINCES_ABBREV.length); initializationValues = allowedValues; } return initializationValues; }
50
ThegetAllowedInstantiationValues()methodoftheDisplayValuesProvider classreturnsanarrayofallthevaluesthatcanbelegallystoredinthenodesofthe instantiationobject,asdescribedinNdConstrainedListProviderInterfaceonpage39. ThegetAllowedInstantiationValues()methodcallsgetInstantiationValues()to obtaintheallowedinstantiationvalues.getAllowedInstantiationValues()iscalled bytheprovidersvalidateInstantiationValue()method,whichreturnstrueifits parametervalueiscontainedinthearrayofvalidinstantiationvaluesreturnedbythis method. TheDisplayValuesProviderclassoverridesthedefaultimplementation(in NdDefaultConstrainedListProver)ofalltheNdConstrainedListProverinterface convertmethods.FordescriptionofthesemethodsseeNdTemplateValueProvider Interfaceonpage38.TheDisplayValuesProviderimplementationofthesemethods eachmakeuseoftheallowedinstantiationvaluesreturnedby getInstantiationValues(),aswellasthealloweddisplayvaluesreturnedby getDisplayedValues().
51
yourfilesystemandkeptthatinformationinsomelocalcache,indexedbythefile location,youshouldinvalidatetheinformationassociatedwiththatfileifyou detectthatfilehasbeenmodified(usingtheLastModifiedattributeofthefilefor instancetodetectwhetherafilehaschanged). Forimplementingcaches,itsimportanttonotethatitisthesameCustomProvider classthatissharedbetweenallRMAsessions,socaremustbetakenifthe informationisstoredinastaticfield.ItmightbeOKtouseastaticfieldforsuch cacheddata,butonlyifthecacheddataisconstantandcanindeedbesharedacross allsessions.Alsothecodethatreadsfromorwritestothatcachemustbe synchronizedtopreventmultiplethreads/sessionstoaccessthatdataatthesame timeinanuncoordinatedfashion(thrashing). Ifthecacheddatacouldgrowtoalargeamountovertime,youcouldadd additionaltechniquestopartiallyreleasethememorykeptbytheoldestpartsof yourcache,suchasusingweakreferencesorweakhashmapstokeepreferencesto cacheddata. Intheparticularcasewherethedatabeingretrievedisstoredinadatabase,you shouldconsidernotonlycachingthedataretrievedfromthatdatabasebutalso sharingorpoolingofconnections(toavoidhavingeachsessionresultintoanew databaseconnection). Intheparticularcasewherethedatabeingretrievedcomesfromthecurrentproject content,youshouldusethenewNdPromProviderUtil.getPromProject()method toretrievethecurrentNdPromProject,andfromthatgetthelistofdirectories,items, andentitiesthatarerelevanttotheprovider(insteadofusingmethodssuchas NdTemplateManager.loadInstantiation()).Themainbenefitsofusingthenew PROMAPIsarethattheygiveafullyobjectifiedviewofwhatsinthecurrent project,aswellascacheallnecessaryinformation.
52
CHAPTER 4
RMA API
TheRMAAPIisahighlevelAPIfordevelopersbuildingrulemaintenanceapplications (RMAs).TheAPIisindependentoftheexecutionenvironment,soitisnotlimitedto webbasedapplications,butcanbeusedtobuildRMAsinotherenvironments includingJavaSwing. TheRMAAPIoffersasimplesetofinterfacesgearedtowardseditinginstancesof templates.AswiththePROMAPI,theRMAAPIoperationsarealwaysperformedin thecontextofaproject.TheAPIprovidesasimplemeansofconnectingtoeithera versionedornonversionedrepository,openingaproject,navigatingthecontentsofthe projectinordertofindrelevantinstances,andthenmakingitpossibletoeditandsave thoseinstances.TheAPIalsoallowsthecreationofnewinstancesfromtemplatesfound intheproject,aswelltheexecutionofqueriestofindentriesofinterestwithinthe project.PropercollaborationwiththeversioningsystemisprovidedbytheAPIaswell.
Bothmethodsacceptaparameterwhichspecifiesthelocationoftheprojectasan absolutelocationfromtherootdirectoryoftherepository.Thedifferencebetweenthe twoisthattheparametertotheopenProject(String projectFullDisplayPath) methodisaStringpathwhichisbuiltwithdisplaynames,astheyappearinthe BuilderIDE.Incontrast,theopenProject(NdLocation projectAbsoluteLocation) methodopenstheprojectatthelocationspecifiedbyanabsoluteNdLocation.File systemnamesareusedwhencreatinganNdLocation,ratherthandisplaynames.The latermethodisusedwhenfilesystemnamesarepreferredoverdisplaynamesandin thosecaseswherethelocationoftheprojectwasobtainedbyusingtheROMandPROM APIs,butitwasdeemedpreferabletodealwiththatprojectasanNdRmaProject.See SpecifyingaLocation(NdLocation)onpage15fordiscussiononcreatinganabsolute NdLocation.
53
TheNdRmaRepositoryinterfaceconsistsprimarilyofmethodswhichsupplyinformation abouttherepositoryconnectionandtherepository.
boolean isVersionControlled() boolean isPrivateWorkspaceUsed() boolean isConnected() void disconnect() Date getConnectionDate() NdRepositoryConnection getRepositoryConnection()
TheNdRmaProjectinterfaceprovidesanumberofmethodstonavigatethedirectories referencedbytheproject,aswellastheircontents.
NdRmaDirectory[] getDirectories(boolean includeSystemDirectories) NdRmaDirectory[] getAllDirectories() void resetDirectories() NdRmaDirectory addDirectory(String directoryDisplayName) void deleteDirectory(NdRmaDirectory directory)
54
ThegetAllTemplates()methodreturnsallthetemplatesintheproject. getAllInstances()returnsalltheinstancesintheproject.getAllQueryInstances() returnsallthequeryinstancesintheproject.getAllQueryTemplates()returnsallthe querytemplatesintheproject.Thesemethodsbydefaultreturnalltheentriesthatare foundwhentraversingthedirectoriesimportedbytheproject.However,aspecial method,setEntryExclusionFilter(),allowsclientcodetoprovidean NdRmaEntryExclusionFiltertoautomaticallyfilteroutunwantedresultswhenthese entrycollectingmethodsareused.PassingnulltosetEntryExclusionFilter()will removethefilterandthusresetthebehaviorofthosemethodstothedefault. Amethodisprovidedforobtaininganentrybyitslocation.
NdRmaEntry lookupEntryByLocation(NdLocation absoluteLocation)
55
NdRmaProjectsupportsversioningbyvirtueofextendingNdRmaEntry,whichhas
ThegetDisplayName()methodreturnsthedisplaynameofthefileasitappearsinthe BuilderIDE.getDisplayPath()returnsthedisplaypathofthefile,asanarrayof String.Eachelementrepresentsanodeinthehierarchy.Thehierarchystartsatthe projectnode.Thelastelementinthearrayisthedisplaynameofthefile.getLocation() returnsanNdLocationobjectthatistheabsolutelocationoftheentryfromtherootof therepository.getParentDirectory()returnsthedirectorythatcontainstheentry.Null isreturnediftheentryhasnoparent;whichwouldbethecaseif,forexample,theentry wereaprojectoroneofthetoplevelprojectdirectories.getProject()returnsthe projecttheentrybelongsto. Anentryalsosuppliesmethodstodealwithversioningandauthorization:
NdRmaEntryVersioningInfo getVersioningInfo() NdRmaEntryVersioningOperations getVersioningOperations() boolean isOperationAllowed(int operationCode)
ThegetVersioningInfo()methodreturnstheversioninginformation (NdRmaEntryVersioningInfo)fortheentry.Iftherepositorydoesnotsupport versioning,orthereisnoversioninginformationfortheentry,thismethodreturnsnull. getVersioningOperations()returnstheversioningoperations (NdRmaEntryVersioningOperations)thatmaybeperformedontheentry.Ifthe repositorydoesnotsupportversioning,ortheentrydoesnotsupportanyversioning operation,thismethodreturnsnull.Forthecurrentrelease,versioningoperationsare supportedforonlytwokindsofentries:instances(NdRmaInstance)andprojects (NdRmaProject).Forprojects,thegetVersion(), promote(), and restore()methods ofNdRmaEntryVersioningOperationsarenotsupported.isOperationAllowed() returnstrueiftherepositoryoperationwhosecodeissuppliedisallowed.Refertothe APIReferenceentryforNdRomOperationtoviewthesetofoperationcodes.TheBlaze AdvisorAPIReferenceisavailablebyselectingAPI ReferencefromtheBuilder Help menu.
56
ThehasEntries()methodreturnstrueifthedirectoryhasanycontent.getEntries() returnsalltheentriesinthedirectory.Thelistofentriesiscached.Ifanyentryexclusion filterwasdefinedattheprojectlevel,thentheresultprovidedbythesemethodswill dependonthefilter.resetEntries()clearsthecacheofentries.Thisisusefulsothatthe nextcalltogetEntries()returnsanuptodatelistofentries.ThecreateDirectory() methodcreatesasubdirectoryofthespecifiedname.ThedeleteEntry()method deletesthesuppliedentry.getGloballyDeletedFiles()returnsallthefilesinthis directorythathavebeendeletedandthencheckedintotheversioningsystem. resetGloballyDeletedFiles()clearsthecacheoffilesthathavebeendeletedthen checkedintotheversioningsystem.ThehasGloballyDeletedFiles()methodreturns trueifthedirectoryhasanyfilethathasbeendeletedthencheckedintotheversioning system. Versioningoperationsarenotprovidedforadirectoryinthecurrentrelease,even thoughNdRmaDirectoryextendsNdRmaEntry,whichsupportsversioning.However, NdRmaDirectorydoesprovidethefollowingmethodforobtainingversioning informationforalltheentriesinadirectory:
public NdRmaDirectoryVersioningInfos getVersioningInfos()
RMA Files
AsdescribedinRMAEntry(NdRmaEntry)onpage56,anentryinarepositoryis eitheraprojectdirectoryorafileinaproject.Filesarealwayscontainedbyadirectory, withtheexceptionofprojects.ThethreetypesoffilessupportedbytheRMAAPIare listedbelow.EachinterfaceextendsNdRmaFile. Project(NdRmaProject) Templatefile(NdRmaTemplateFile)
57
Instancefile(NdRmaInstanceFile) Editablefile(NdRmaEditableFile)
File (NdRmaFile)
TheNdRmaFileinterfaceprovidesthefollowingmethods.
Date getLastModifiedDate() boolean isLogicallyDeleted() boolean isNew() void reloadContent()
ThegetTemplate()methodreturnsthetemplatethatthisfilecontains.
58
TheNdRmaInstance getInstance()returnstheinstancethatthisfilecontains.
NdRmaInstanceFileextendsNdRmaEditableFilewhichprovidestheeditingcapability fortheinstance.NdRmaEditableFileisdiscussedinthefollowingsection.
onlyinstancesinstancesareeditable.
void save() NdRmaFile saveAs(NdRmaDirectory targetDirectory, String name) boolean isModified()
59
60
ThesetNodeValue()methodsetsthevalueofthesuppliednodetothepasseddisplay value.setNodeInstance()setstheinstanceofthesuppliednodeusingthesupplied templatedisplaynameforthatinstance.TheaddListValue()methodaddsthesupplied displayvaluetothesuppliedlistnode.ThissortoflistcontainsonlyStringvalues.In contrast,bothaddListInstance()methodsareusedtoaddinstancesoftemplatestothe suppliedlist.TheaddListInstance(NdInstanceElementNode list)methodisused whenthelistmayonlycontaininstancesofthesametemplate.The addListInstance(NdInstanceElementNode list, String displayValue)methodis usedwhenthelistmayonlycontaininstancesofdifferenttemplates.(Examplesofboth usagesarefoundinAddSegmentExample.java,whichispartoftheRMAAPIexample.) deleteListNode()deletesthesuppliednodefromitscontaininglist.moveListNodeUp() movesthenodeupinitscontaininglist(i.e.,itsindexinthelistisdecrementedby1). moveListNodeDown()movesthenodedowninitscontaininglist(i.e.,itsindexinthelist isincrementedby1). Editingerrorsmayoccurduringtheexecutionofanyoftheabovementionedmethods. Aneditingerrorwilloccur,forexample,whenanincorrecttemplatedisplaynameis suppliedtotheaddListInstance(NdInstanceElementNode list, String templateDisplayName)method.Theerrorsmaybeobtainedwiththefollowing NdRmaInstancemethods.
61
Beginvalidationbycallingoneofthevalidate()methods.Thiswillgeneratealistof validationerrorsincache.YoumaywanttocalltheclearValidationErrors()method beforecallingvalidate()inordertoclearanyexistinglist. Thevalidate()methodtriestovalidatethisinstance.Avariantofvalidate()takesan NdInstanceElementNodeasaparametertoonlyvalidatethatnode,anditssubnodes, andnotthewholeinstance.hasValidationErrors()returnstrueifthevalidationofthis instancegeneratedvalidationerrors.getValidationError()returnsthevalidation errorthatoccurredonthesuppliednode.Ifnoerroroccurredonthatnode,thismethod returnsnull.getOtherValidationErrors()returnsthevalidationerrorsforwhichthere isnoassociatednode.Ifnosucherroroccurred,thismethodreturnsanemptyarray. clearValidationErrors()clearsthelistofeditingerrors.
method:
NdRmaInstance getInstance()
62
NdAbstractInstanceNode
TheNdWhitespaceNodeinterfacerepresentsawhitespacenodeandprovidesthe getWhitespace()methodwhichreturnsthewhitespacecharacterofthenode.The NdStringNode interfacerepresentsastringnodeandprovidesthegetString()method whichreturnstheStringvalueofthenode.TheNdErrorNodeinterfacerepresentsan errornodeandprovidesthegetError()methodwhichreturnstheNdErrorforthe node.TheNdMetaphorNodeinterfacewrapstheinformationneededtodisplayoneofthe metaphors(decisiontable,decisiontree,orscoremodel).TheNdAbstractInstanceNode interfacerepresentsagenericinstancenodewhichcouldbeasingleinstancenodeora listnode. TheNdAbstractInstanceNodeinterfacerepresentsagenericinstancenodewhichcould beasingleinstancenodeoralistnode.Severalinterfaceswhichrepresentnodesextend NdAbstractInstanceNode.Theseinterfacesare:
NdInstantiationNode NdInstanceNode NdTableRowNode NdAbstractInstanceListNode NdInstanceListNode NdTableNode
Versioning
TheRMAAPIsupportsversioningofrepositoryentriesthroughtwointerfaces, NdRmaEntryVersioningOperationsandNdRmaEntryVersioningInfo. TheNdRmaEntryinterfaceprovidesthegetVersioningOperations()methodfor obtainingNdRmaEntryVersioningOperationsfortheentry.Themethodreturnsnullif therepositorydoesnotsupportversioningoriftheentrycannotbeversioned.Inthe currentreleaseonlyinstances(NdRmaInstance)supportallversioningoperations. Projects(NdRmaProject)supportsomeversioningoperations,butnotthegetVersion(), promote(),andrestore()methods. ThegetVersioningInfo()methodofNdRmaEntryobtainsversioninginformation (NdRmaEntryVersioningInfo)whichisprovidedforallentriesinaversioned repository.Themethodreturnsnulliftherepositorydoesnotsupportversioning.
63
ThegetVersionHistory()methodreturnsanarrayofNdRepositoryVersionHistory whichrepresentseachelementintherepositoryentrysversioninghistory.Thisclass containsmethodsforobtainingtheversionID,userID,timestamp,comment,location anddeletionstatus. ThegetVersioningLockInfo()methodreturnsNdRepositoryEntryLockInfowhich providescurrentlockinformationontheversionedentry.Thisinterfacehasmethods forobtainingandsettingthestatusofthelock(notlocked,lockedbyuser,lockedby userinanotherworkspace,lockedbyanotheruser),theuserIDoftheownerofthelock, thedateofthelock,andthelocationoftheentry. ThegetVersioningStatusInfo()returnsanNdRepositoryVersionResultSetwhich definestheresultsetreturnedbytheinvocationofmethodsintherepositoryversion managerinterface.Forfurtherinformation,consulttheAPIReferenceentryfor
NdRepositoryVersionResultSet.
64
RMA Query
TheRMAAPIsupportstheexecutionofexistingqueriesattheprojectlevel.Query resultsarereturnedasanarrayofNdRmaQueryResultItem.Queryresultscanbe instancesaswellasthecontentsofinstances. QueryinstancesareobtainedthroughthegetAllQueryInstances()methodof NdRmaProject(RMAProject(NdRmaProject)onpage54).Themethodreturnsallthe Queryinstancesthatcanbefoundintheproject.
NdRmaQueryInstance[] getAllQueryInstances(boolean includeSystemDirectories)
TheexecuteQuery()andexecuteQueryForTOC() methodsexecutethequery.Thelater methodaccumulatesonlytheresultsthatarerelevantforatableofcontents.Both methodsexecutethequerysynchronously.Thismeansthatthethreadinwhichthe methodisinvokedwaitsuntilexecutioniscomplete.Anentryexclusionfiltercanbeset ontheprojecttofilterqueryresults.ThegetQueryExecutionStatus()methodreturns thestatusofthequeryexecution.Thestatuscanbeoneof:EXEC_STATUS_NOT_STARTED, EXEC_STATUS_COMPLETE,EXEC_STATUS_EXECUTING,EXEC_STATUS_CANCELLED,or EXEC_STATUS_ABORTED.hasQueryResults()returnstrueiftheexecutionofthequery deliveredresults.getQueryResults()returnstheresultsofthequeryexecutionasan arrayofNdRmaQueryResultItem. Errorsthatmayoccurwhenexecutingqueriesmaybeobtainedwiththefollowing methods:
boolean hasQueryExecutionErrors() NdRMAException[] getQueryExecutionErrors() void clearQueryExecutionErrors()
65
66
String path = entryLocation.toString(); for (int i = 0; i < _excludedPaths.size(); i++) { String excludedPath = (String) _excludedPaths.elementAt(i); // If the path equals an excludedPath or starts with an exludedPath + "/" // then it is either exactly an excluded path, or it is a subdirectory of // one and thus it should be excluded. if (path.equals(excludedPath) || (path.startsWith(excludedPath + "/"))) { return true; } } return false; } public boolean isExcludedDirectoryToBeBrowsed(NdRmaDirectory directory) { // If a directory is to be excluded then so should its contents. return false; } }
Onlyonecustomexclusionfiltermaybesetonaprojectatatime.Usethe setEntryExclusionFilter(RmaEntryExcludedPathsFilter filter)methodof NdRmaProjecttosetthefilter.Youmay,ofcourse,switchtoanotherfilterbycallingthe methodagain.Passnulltothemethodtoindicatethatnofilteringshouldbeperformed. UsethegetEntryExclusionFilter()ofNdRmaProjecttoobtainthecurrent NdRmaEntryExclusionFilter. ThesampleclientcodebelowpassesaVector ofexcludedpathstotheconstructorof thefilterclass.Itsetstheprojectfilterbypassingthefilterto setEntryExclusionFilter().ThecalltogetAllQueryInstances()returnsallquery instancesavailabletotheproject,exceptthoseinthe/Business Library/Asiaand /Business Library/Europedirectoriesandtheirsubdirectories.
// rmaProject is an NdRmaProject Vector excludedPaths = new Vector(); excludedPaths.addElement("/Business Library/Asia"); excludedPaths.addElement("/Business Library/Europe");
RmaEntryExcludedPathsFilter myFilter = new RmaEntryExcludedPathsFilter(excludedPaths);
67
68
CHAPTER 5
69
Youshouldnotneedtoimplementtheworkspaceinterfacesforacustomrepository. BlazeAdvisorincludescompleteimplementationsthatitusesfortheseoperations. Theworkspacelayerisresponsiblefor: Allinteractionswiththeversionmanager.Thisremovestheneedfor implementationsofthestoragelayertobeawareoftheversionmanager,therefore simplifyingtheimplementations. Allinteractionswiththeauthorizationandlockmanagers.Thisremovestheneed fortheversionmanagerimplementationstobeawareoftheseconcepts,therefore simplifyingtheimplementations. Theworkspaceinterfacesareextensionsofthestoragelayerinterfacesthatinclude versioningoperations.Theydelegatetowhateverversionmanagerhasbeenconfigured ontherepository.
70
Administration Interfaces
Therearetwoadministrationinterfaces,oneassociatedwiththestoragelayerandthe otherassociatedwiththeversioningsystem.Theyareseparatedoutfromtheother interfacessoasnottoconfusetherolesofsoftwarethataccessesthestoragelayeror versioningsystemfromtheworkspacelayerversussoftwarethatneedstoperform administrativefunctionsonaworkspace. NdRepositoryAdmin NdRepositoryVersionSystemAdmin
Repository Connections
ConnectionsaremadetoarepositoryviaanNdRepositoryConnectioninstance.During theprocessofestablishingaconnectiontoarepository,therepositoryconfiguration willbeloadedfrompersistentstorageintherepository,andwillbeusedtoconfigure therepositoryandanyversioningsystem.
71
Repository Configurations
RepositoryconfigurationsareserializedintoanXMLdocumentthatisstoredatawell knownlocationwithintherepository.Instancesoftherepositoryconfigurationclassare createdfromthecontentsofthisXMLdocumentviatheBlazedynamicobjectmodel. Forexample,theportionoftherepositoryconfigurationthatspecifiestherepository connectionwillappearasfollows:
<RepositoryConfig> <RepositoryConnection> <Factory>com.blazesoft.repository.file.NdFileRepositoryConnection</Factory> <RepositoryName>MyRep</RepositoryName> <RepositoryFolder>c:\xyz\MyRep</RepositoryFolder> </RepositoryConnection> </RepositoryConfig>
72
Index
C
connectingtorepository 7 ConstantDisplayValuesProvider 45, 50 contentbasedAPI 12 create customproviders 41 decisiontable 26 decisiontree 28 enumeration 24 MetaphorModel 25 NdLocation 8 NdPromItem 9 NdRomDirectory 16 PROMproject 17 questionset 22 ruleflow 21 scoremodel 31 SRLclass 23 SRLfunction 20 SRLruleset 18 customprovider implementationguidelines 51 customproviders caching 51 creating 41
M
MetaphorAPIs creatingamodel 25 loadinganinstance 25
N
NdConstrainedListProvider 39 NdContrainedListProvider 43 NdDecTableModelFactory 26 NdDecTreeModelFactory 26 NdDecTreeNodeRenderingInfo 30 NdDecTreePath 28 NdDefaultConstrainedListProvider 40 NdDefaultTemplateValueProvider 39 NdDesignProvider 40 NdDesignProviderMultiArg 47 NdDesignProviderSelectableArg 46 NdDesignProviderTypedArg 47 NdLocation 8 NdMetaphorModelException 26 NdPromEntity 11 NdPromInstance 12 NdPromItemContent 11 NdPromProject 9,52 NdPromProvider 12 NdPromSrlRuleContent 13 NdPromSrlRuleset 13 NdPromTemplate 12 NdPromTextContent 12 NdProviderStaticArg 49 NdProvidesDefaultValue 41 NdRmaEntryExclusionFilter 66 NdRmaQueryInstance 65 NdRmaQueryResultItem 66 NdRomConnectionManager 7 NdRomConnetcionContext 8 NdRomSchemaManager 9 NdScoreModelModelFactory 26 NdTemplateValueProvider 38
D
decisiontables editing 26 decisiontree editing 30 DisplayValuesProvider 43,50
E
edit decisiontable 26 decisiontree 28 scoremodel 31 EntityObjectModel 12 entryexclusionfilter 66
L
loadingaPROMproject 18
P
performance
73
Index
customproviders 51 ProjectRepositoryObjectModel (PROM) 9 PROMitemcontent 11 PROMtask createenumeration 24 createquestionset 22 createruleflow 21 createSRLclass 23 createSRLfunction 20 createSRLruleset 18 creatingaPROMProject 17 loadingaPROMproject 18 releaseprojectresources 18
Q
QuestionSetObjectModel 15
R
releasePROMprojectresources 18 repositoryitem findlocation 8 typingattributes 8 RepositoryObjectModel(ROM) 7 RMAquery 65 RuleflowObjectModel 15
S
scoremodel editing 31 SRLEntityObjectModel 14 stringbasedAPI 12
T
typingattributesofrepositoryitem 8
U
UserDefinedDisplayValuesProvider 47
74