There are several good practice conventions in the scripting world, and Groovy within IJC is no exception. Here we have are collecting tips and suggestions for good coding practices, to help out with your code development. This page will continue to grow as we collect more suggestions.
def lock = edp.lockable.obtainLock('working') def envRW = EnvUtils.createDefaultEnvironmentRW(lock, 'working', true) try { // code code code } finally { lock?.release() envRW?.feedback.finish() }Since version 6.0 you can use method
withLock
for locking items safely:
edp.lockable.withLock('working'){ envRW -> // code code code }
assert etyStructureField != nullIf the structure is returned null, the script will immediately stop.