Troubleshooting D2W Rules

32
Troubleshooting D2W Rules David LeBer Align Software Inc.

Transcript of Troubleshooting D2W Rules

Page 1: Troubleshooting D2W Rules

Troubleshooting D2W Rules David LeBerAlign Software Inc.

Page 2: Troubleshooting D2W Rules

Why, why, Oh why?

Page 3: Troubleshooting D2W Rules

“With great power comes great opacity.”

Page 4: Troubleshooting D2W Rules

Knowledge is light...

• Understand the rules

• Understand their sources

• Understand the tools

Page 5: Troubleshooting D2W Rules

Getting to know the Rules

Page 6: Troubleshooting D2W Rules

The Rule Files

• user.d2wmodel and d2w.d2wmodel

• In your Application

• In its Frameworks

• Identifying all of the rules at play is critical

Page 7: Troubleshooting D2W Rules

Example: ERModernMoviesDemo

• ERModernMoviesDemo - user.d2wmodel/d2w.d2wmodel

• ERModernLook - d2w.d2wmodel

• ERModernDefaultSkin - d2w.d2wmodel

• ERModernDirectToWeb - d2w.d2wmodel

• ERDirectToWeb - d2w.d2wmodel

• JavaDirectToWeb - d2w.d2wmodel

Page 8: Troubleshooting D2W Rules

ALL of those rules affect your apps behaviour.

Page 9: Troubleshooting D2W Rules

RuleModeler to the rescue

Page 10: Troubleshooting D2W Rules

Demo

Page 11: Troubleshooting D2W Rules

Left Hand Side (LHS) Right Hand Side (RHS)

Anatomy of a Rule

100 : entity.name = ‘MovieRole’ => displayNameForEntity = “Movie Role” [Assignment]

Page 12: Troubleshooting D2W Rules

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...

Page 13: Troubleshooting D2W Rules

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

Page 14: Troubleshooting D2W Rules

Common Rule Problems

• Typos

• Conflicting LHS qualifier with rules higher up the hierarchy

• Incorrect or non-existent keys

Page 15: Troubleshooting D2W Rules

Rule Keys and Values

• Components

• The d2wContext

• Assignment objects

• Other rules

Page 16: Troubleshooting D2W 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*/

Page 17: Troubleshooting D2W Rules

Components

100 : entity.name = ‘MovieRole’ => displayNameForEntity = “Movie Role” [Assignment]

Page 18: Troubleshooting D2W Rules

d2wContext

• task

• entity

• propertyKey

• attribute

• relationship

Page 19: Troubleshooting D2W Rules

Assignment Objects

100 : entity.name = ‘MovieRole’ => displayNameForEntity = “Movie Role” [Assignment]

100 : entity.name = ‘MovieRole’ => isEntityEditable = “true” [BooleanAssignment]

100 : pageConfiguration like ‘*Article*’ => entity = “Article” [EntityAssignment]

Page 20: Troubleshooting D2W Rules

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;}

Page 21: Troubleshooting D2W Rules

Other Rules

50 : pageConfiguration like EditList* => subTask = “list” [Assignment]

1 : subTask = 'list' => repetitionComponentName = “ERDListPageRepetition” [Assignemnt]

Page 22: Troubleshooting D2W Rules

Did you turn it off and back on again?

Page 23: Troubleshooting D2W Rules

Did you turn it off and back on again?

Page 24: Troubleshooting D2W Rules

Did you turn it off and back on again?

Page 25: Troubleshooting D2W Rules

Did you turn it off and back on again?

Page 26: Troubleshooting D2W Rules

Demo

Page 27: Troubleshooting D2W Rules

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

Page 28: Troubleshooting D2W Rules

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]

Page 29: Troubleshooting D2W Rules

Demo

Page 30: Troubleshooting D2W Rules

Use the tools Luke

Page 31: Troubleshooting D2W Rules

Demo

Page 32: Troubleshooting D2W Rules

Q&A