Groovy web console

subscribe to the feed Subscribe
to this
site
More UUID checking (via #groovywebconsole)
tweet this snippet Tweet
this
script

More UUID checking

Published 6 months ago by ESK
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
// First gather up all of the parent/expected UUIDs (we'll hard-code for this example)
def expectedUUIDs = ['54c0590a-8277-4adf-905b-0a75e80eeacd', '9d6bc2a6-270b-475b-a7c3-d0d502a31322', '7f1df271-4daf-4c5b-84b2-eb7c13ce19a9']
// Next gather up all the UUIDs from subtasks (we'll hard-code for this example)
def subtaskUUIDs = ['9d6bc2a6-270b-475b-a7c3-d0d502a31322', '7f1df271-4daf-4c5b-84b2-eb7c13ce19a9']
 
// Which UUIDs are we still awaiting? Any unexpected?
def missingUUIDs = expectedUUIDs - subtaskUUIDs
def unexpectedUUIDs = subtaskUUIDs - expectedUUIDs
def done = (missingUUIDs.size() == 0)
println "Done = ${done}; Awaiting UUID(s): ${missingUUIDs}; Unexpected UUID(s): ${unexpectedUUIDs}"
 
// Add in the missing one...
subtaskUUIDs << '54c0590a-8277-4adf-905b-0a75e80eeacd'
// And an unexpected one
subtaskUUIDs << 'hahaha-some-other-UUID'

// Which UUIDs are we still awaiting? Any unexpected?
missingUUIDs = expectedUUIDs - subtaskUUIDs
unexpectedUUIDs = subtaskUUIDs - expectedUUIDs
done = (missingUUIDs.size() == 0)
println "Done = ${done}; Awaiting UUID(s): ${missingUUIDs}; Unexpected UUID(s): ${unexpectedUUIDs}"