Skip to content

Instantly share code, notes, and snippets.

@tjerman
Created November 16, 2022 09:03
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tjerman/b3e2a0ec7cae485c8bf9f33940569b22 to your computer and use it in GitHub Desktop.
{"cells":{"1":[{"node":{"value":"Iterate all parent roles","geometry":{"x":2960,"y":2920,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"iterator","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"16","parent":"1"},"config":{"stepID":"16","kind":"iterator","ref":"rolesEach","defaultName":false,"arguments":[{"target":"query","type":"String","expr":"format(\"xx__%d_\", int(maxRoleNm-1))"}],"results":[{"target":"role","type":"Role","expr":"role"}]}},{"node":{"value":"Is it a hierarchical role?","geometry":{"x":2400,"y":3080,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"gatewayExclusive","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"21","parent":"1"},"config":{"stepID":"21","kind":"gateway","ref":"excl","defaultName":false,"results":[]}},{"node":{"value":"Determine hierarchy index","geometry":{"x":2120,"y":3200,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"expressions","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"6","parent":"1"},"config":{"stepID":"6","kind":"expressions","ref":"","defaultName":false,"arguments":[{"target":"a","expr":"split(r.handle, \"xx__\")","type":"Array"},{"target":"b","expr":"split(a[1], \"_\")","type":"Array"},{"target":"nm","expr":"b[0]","type":"Integer"}],"results":[]}},{"node":{"value":"Check if higher then current","geometry":{"x":2120,"y":3360,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"gatewayExclusive","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"17","parent":"1"},"config":{"stepID":"17","kind":"gateway","ref":"excl","defaultName":false,"results":[]}},{"node":{"value":"Use it","geometry":{"x":1880,"y":3480,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"expressions","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"9","parent":"1"},"config":{"stepID":"9","kind":"expressions","ref":"","defaultName":false,"arguments":[{"target":"maxRoleNm","expr":"nm","type":"Integer"}],"results":[]}},{"node":{"value":"Skip current iteration","geometry":{"x":2360,"y":3480,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"continue","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"10","parent":"1"},"config":{"stepID":"10","kind":"continue","ref":"","defaultName":true,"results":[]}},{"node":{"value":"Skip current iteration","geometry":{"x":2680,"y":3200,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"continue","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"13","parent":"1"},"config":{"stepID":"13","kind":"continue","ref":"","defaultName":true,"results":[]}},{"node":{"value":"Allow parent to access the record","geometry":{"x":2960,"y":3240,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"function","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"18","parent":"1"},"config":{"stepID":"18","kind":"function","ref":"rbacAllow","defaultName":false,"arguments":[{"target":"resource","expr":"record","type":"RbacResource"},{"target":"role","expr":"role.ID","type":"ID"},{"target":"operation","value":"read","type":"String"}],"results":[]}},{"node":{"value":"Terminate workflow execution","geometry":{"x":3280,"y":2920,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"termination","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"40","parent":"1"},"config":{"stepID":"40","kind":"termination","ref":"","defaultName":true,"results":[]}},{"node":{"value":"Iterate owner roles","geometry":{"x":2400,"y":2920,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"iterator","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"3","parent":"1"},"config":{"stepID":"3","kind":"iterator","ref":"loopEach","defaultName":false,"arguments":[{"target":"items","expr":"roles","type":"Array"}],"results":[{"target":"r","expr":"item","type":"Any"}]}},{"node":{"value":"Init variable for parent role","geometry":{"x":2120,"y":2920,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"expressions","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"14","parent":"1"},"config":{"stepID":"14","kind":"expressions","ref":"","defaultName":false,"arguments":[{"target":"maxRoleNm","expr":"-1","type":"Integer"}],"results":[]}},{"node":{"value":"Compose record - beforeUpdate","geometry":{"x":1560,"y":2920,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"trigger","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"42","parent":"1"},"config":{"stepID":"42","kind":"trigger","ref":"","defaultName":true,"results":[]},"triggers":{"enabled":true,"constraints":[{"name":"namespace.handle","op":"=","values":["hierarchy"]}],"eventType":"beforeUpdate","resourceType":"compose:record"}},{"node":{"value":"User role search","geometry":{"x":1840,"y":2920,"width":200,"height":80,"relative":false,"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"points":null,"offset":null},"style":"function","vertex":true,"connectable":true,"edge":false,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"15","parent":"1"},"config":{"stepID":"15","kind":"function","ref":"usersSearchMembership","defaultName":true,"arguments":[{"target":"lookup","expr":"record.ownedBy","type":"ID"}],"results":[{"target":"roles","expr":"roles","type":"Role"}]}}]},"edges":[{"node":{"value":null,"geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"22","parent":"1","source":"15","target":"14"},"config":{"parentID":"15","childID":"14"}},{"node":{"value":"Body","geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"23","parent":"1","source":"3","target":"21"},"config":{"parentID":"3","childID":"21"}},{"node":{"value":"End","geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"24","parent":"1","source":"3","target":"16"},"config":{"parentID":"3","childID":"16"}},{"node":{"value":"Yes","geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=0;exitY=0.75;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"26","parent":"1","source":"21","target":"6"},"config":{"expr":"hasPrefix(r.handle, \"xx__\")","parentID":"21","childID":"6"}},{"node":{"value":"No","geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=1;exitY=0.75;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"27","parent":"1","source":"21","target":"13"},"config":{"parentID":"21","childID":"13"}},{"node":{"value":null,"geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"29","parent":"1","source":"6","target":"17"},"config":{"parentID":"6","childID":"17"}},{"node":{"value":null,"geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"30","parent":"1","source":"14","target":"3"},"config":{"parentID":"14","childID":"3"}},{"node":{"value":"Yes","geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=0;exitY=0.75;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"33","parent":"1","source":"17","target":"9"},"config":{"expr":"maxRoleNm == -1 || nm < maxRoleNm","parentID":"17","childID":"9"}},{"node":{"value":"No","geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=1;exitY=0.75;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"34","parent":"1","source":"17","target":"10"},"config":{"parentID":"17","childID":"10"}},{"node":{"value":"Body","geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"35","parent":"1","source":"16","target":"18"},"config":{"parentID":"16","childID":"18"}},{"node":{"value":"End","geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"41","parent":"1","source":"16","target":"40"},"config":{"parentID":"16","childID":"40"}},{"node":{"value":null,"geometry":{"x":0,"y":0,"width":0,"height":0,"relative":true,"points":[],"TRANSLATE_CONTROL_POINTS":true,"alternateBounds":null,"sourcePoint":null,"targetPoint":null,"offset":null},"style":"exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;","edge":true,"vertex":false,"connectable":true,"visible":true,"collapsed":false,"mxTransient":["id","value","parent","source","target","children","edges"],"id":"43","parent":"1","source":"42","target":"15"},"config":{"childID":"15","parentID":"42"}}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment