Groovy web console

subscribe to the feed Subscribe
to this
site
File transfer (via #groovywebconsole)
tweet this snippet Tweet
this
script

File transfer

Published 4 months ago by mdemyanov with tags naumen
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def source = utils.get('sourceClass$id')
def target = utils.get('targetClass$id')
def file = utils.files(source)?.first()
def fileAttrs = [:]
fileAttrs.put('source', target.UUID)
fileAttrs.put('sourceFqn', target.metaClass.toString())
fileAttrs.put('relation', null)
utils.edit(file, fileAttrs)