Presentation is loading. Please wait.

Presentation is loading. Please wait.

CodeBeamer Bootcamp 2007 Customizing CodeBeamer features through scripting Aron Gombas Architect, Intland.

Similar presentations


Presentation on theme: "CodeBeamer Bootcamp 2007 Customizing CodeBeamer features through scripting Aron Gombas Architect, Intland."— Presentation transcript:

1 CodeBeamer Bootcamp 2007 Customizing CodeBeamer features through scripting Aron Gombas Architect, Intland

2 What is the problem? Some features in CB can be very generic, so: ● There is no solution that makes everyone happy → customization is necessary ● But! Customizing via “traditional” configuration options (UI, XML, props): – either flexible, but complicated – or simple, but restricted

3 Known examples (simple) ● What notification emails to send to whom to prevent “Mailflut”? – Manager → tracker items (in any tracker) only – QA → tracker items in “BUG” only – Developer → also commits – (solved, see later!) ● What emails to compile into the "daily digest email" (planned, see mailing lists)? – what to include? what not? – Manager → tracker items only – Developer → also commits ● What entries to show in Navigation History? – what to include? what not?

4 Known examples (advanced) ● Listeners (any kind) implemented in Groovy – DuplicatedTrackerItemCheckerListener ● Extra content in notification emails – # of associations, or the associations themselves for different type of users ● “Email integration” feature (planned) – getting real content – support for custom “control tags” ● What labels to suggest when assigning labels to some entity? – by popularity? by age? by some other "score"? a formula? public ones? private ones? both? ● (let's see your examples later!)

5 What's the solution? Idea: instead of configuring declaratively, let's do it programatically! OK, but what programming language? Java? “If the only tool you have is a hammer, then all problems start looking like nails” No Java for these little snippets! It must be fast, simple and concise! Ruby? Perl? Javascript? Something else?

6 What is Groovy? "An agile dynamic language for the Java Platform with many features that are inspired by languages like Python, Ruby and Smalltalk, making them available to Java developers using a Java-like syntax." ● All basic language constructs + OO ● Collections ● Logging ● Math ● Operator overloading ● (Builders) ● (Closures) Note: we are NOT Groovy experts (yet).

7 Why Groovy? ● flexible: – simple problems can be solved simply (evaluating a single condition) – but it's possible to solve hard problems (complete OO programs) ● integration: – supports Java APIs, Ant, Servlet, Spring, Swing, etc. → reuse your Java knowledge ● mature: – used in industry strength apps – version 1.0 available since 2007 Jan ● standard: JSR 241 ● rich: modules for data access with SQL, remote calls with XMLRPC, SOAP, etc. ● tool support: Eclipse, NetBeans, IDEA, etc.

8 Groovy in CodeBeamer Groovy is already embedded in CodeBeamer (since 4.2)! Use case: use scripts to decide whether to send a notification email to an addressee 1)Listener compiles the list of addressees 2)for each mail and for each addressee ● Evaluate script with boolean return value: – TRUE → send to him – FALSE → skip him

9 Groovy in CodeBeamer ● default script: return true // every addressee receives everything ● ignore anything, but “closing”: for(modifiedProperty in modifiedProperties) { if(modifiedProperty.fieldName == "Status" && modifiedProperty.newValue == "Closed") { return true } return false

10 Groovy in CodeBeamer ● ignore by project-, tracker-, tracker item lists def ignoredProjects = [2, 15] def ignoredTrackers = [41] def ignoredTrackerItems = [1007, 1233] if(trackerItem.tracker.id in ignoredTrackers || trackerItem.id in ignoredTrackerItems || trackerItem.tracker.project.id in ignoredProjects) { return false } return true

11 Groovy in CodeBeamer Benefits: ● Requires minimal programming skills for most of the cases – Simple IF-THEN conditions: immediately (read the Manual) – Complex problems: investment (time for learning) ● Scripts can be redeployed on the fly → no container restart Our long-term vision: core code (“engine”) in Java + features via Groovy scripts

12 Brainstorming / Q&A Interactive phase: ● What problems would you like to solve with Groovy instead of Java? Use cases? Would you invest your time into Groovy? ● Do you need a web UI to edit the scripts? Or prefer editing (and debugging!) in your favorite IDE and deploy through the web UI? ● Any additional idea?

13 6. References ● Groovy project home: http://groovy.codehaus.org ● "About Groovy" portal: http://www.aboutgroovy.com

14 7. Thanks ● mailto: aron.gombas@intland.com


Download ppt "CodeBeamer Bootcamp 2007 Customizing CodeBeamer features through scripting Aron Gombas Architect, Intland."

Similar presentations


Ads by Google