Skip to content

Instantly share code, notes, and snippets.

@chanwit
Created September 27, 2011 14:16
Show Gist options
  • Select an option

  • Save chanwit/1245147 to your computer and use it in GitHub Desktop.

Select an option

Save chanwit/1245147 to your computer and use it in GitHub Desktop.
class DesktopScope implements Scope {
def get(String name, ObjectFactory of) {
def desktop = Executions?.current?.desktop
def obj = desktop?.getAttribute(name)
if(!obj) {
obj = of.getObject()
desktop?.setAttribute(name, obj)
}
return obj
}
String getConversationId() {
return Executions?.current?.desktop?.getId()
}
def remove(String name) {
def desktop = Executions.current.desktop
return desktop.removeAttribute(name)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment