Skip to content

Instantly share code, notes, and snippets.

@tjerman
Created May 9, 2022 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjerman/5ac69d1f7c1434d9fc0d33701595a397 to your computer and use it in GitHub Desktop.
Save tjerman/5ac69d1f7c1434d9fc0d33701595a397 to your computer and use it in GitHub Desktop.
{
"workflows": [
{
"handle": "dup_checker",
"enabled": true,
"meta": {
"name": "Dup Checker",
"description": "",
"visual": null
},
"keepSessions": 0,
"steps": [
{
"stepID": "4",
"kind": "function",
"ref": "composeRecordsSearch",
"arguments": [
{
"target": "module",
"expr": "module",
"type": "ComposeModule"
},
{
"target": "namespace",
"expr": "namespace",
"type": "ComposeNamespace"
},
{
"target": "query",
"expr": "format(\"f1='%s'\", record.values.f1)",
"type": "String"
},
{
"target": "incTotal",
"value": "true",
"type": "Boolean"
}
],
"results": [
{
"target": "nm",
"expr": "total"
}
],
"meta": {
"name": "",
"description": "",
"visual": {
"defaultName": true,
"id": "4",
"parent": "1",
"value": "Compose records search",
"xywh": [
2400,
2040,
200,
80
]
}
}
},
{
"stepID": "5",
"kind": "gateway",
"ref": "excl",
"arguments": null,
"results": [],
"meta": {
"name": "",
"description": "",
"visual": {
"defaultName": true,
"id": "5",
"parent": "1",
"value": "Exclusive",
"xywh": [
2680,
2040,
200,
80
]
}
}
},
{
"stepID": "6",
"kind": "error",
"ref": "",
"arguments": [
{
"target": "message",
"expr": "\"The record is duplicated\"",
"type": "String"
}
],
"results": [],
"meta": {
"name": "",
"description": "",
"visual": {
"defaultName": true,
"id": "6",
"parent": "1",
"value": "Stop workflow with error: \"The record is duplicated\"",
"xywh": [
2960,
2040,
200,
80
]
}
}
},
{
"stepID": "7",
"kind": "termination",
"ref": "",
"arguments": null,
"results": [],
"meta": {
"name": "",
"description": "",
"visual": {
"defaultName": true,
"id": "7",
"parent": "1",
"value": "Terminate workflow execution",
"xywh": [
2680,
2240,
200,
80
]
}
}
}
],
"paths": [
{
"expr": "nm > 0",
"parentID": "5",
"childID": "6",
"meta": {
"name": "",
"description": "",
"visual": {
"id": "10",
"parent": "1",
"points": [],
"style": "exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;",
"value": "#1 - If"
}
}
},
{
"parentID": "5",
"childID": "7",
"meta": {
"name": "",
"description": "",
"visual": {
"id": "11",
"parent": "1",
"points": [],
"style": "exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;",
"value": "#2 - Else (if)"
}
}
},
{
"parentID": "4",
"childID": "5",
"meta": {
"name": "",
"description": "",
"visual": {
"id": "13",
"parent": "1",
"points": [],
"style": "exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;",
"value": null
}
}
}
],
"triggers": [
{
"resourceType": "compose:record",
"eventType": "beforeCreate",
"constraints": [
{
"name": "namespace.handle",
"op": "=",
"values": [
"qwerty"
]
},
{
"name": "module.handle",
"op": "=",
"values": [
"testko"
]
}
],
"enabled": true,
"stepID": "4",
"meta": {
"description": "",
"visual": {
"defaultName": true,
"edges": [
{
"childID": "4",
"meta": {
"description": "",
"label": "",
"visual": {
"id": "8",
"parent": "1",
"points": [],
"style": "exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;",
"value": null
}
},
"parentID": "3"
}
],
"id": "3",
"parent": "1",
"value": "Compose record - beforeCreate",
"xywh": [
2120,
2040,
200,
80
]
}
}
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment