Troubleshooting D2W Rules
-
Upload
wo-community -
Category
Technology
-
view
696 -
download
0
Transcript of Troubleshooting D2W Rules
Troubleshooting D2W Rules David LeBerAlign Software Inc.
Why, why, Oh why?
“With great power comes great opacity.”
Knowledge is light...
• Understand the rules
• Understand their sources
• Understand the tools
Getting to know the Rules
The Rule Files
• user.d2wmodel and d2w.d2wmodel
• In your Application
• In its Frameworks
• Identifying all of the rules at play is critical
Example: ERModernMoviesDemo
• ERModernMoviesDemo - user.d2wmodel/d2w.d2wmodel
• ERModernLook - d2w.d2wmodel
• ERModernDefaultSkin - d2w.d2wmodel
• ERModernDirectToWeb - d2w.d2wmodel
• ERDirectToWeb - d2w.d2wmodel
• JavaDirectToWeb - d2w.d2wmodel
ALL of those rules affect your apps behaviour.
RuleModeler to the rescue
Demo
Left Hand Side (LHS) Right Hand Side (RHS)
Anatomy of a Rule
100 : entity.name = ‘MovieRole’ => displayNameForEntity = “Movie Role” [Assignment]
Your Job ( )
• Determine what LHS condition will identify the point in your app that you want the behaviour to change.
• Identify what RHS key controls that behaviour
• Identify what value the RHS key needs to be need to be set to.
should you accept it... this hard drive will self destruct in...
Why a priority of a million may not be a good idea
• Establish priority guidelines
• Stray from those guidelines at your peril
• Arbitrarily high priorities, probably mean you are doing it wrong
Common Rule Problems
• Typos
• Conflicting LHS qualifier with rules higher up the hierarchy
• Incorrect or non-existent keys
Rule Keys and Values
• Components
• The d2wContext
• Assignment objects
• Other rules
Components
/*** From ERMODListPage.java** @d2wKey printerButtonComponentName* @d2wKey emptyListComponentName* @d2wKey headerComponentName* @d2wKey entity* @d2wKey allowsFiltering* @d2wKey repetitionComponentName* @d2wKey batchNavigationBarComponentName* @d2wKey displayNameForEntity* @d2wKey pageWrapperName* @d2wKey returnButtonLabel*/
Components
100 : entity.name = ‘MovieRole’ => displayNameForEntity = “Movie Role” [Assignment]
d2wContext
• task
• entity
• propertyKey
• attribute
• relationship
Assignment Objects
100 : entity.name = ‘MovieRole’ => displayNameForEntity = “Movie Role” [Assignment]
100 : entity.name = ‘MovieRole’ => isEntityEditable = “true” [BooleanAssignment]
100 : pageConfiguration like ‘*Article*’ => entity = “Article” [EntityAssignment]
Assignment Objects
0 : *true* => actions = “defaultActions” [ERDKeyValueAssignment]
0 : task = ‘list’ => defaultActions = “<ERDDefaultActionAssignment>” [ERDDefaultActionAssignemnt]
// From ERDDefaultActionAssignmentpublic NSDictionary defaultActions(D2WContext c) { NSDictionary actions = new NSDictionary(new Object[] { defaultLeftActions(c), defaultRightActions(c) }, new Object [] {"left", "right"} ); log.debug(actions); return actions;}
Other Rules
50 : pageConfiguration like EditList* => subTask = “list” [Assignment]
1 : subTask = 'list' => repetitionComponentName = “ERDListPageRepetition” [Assignemnt]
Did you turn it off and back on again?
Did you turn it off and back on again?
Did you turn it off and back on again?
Did you turn it off and back on again?
Demo
Page Configurations
• A shortcut to identify a task and entity combination
• Naming convetion: TaskModifierEntity
• Are easier to read and remember
• Are more flexible
• Can reduce the number of rules required
Wildcard Gotchas
50 : pageConfiguration like ‘*Movie*’ => someKey = “someValue” [Assignment]
50 : pageConfiguration like ‘Inspect*Movie*’ => someKey = “someDifferentValue” [Assignment]
60 : pageConfiguration like ‘Inspect*Movie*’ => someKey = “someDifferentValue” [Assignment]
Demo
Use the tools Luke
Demo
Q&A