[
	{
		"id": "c93aef0f.c6081",
		"type": "subflow",
		"name": "Upload to OSS",
		"info": "Upload an object. If the specified object name already exists in \nthe bucket, the uploaded content will overwrite the existing content \nfor the bucket name/object name combination.\n\n### Parameters\n\n* **bucket**: bucket to upload object into\n\n* **key**: object name being uploaded\n\n* **contentType** [optional]: media type\n\n* **contentDisposition** [optional]: suggested default filename when downloading this object to a file after it has been uploaded\n\n* **ifMatch** [optional]: When overwriting an object, use the latest SHA-1 hash \n  to verify that you are overwriting the latest data.\n  A SHA-1 hash is returned every time you upload or overwrite an object. \n  If the SHA-1 hash in the header does not match the current SHA-1 hash \n  stored for this object in OSS, the request fails (status code 412).\n\n### Outputs\n\n* **response**: the object details\n  The node will add the ```objectId```, ```base64``` and ```safe base64``` **```urn```** to the message.\n\n* **error**: an error occured",
		"category": "forge",
		"in": [
			{
				"x": 100,
				"y": 180,
				"wires": [
					{
						"id": "3e0684d2.fdf95c"
					}
				]
			}
		],
		"out": [
			{
				"x": 880,
				"y": 460,
				"wires": [
					{
						"id": "23ff6b3.d21ac94",
						"port": 0
					}
				]
			},
			{
				"x": 880,
				"y": 240,
				"wires": [
					{
						"id": "67c9a760.2b60d8",
						"port": 1
					},
					{
						"id": "8457e7df.678948",
						"port": 1
					}
				]
			}
		],
		"env": [
			{
				"name": "bucket",
				"type": "str",
				"value": ""
			},
			{
				"name": "key",
				"type": "str",
				"value": ""
			},
			{
				"name": "contentType",
				"type": "str",
				"value": ""
			},
			{
				"name": "contentDisposition",
				"type": "str",
				"value": ""
			},
			{
				"name": "ifMatch",
				"type": "str",
				"value": ""
			}
		],
		"outputLabels": [
			"response",
			"error"
		],
		"icon": "node-red-node-forge/forge.png",
		"status": {
			"x": 360,
			"y": 60,
			"wires": [
				{
					"id": "5524a60f.f3f968",
					"port": 0
				}
			]
		}
	},
	{
		"id": "dd35521f.f8b18",
		"type": "switch",
		"z": "c93aef0f.c6081",
		"name": "",
		"property": "filename",
		"propertyType": "msg",
		"rules": [
			{
				"t": "empty"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 230,
		"y": 340,
		"wires": [
			[
				"805d7a22.305ae8"
			],
			[
				"485d2c2b.21f7d4"
			]
		]
	},
	{
		"id": "805d7a22.305ae8",
		"type": "change",
		"z": "c93aef0f.c6081",
		"name": "Buffer",
		"rules": [
			{
				"t": "set",
				"p": "payload",
				"pt": "msg",
				"to": "data",
				"tot": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 430,
		"y": 320,
		"wires": [
			[
				"67c9a760.2b60d8"
			]
		]
	},
	{
		"id": "485d2c2b.21f7d4",
		"type": "change",
		"z": "c93aef0f.c6081",
		"name": "local filename",
		"rules": [
			{
				"t": "set",
				"p": "payload.localFilename",
				"pt": "msg",
				"to": "filename",
				"tot": "msg"
			},
			{
				"t": "delete",
				"p": "err",
				"pt": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 400,
		"y": 360,
		"wires": [
			[
				"67c9a760.2b60d8"
			]
		]
	},
	{
		"id": "67c9a760.2b60d8",
		"type": "forge-oss",
		"z": "c93aef0f.c6081",
		"name": "Upload file",
		"topic": "details",
		"forge": "",
		"operation": "PutObject",
		"raw": false,
		"all": false,
		"bucket": "",
		"bucketType": "str",
		"policyKey": "transient",
		"key": "",
		"contentType": "application/octet-stream",
		"contentDisposition": "",
		"copy": "",
		"localFilename": "",
		"limit": 10,
		"startAt": "",
		"beginsWith": "",
		"with": null,
		"ifMatch": "",
		"ifNoneMatch": "",
		"ifModifiedSince": "",
		"range": "",
		"access": "read",
		"singleUse": false,
		"minutesExpiration": 60,
		"acceptEncoding": "",
		"guid": "autodesk",
		"region": "US",
		"x": 630,
		"y": 340,
		"wires": [
			[
				"22c9fe1b.97fb72"
			],
			[]
		]
	},
	{
		"id": "22c9fe1b.97fb72",
		"type": "change",
		"z": "c93aef0f.c6081",
		"name": "Add Force Translation",
		"rules": [
			{
				"t": "set",
				"p": "xAdsForce",
				"pt": "msg",
				"to": "true",
				"tot": "bool"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 660,
		"y": 400,
		"wires": [
			[
				"bea009e.c90c9f8"
			]
		]
	},
	{
		"id": "bea009e.c90c9f8",
		"type": "function",
		"z": "c93aef0f.c6081",
		"name": "Get URN",
		"func": "msg.objectId = msg.payload.objectId;\nmsg.urn = msg.payload.objectId;\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 280,
		"y": 460,
		"wires": [
			[
				"50bff6f3.e779c8"
			]
		]
	},
	{
		"id": "50bff6f3.e779c8",
		"type": "base64",
		"z": "c93aef0f.c6081",
		"name": "base64 urn",
		"action": "str",
		"property": "urn",
		"x": 430,
		"y": 460,
		"wires": [
			[
				"23ff6b3.d21ac94"
			]
		]
	},
	{
		"id": "23ff6b3.d21ac94",
		"type": "function",
		"z": "c93aef0f.c6081",
		"name": "safe base64",
		"func": "msg.base64 = msg.urn;\nmsg.urn = msg.urn\n\t\t\t\t.replace (/\\+/g, '-') // Convert '+' to '-'\n\t\t\t\t.replace (/\\//g, '_') // Convert '/' to '_'\n\t\t\t\t.replace (/=+$/, '');\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 590,
		"y": 460,
		"wires": [
			[]
		]
	},
	{
		"id": "5524a60f.f3f968",
		"type": "status",
		"z": "c93aef0f.c6081",
		"name": "",
		"scope": null,
		"x": 200,
		"y": 60,
		"wires": [
			[]
		]
	},
	{
		"id": "3e0684d2.fdf95c",
		"type": "function",
		"z": "c93aef0f.c6081",
		"name": "Inject",
		"func": "if ( msg.err )\n    delete msg.err;\n    \n//context.set / .get\n\n// Priority: payload, msg, env, default\nif ( msg.payload ) {\n    msg.bucket =msg.payload.bucket || msg.bucket || env.get('bucket');\n    msg.key =msg.payload.key || msg.key || env.get('key');\n    msg.contentType =msg.payload.contentType || msg.contentType || env.get('contentType') || '';\n    msg.contentDisposition =msg.payload.contentDisposition || msg.contentDisposition || env.get('contentDisposition') || '';\n    msg.ifMatch =msg.payload.ifMatch || msg.ifMatch || env.get('ifMatch') || '';\n} else {\n    msg.bucket =msg.bucket || env.get('bucket');\n    msg.key =msg.key || env.get('key');\n    msg.contentType =msg.contentType || env.get('contentType') || '';\n    msg.contentDisposition =msg.contentDisposition || env.get('contentDisposition') || '';\n    msg.ifMatch =msg.ifMatch || env.get('ifMatch') || '';\n}\n\nnode.status ({});\nif ( !msg.bucket || msg.bucket === '' || !/^[-_.a-z0-9]{3,128}$/.test(msg.bucket) ) {\n    node.status ({\n        fill: 'red',\n        shape: 'dot',\n        text: 'Invalid bucket name!'});\n    node.error('Provide a valid bucket name!');\n    delete msg.payload;\n    msg.err ={\n        reason: \"Valid field 'bucket' must be of the form  [-_.a-z0-9]{3,128}\"\n    };\n    return (null);\n} else if ( !msg.key || msg.key === '' ) {\n    node.status ({\n        fill: 'red',\n        shape: 'dot',\n        text: 'Invalid key name!'});\n    node.error('Provide a valid key name!');\n    delete msg.payload;\n    msg.err ={\n        reason: \"Valid field 'key' cannot be empty\"\n    };\n    return (null);\n}\n\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 230,
		"y": 180,
		"wires": [
			[
				"8457e7df.678948"
			]
		],
		"info": "Upload an object. If the specified object name already exists in \nthe bucket, the uploaded content will overwrite the existing content \nfor the bucket name/object name combination.\n\n### Parameters\n\n* **bucket**: bucket to upload object into\n\n* **key**: object name being uploaded\n\n* **contentType** [optional]: indicate the media type of the resource\n\n* **contentDisposition** [optional]: suggested default filename when \n  downloading this object\n\n* **ifMatch** [optional]: When overwriting an object, use the latest SHA-1 \n  hash to verify that you are overwriting the latest data.\n  A SHA-1 hash is returned every time you upload or overwrite an object. \n  If the SHA-1 hash in the header does not match the current SHA-1 hash \n  stored for this object in OSS, the request fails (status code 412).\n\n### Outputs: "
	},
	{
		"id": "8457e7df.678948",
		"type": "switch",
		"z": "c93aef0f.c6081",
		"name": "Params Ok?",
		"property": "err",
		"propertyType": "msg",
		"rules": [
			{
				"t": "null"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 270,
		"y": 240,
		"wires": [
			[
				"dd35521f.f8b18"
			],
			[]
		]
	},
	{
		"id": "4aecadf2.352044",
		"type": "subflow",
		"name": "OSS Object Exists?",
		"info": "Check if an object exists\n\n### Parameters\n\n* **bucket**: bucket key\n\n* **key**: object name to get details for\n\n* **sha1** [optional]: use the SHA-1 hash to know if the file is the same\n\n* **ifModifiedSince** [optional]: If the requested object has not been modified \n  since the time specified in this field, an entity will not be returned \n  from the server; instead, a 304 (not modified) response will be \n  returned without any message body. (HTTP date - UTC format)\n\n### Outputs\n\n* **sameObject**: SHA-1 code was provided and the object on the server match that code\n  The node will add the ```objectId```, ```base64``` and ```safe base64``` **```urn```** to the message.\n\n* **needsUpdate**:  SHA-1 code was provided and the object on the server does not match that code\n  The node will add the ```objectId```, ```base64``` and ```safe base64``` **```urn```** to the message.\n\n* **notFound**: the object was not found on the server\n\n* **error**: an error occured\n",
		"category": "forge",
		"in": [
			{
				"x": 80,
				"y": 240,
				"wires": [
					{
						"id": "cd4ca6bf.a91398"
					}
				]
			}
		],
		"out": [
			{
				"x": 960,
				"y": 160,
				"wires": [
					{
						"id": "f378191f.bb72c8",
						"port": 0
					}
				]
			},
			{
				"x": 960,
				"y": 280,
				"wires": [
					{
						"id": "5760de98.b3949",
						"port": 0
					}
				]
			},
			{
				"x": 960,
				"y": 400,
				"wires": [
					{
						"id": "8d6819c6.ca4368",
						"port": 0
					}
				]
			},
			{
				"x": 960,
				"y": 500,
				"wires": [
					{
						"id": "a30f5db5.f98de",
						"port": 1
					},
					{
						"id": "2fc8f4fa.244c3c",
						"port": 1
					}
				]
			}
		],
		"env": [
			{
				"name": "bucket",
				"type": "str",
				"value": ""
			},
			{
				"name": "key",
				"type": "str",
				"value": ""
			},
			{
				"name": "sha1",
				"type": "str",
				"value": ""
			},
			{
				"name": "ifModifiedSince",
				"type": "str",
				"value": ""
			}
		],
		"outputLabels": [
			"sameObject",
			"needUpdate",
			"notFound",
			"error"
		],
		"icon": "node-red-node-forge/forge.png",
		"status": {
			"x": 420,
			"y": 80,
			"wires": [
				{
					"id": "b48d897a.c9d238",
					"port": 0
				}
			]
		}
	},
	{
		"id": "519554b5.c479ac",
		"type": "forge-oss",
		"z": "4aecadf2.352044",
		"name": "File Exists?",
		"topic": "",
		"forge": "",
		"operation": "ObjectDetails",
		"raw": false,
		"all": false,
		"bucket": "",
		"bucketType": "str",
		"policyKey": "transient",
		"key": "",
		"contentType": "application/octet-stream",
		"contentDisposition": "",
		"copy": "",
		"localFilename": "",
		"limit": 10,
		"startAt": "",
		"beginsWith": "",
		"with": [
			"createdDate",
			"lastModifiedDate"
		],
		"ifMatch": "",
		"ifNoneMatch": "",
		"ifModifiedSince": "",
		"range": "",
		"access": "read",
		"singleUse": false,
		"minutesExpiration": 60,
		"acceptEncoding": "",
		"guid": "autodesk",
		"region": "US",
		"x": 450,
		"y": 360,
		"wires": [
			[
				"267a56b1.29195a"
			],
			[
				"2fc8f4fa.244c3c"
			]
		]
	},
	{
		"id": "2fc8f4fa.244c3c",
		"type": "switch",
		"z": "4aecadf2.352044",
		"name": "File Missing",
		"property": "err.statusCode",
		"propertyType": "msg",
		"rules": [
			{
				"t": "eq",
				"v": "404",
				"vt": "num"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 690,
		"y": 380,
		"wires": [
			[
				"8d6819c6.ca4368"
			],
			[]
		]
	},
	{
		"id": "267a56b1.29195a",
		"type": "switch",
		"z": "4aecadf2.352044",
		"name": "sha1?",
		"property": "payload.sha1",
		"propertyType": "msg",
		"rules": [
			{
				"t": "eq",
				"v": "sha1",
				"vt": "msg"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": true,
		"outputs": 2,
		"x": 430,
		"y": 160,
		"wires": [
			[
				"d7e513f3.2c9c1"
			],
			[
				"7658925d.5f746c"
			]
		]
	},
	{
		"id": "b48d897a.c9d238",
		"type": "status",
		"z": "4aecadf2.352044",
		"name": "",
		"scope": null,
		"x": 280,
		"y": 80,
		"wires": [
			[]
		]
	},
	{
		"id": "cd4ca6bf.a91398",
		"type": "function",
		"z": "4aecadf2.352044",
		"name": "Inject",
		"func": "if ( msg.err )\n    delete msg.err;\n    \n//context.set / .get\n\n// Priority: payload, msg, env, default\nif ( msg.payload ) {\n    msg.bucket =msg.payload.bucket || msg.bucket || env.get('bucket');\n    msg.key =msg.payload.key || msg.key || env.get('key');\n    msg.sha1 =msg.payload.sha1 || msg.sha1 || env.get('sha1') || '';\n    msg.ifModifiedSince =msg.payload.ifModifiedSince || msg.ifModifiedSince || env.get('ifModifiedSince') || '';\n} else {\n    msg.bucket =msg.bucket || env.get('bucket');\n    msg.key =msg.key || env.get('key');\n    msg.sha1 =msg.sha1 || env.get('sha1') || '';\n    msg.ifModifiedSince =msg.ifModifiedSince || env.get('ifModifiedSince') || '';\n}\n\nnode.status ({});\nif ( !msg.bucket || msg.bucket === '' || !/^[-_.a-z0-9]{3,128}$/.test(msg.bucket) ) {\n    node.status ({\n        fill: 'red',\n        shape: 'dot',\n        text: 'Invalid bucket name!'});\n    node.error('Provide a valid bucket name!');\n    delete msg.payload;\n    msg.err ={\n        reason: \"Valid field 'bucket' must be of the form  [-_.a-z0-9]{3,128}\"\n    };\n} else if ( !msg.key || msg.key === '' ) {\n    node.status ({\n        fill: 'red',\n        shape: 'dot',\n        text: 'Invalid key name!'});\n    node.error('Provide a valid key name!');\n    delete msg.payload;\n    msg.err ={\n        reason: \"Valid field 'key' cannot be empty\"\n    };\n}\n\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 130,
		"y": 380,
		"wires": [
			[
				"a30f5db5.f98de"
			]
		]
	},
	{
		"id": "a30f5db5.f98de",
		"type": "switch",
		"z": "4aecadf2.352044",
		"name": "Params Ok?",
		"property": "err",
		"propertyType": "msg",
		"rules": [
			{
				"t": "null"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 290,
		"y": 380,
		"wires": [
			[
				"519554b5.c479ac"
			],
			[]
		]
	},
	{
		"id": "8d6819c6.ca4368",
		"type": "change",
		"z": "4aecadf2.352044",
		"name": "Remove err",
		"rules": [
			{
				"t": "delete",
				"p": "err",
				"pt": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 890,
		"y": 340,
		"wires": [
			[]
		]
	},
	{
		"id": "d7e513f3.2c9c1",
		"type": "function",
		"z": "4aecadf2.352044",
		"name": "Get URN",
		"func": "msg.objectId = msg.payload.objectId;\nmsg.urn = msg.payload.objectId;\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 580,
		"y": 100,
		"wires": [
			[
				"ab4a41e3.e383"
			]
		]
	},
	{
		"id": "ab4a41e3.e383",
		"type": "base64",
		"z": "4aecadf2.352044",
		"name": "base64 urn",
		"action": "str",
		"property": "urn",
		"x": 730,
		"y": 100,
		"wires": [
			[
				"f378191f.bb72c8"
			]
		]
	},
	{
		"id": "f378191f.bb72c8",
		"type": "function",
		"z": "4aecadf2.352044",
		"name": "safe base64",
		"func": "msg.base64 = msg.urn;\nmsg.urn = msg.urn\n\t\t\t\t.replace (/\\+/g, '-') // Convert '+' to '-'\n\t\t\t\t.replace (/\\//g, '_') // Convert '/' to '_'\n\t\t\t\t.replace (/=+$/, '');\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 890,
		"y": 100,
		"wires": [
			[]
		]
	},
	{
		"id": "7658925d.5f746c",
		"type": "function",
		"z": "4aecadf2.352044",
		"name": "Get URN",
		"func": "msg.objectId = msg.payload.objectId;\nmsg.urn = msg.payload.objectId;\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 580,
		"y": 220,
		"wires": [
			[
				"6d3d3bd0.cea6f4"
			]
		]
	},
	{
		"id": "6d3d3bd0.cea6f4",
		"type": "base64",
		"z": "4aecadf2.352044",
		"name": "base64 urn",
		"action": "str",
		"property": "urn",
		"x": 730,
		"y": 220,
		"wires": [
			[
				"5760de98.b3949"
			]
		]
	},
	{
		"id": "5760de98.b3949",
		"type": "function",
		"z": "4aecadf2.352044",
		"name": "safe base64",
		"func": "msg.base64 = msg.urn;\nmsg.urn = msg.urn\n\t\t\t\t.replace (/\\+/g, '-') // Convert '+' to '-'\n\t\t\t\t.replace (/\\//g, '_') // Convert '/' to '_'\n\t\t\t\t.replace (/=+$/, '');\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 890,
		"y": 220,
		"wires": [
			[]
		]
	},
	{
		"id": "3f75d555.5599aa",
		"type": "subflow",
		"name": "Check or Create OSS Bucket",
		"info": "Check and Create OSS Bucket\n\n### Parameters\n\n* **bucket**: A unique name you assign to a bucket. It must be globally \n  unique across all applications and regions, otherwise the call will \n  fail. Possible values: -_.a-z0-9 (between 3-128 characters in\n  length). Note that you cannot change a bucket key.\n\n* **region** [optional]: The region where the bucket resides Acceptable values: \n  ```US```, ```EMEA``` Default: ```US```\n\n* **policyKey** [optional]: Data retention policy - Acceptable values: transient, temporary, persistent.\n  Default: ```transient```.\n\n* **forceBucketCreation** [optional] : In case the bucketKey is already used by another\n  application, you can force the node to iterate and find a name. The \n  node will append 6 random characters to the given key until it finds\n  one. Default: ```false```\n\n### Outputs\n\n* **response**: the bucket details\n\n* **error**: an error occured",
		"category": "forge",
		"in": [
			{
				"x": 60,
				"y": 340,
				"wires": [
					{
						"id": "16a24040.2a12a"
					}
				]
			}
		],
		"out": [
			{
				"x": 920,
				"y": 260,
				"wires": [
					{
						"id": "3cdeb2c8.928e2e",
						"port": 0
					},
					{
						"id": "b331344f.d4c458",
						"port": 0
					}
				]
			},
			{
				"x": 920,
				"y": 520,
				"wires": [
					{
						"id": "b331344f.d4c458",
						"port": 1
					},
					{
						"id": "29a66b9d.032624",
						"port": 1
					},
					{
						"id": "cb381637.2c08b8",
						"port": 2
					},
					{
						"id": "2f78371.5b87ac8",
						"port": 1
					}
				]
			}
		],
		"env": [
			{
				"name": "bucket",
				"type": "str",
				"value": ""
			},
			{
				"name": "region",
				"type": "str",
				"value": ""
			},
			{
				"name": "policyKey",
				"type": "str",
				"value": ""
			},
			{
				"name": "forceBucketCreation",
				"type": "bool",
				"value": "false"
			}
		],
		"outputLabels": [
			"response",
			"errors"
		],
		"icon": "node-red-node-forge/forge.png",
		"status": {
			"x": 360,
			"y": 60,
			"wires": [
				{
					"id": "9e9d5cb.1a203a",
					"port": 0
				}
			]
		}
	},
	{
		"id": "3cdeb2c8.928e2e",
		"type": "forge-oss",
		"z": "3f75d555.5599aa",
		"name": "Bucket Exists?",
		"topic": "",
		"forge": "",
		"operation": "BucketDetails",
		"raw": false,
		"all": false,
		"bucket": "",
		"bucketType": "str",
		"policyKey": "transient",
		"key": "",
		"contentType": "application/octet-stream",
		"contentDisposition": "",
		"copy": "",
		"localFilename": "",
		"limit": 10,
		"startAt": "",
		"beginsWith": "",
		"with": null,
		"ifMatch": "",
		"ifNoneMatch": "",
		"ifModifiedSince": "",
		"range": "",
		"access": "read",
		"singleUse": false,
		"minutesExpiration": 60,
		"acceptEncoding": "",
		"guid": "autodesk",
		"region": "US",
		"x": 440,
		"y": 380,
		"wires": [
			[],
			[
				"cb381637.2c08b8"
			]
		]
	},
	{
		"id": "29a66b9d.032624",
		"type": "switch",
		"z": "3f75d555.5599aa",
		"name": "",
		"property": "forceBucketCreation",
		"propertyType": "msg",
		"rules": [
			{
				"t": "true"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 390,
		"y": 260,
		"wires": [
			[
				"f9e5b5d9.40e6a8"
			],
			[]
		]
	},
	{
		"id": "f9e5b5d9.40e6a8",
		"type": "function",
		"z": "3f75d555.5599aa",
		"name": "Change Bucket Name",
		"func": "msg.originalbucket = msg.originalbucket || msg.bucket,\nmsg.bucket = \n    msg.originalbucket + \n    Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5);\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 580,
		"y": 260,
		"wires": [
			[
				"3cdeb2c8.928e2e"
			]
		]
	},
	{
		"id": "cb381637.2c08b8",
		"type": "switch",
		"z": "3f75d555.5599aa",
		"name": "Bucket Taken/Missing",
		"property": "err.statusCode",
		"propertyType": "msg",
		"rules": [
			{
				"t": "eq",
				"v": "403",
				"vt": "num"
			},
			{
				"t": "eq",
				"v": "404",
				"vt": "num"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 3,
		"x": 680,
		"y": 380,
		"wires": [
			[
				"29a66b9d.032624"
			],
			[
				"5fca92da.ce863c"
			],
			[]
		]
	},
	{
		"id": "5fca92da.ce863c",
		"type": "change",
		"z": "3f75d555.5599aa",
		"name": "Inject",
		"rules": [
			{
				"t": "delete",
				"p": "err",
				"pt": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 270,
		"y": 500,
		"wires": [
			[
				"b331344f.d4c458"
			]
		]
	},
	{
		"id": "b331344f.d4c458",
		"type": "forge-oss",
		"z": "3f75d555.5599aa",
		"name": "",
		"topic": "bucket-ok",
		"forge": "",
		"operation": "CreateBucket",
		"raw": false,
		"all": false,
		"bucket": "",
		"bucketType": "str",
		"policyKey": "transient",
		"key": "",
		"contentType": "application/octet-stream",
		"contentDisposition": "",
		"copy": "",
		"localFilename": "",
		"limit": 10,
		"startAt": "",
		"beginsWith": "",
		"with": null,
		"ifMatch": "",
		"ifNoneMatch": "",
		"ifModifiedSince": "",
		"range": "",
		"access": "read",
		"singleUse": false,
		"minutesExpiration": 60,
		"acceptEncoding": "",
		"guid": "autodesk",
		"region": "US",
		"x": 430,
		"y": 500,
		"wires": [
			[],
			[]
		]
	},
	{
		"id": "9e9d5cb.1a203a",
		"type": "status",
		"z": "3f75d555.5599aa",
		"name": "",
		"scope": null,
		"x": 240,
		"y": 60,
		"wires": [
			[]
		]
	},
	{
		"id": "2f78371.5b87ac8",
		"type": "switch",
		"z": "3f75d555.5599aa",
		"name": "Params Ok?",
		"property": "err",
		"propertyType": "msg",
		"rules": [
			{
				"t": "null"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 250,
		"y": 400,
		"wires": [
			[
				"3cdeb2c8.928e2e"
			],
			[]
		]
	},
	{
		"id": "16a24040.2a12a",
		"type": "function",
		"z": "3f75d555.5599aa",
		"name": "Inject",
		"func": "if ( msg.err )\n    delete msg.err;\n    \n//context.set / .get\n\n// Priority: payload, msg, env, default\nif ( msg.payload ) {\n    msg.bucket =msg.payload.bucket || msg.bucket || env.get ('bucket');\n    msg.region =msg.payload.region || msg.region || env.get ('region') || 'US';\n    msg.policyKey =msg.payload.policyKey || msg.policyKey || env.get ('policyKey') || 'transient';\n    msg.forceBucketCreation =false;\n    if (typeof msg.payload.forceBucketCreation === 'boolean')\n        msg.forceBucketCreation =msg.payload.forceBucketCreation === true;\n    else if (typeof msg.forceBucketCreation === 'boolean')\n        msg.forceBucketCreation =msg.forceBucketCreation === true;\n    else if (typeof env.get('forceBucketCreation') === 'boolean')\n        msg.forceBucketCreation =env.get('bucket') === true ;    \n} else {\n    msg.bucket =msg.bucket || env.get ('bucket');\n    msg.region =msg.region || env.get ('region') || 'US';\n    msg.policyKey =msg.policyKey || env.get ('policyKey') || 'transient';\n    if (typeof msg.forceBucketCreation === 'boolean')\n        msg.forceBucketCreation =msg.forceBucketCreation === true;\n    else if (typeof env.get('forceBucketCreation') === 'boolean')\n        msg.forceBucketCreation =env.get('bucket') === true ;    \n    else\n        msg.forceBucketCreation =false;\n}\n\nnode.status ({});\nif ( !msg.bucket || msg.bucket === '' || !/^[-_.a-z0-9]{3,128}$/.test(msg.bucket) ) {\n    node.status ({\n        fill: 'red',\n        shape: 'dot',\n        text: 'Invalid bucket name!'});\n    node.error('Provide a valid bucket name!');\n    delete msg.payload;\n    msg.err ={\n        reason: \"Valid field 'bucket' must be of the form  [-_.a-z0-9]{3,128}\"\n    };\n}\n    \nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 170,
		"y": 340,
		"wires": [
			[
				"2f78371.5b87ac8"
			]
		]
	},
	{
		"id": "c7ef883b.058b38",
		"type": "ui_text_input",
		"z": "497b3aa6.920134",
		"name": "",
		"label": "Width",
		"tooltip": "",
		"group": "f6b942da.65ecf",
		"order": 1,
		"width": 0,
		"height": 0,
		"passthru": true,
		"mode": "number",
		"delay": 300,
		"topic": "width",
		"x": 570,
		"y": 420,
		"wires": [
			[
				"c144c0d6.cb369"
			]
		]
	},
	{
		"id": "7676eed8.df5de",
		"type": "ui_template",
		"z": "497b3aa6.920134",
		"group": "e2baef12.fa13b",
		"name": "Forge Icon",
		"order": 5,
		"width": 0,
		"height": 0,
		"format": "<script id=\"forgeIcon\" type=\"text/javascript\">\n    var iconItem = $('ng-md-icon.ng-scope');\n    iconItem.empty();\n    $('<svg xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 59.466667 61.893333\" height=\"24\" width=\"24\" xml:space=\"preserve\" version=\"1.1\">'\n+ '  <g transform=\"matrix(1.3333333,0,0,-1.3333333,0,62.5)\">'\n+ '    <g transform=\"scale(0.1)\">'\n+ '      <path style=\"fill:#e28432;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M 442.105,320.465 C 447.809,214.57 348.117,85.207 239.188,21.9258 c 34.871,16.414 60.433,30.6133 87.101,48.6015 69.832,47.1057 126.774,150.8437 118.953,230.7537 -0.656,6.727 -1.863,12.832 -3.137,19.184\" />'\n+ '      <path style=\"fill:#e28432;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"m 236.66,222.852 -0.004,-0.004 0.004,0.004 z\" />'\n+ '      <path style=\"fill:#e28432;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"m 146.332,250.848 c 21.148,28.496 49.465,53.789 82.852,66.757 15.082,5.86 36.097,11.7 51.125,2.528 12.918,-7.887 11.093,-24.5 6.222,-36.68 5.223,13.11 -9.035,22.805 -20.496,23.598 -14.074,0.969 -33.226,-4.196 -45.832,-9.781 -27.281,-12.086 -51.168,-32.196 -71.953,-53.489 0,0 -3.551,0.473 -6.07,1.035 1.398,1.446 2.461,3.75 4.152,6.032 m 118.07,-1.321 c 1.996,2.239 3.953,4.504 5.805,6.848 -1.734,-2.211 -3.727,-4.52 -5.805,-6.848 m -32.164,-30.32 c -3.277,-2.703 -2.281,-1.883 0,0 M 417.242,389.453 C 343.277,492.773 175.805,486.594 78.9844,385.285 56.7969,362.066 25.4961,287.254 120.453,249.5 61.3477,266.285 22.8555,312.734 58.6836,369.172 31.5977,339.414 -14.8711,281.219 4.66016,246.566 27.0586,206.836 130.234,212.758 228.121,271.473 192.203,242.668 137.836,217.957 92.4766,211.879 46.5586,205.727 15.7891,213.484 1.73828,236.855 13.4219,217.988 26.3711,198.5 45.7578,186.762 c 23.5313,-14.25 52.5703,-13 78.6872,-8.211 48.918,8.969 103.828,31.543 138.528,69.375 -8.77,-9.598 -19.422,-19.395 -26.317,-25.078 -31.148,-25.684 -67.941,-44.836 -107.242,-54.368 -32.5156,-7.886 -89.9413,-15.625 -113.496,15.934 11.0429,-17.711 20.3242,-37.68 36.5625,-51.402 19.0429,-16.094 46.3008,-17.328 70.0505,-14.719 52.27,5.742 104.371,34.777 143.699,68.711 33.418,28.828 76.325,80.187 64.883,128.16 -12.707,53.281 -83.726,45.031 -122.332,30.895 -38.215,-13.996 -74.918,-41.856 -96.265,-76.961 18.695,46.347 62.605,82.898 109.562,98.269 33.668,11.02 82.789,9.387 105.781,-22.316 27.879,-38.449 8.313,-86.196 -19.218,-123.09 -30.95,-41.477 -81.715,-75.762 -128.188,-97.875 -26.004,-12.375 -54.414,-21.578 -83.3905,-22.531 -23.3711,-0.77 -51.4531,3.636 -65.6758,24.441 15.9336,-27.4022 28.0547,-54.5155 61.5,-63.1796 29.4533,-7.6289 61.1333,0.0508 89.0003,10.1875 60.625,22.0508 114.648,63.8241 153.047,115.4761 33.925,45.641 66.375,116.208 33.675,170.993 -25.148,42.136 -81.23,51.523 -126.183,46.207 -35.399,-4.188 -71.039,-15.992 -100.422,-36.426 -22.008,-15.305 -53.0899,-40.652 -57.3048,-68.887 8.6328,55.844 60.2148,94.625 110.2228,112.707 49.633,17.949 114.285,21.805 157.379,-13.875 61.301,-50.754 41.133,-131.976 6.762,-189.418 C 322.992,149.512 258.68,97.1914 194.949,68.293 150.238,48.0195 60.7578,17.293 36.9375,82.1172 48.4453,49.5195 68.1094,17.6484 102.102,5.34766 c 39.75,-14.38282 95.703,3.0039 127.164,19.58204 41.039,21.625 77.605,52.2344 109.367,85.7383 33.476,35.312 63.019,77.426 81.113,122.859 20.266,50.879 30.387,109.981 -2.504,155.926\" />'\n+ '    </g>'\n+ '  </g>'\n+ '</svg>').appendTo(iconItem);\n\n    $('div#nr-dashboard-toolbar').css({ 'background-color': '#3f3f3f' });\n</script>",
		"storeOutMessages": true,
		"fwdInMessages": true,
		"templateScope": "local",
		"x": 130,
		"y": 100,
		"wires": [
			[]
		]
	},
	{
		"id": "eac71b3c.87df48",
		"type": "ui_text_input",
		"z": "497b3aa6.920134",
		"name": "",
		"label": "Height",
		"tooltip": "",
		"group": "f6b942da.65ecf",
		"order": 2,
		"width": 0,
		"height": 0,
		"passthru": true,
		"mode": "number",
		"delay": 300,
		"topic": "height",
		"x": 570,
		"y": 480,
		"wires": [
			[
				"c144c0d6.cb369"
			]
		]
	},
	{
		"id": "6e9e89e2.695f68",
		"type": "ui_button",
		"z": "497b3aa6.920134",
		"name": "",
		"group": "f6b942da.65ecf",
		"order": 5,
		"width": 0,
		"height": 0,
		"passthru": false,
		"label": "Start WorkItem",
		"tooltip": "",
		"color": "",
		"bgcolor": "#3f3f3f",
		"icon": "",
		"payload": "",
		"payloadType": "str",
		"topic": "",
		"x": 600,
		"y": 660,
		"wires": [
			[
				"c50937fe.525ad8",
				"a8568b5f.0a59d8"
			]
		]
	},
	{
		"id": "6e5757a3.8c9778",
		"type": "ui_dropdown",
		"z": "497b3aa6.920134",
		"name": "",
		"label": "Existing activities",
		"tooltip": "",
		"place": "Select option",
		"group": "f6b942da.65ecf",
		"order": 4,
		"width": 0,
		"height": 0,
		"passthru": true,
		"options": [
			{
				"label": "",
				"value": "",
				"type": "str"
			}
		],
		"payload": "",
		"topic": "activityId",
		"x": 610,
		"y": 600,
		"wires": [
			[
				"c144c0d6.cb369"
			]
		]
	},
	{
		"id": "827bb15c.f9824",
		"type": "forge-default-credentials",
		"z": "497b3aa6.920134",
		"name": "",
		"forge": "",
		"x": 430,
		"y": 100,
		"wires": []
	},
	{
		"id": "3c01c4f.f61b83c",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "// var nickName = 'oZZ0CN7qXTGAiqSbmEhLlmYcKXt0YVoU';\n// var latestSt = '$LATEST';\n\nvar nickName = flow.get('daConst').NickName;\nvar latestSt = flow.get('daConst').Latest;\n\n// return ({\n//   var nickName = flow.get('daConst').NickName;\n// var latestSt = flow.get('daConst').Latest;\n  \n// });\n\nvar activities = msg.payload.data || [];\n\nactivities = activities\n   .filter(function (elt) { return (elt.startsWith(nickName) && elt.indexOf(latestSt) === -1); })\n   .map(function (elt) { return(elt.replace(nickName + '.', '')); })\n;\n\nvar defaultValue = activities.length === 1 ? activities[0] : null;\n\nreturn ({\n    options: activities,\n    payload: defaultValue\n});\n\n// msg.options containing an array. \n// If just text then the value will be \n// the same as the label, otherwise you \n// can specify both by using an object \n// of \"label\":\"value\"",
		"outputs": 1,
		"noerr": 0,
		"x": 450,
		"y": 600,
		"wires": [
			[
				"6e5757a3.8c9778",
				"d68254c8.4f0ba8"
			]
		]
	},
	{
		"id": "e62f5323.d2d02",
		"type": "ui_template",
		"z": "497b3aa6.920134",
		"group": "e2baef12.fa13b",
		"name": "Styling",
		"order": 6,
		"width": 0,
		"height": 0,
		"format": "<script id=\"forgeStyles\" type=\"text/javascript\">\nhtml, body, div, span, applet, object, iframe,\nh1, h2, h3, h4, h5, h6, p, blockquote, pre,\na, abbr, acronym, address, big, cite, code,\ndel, dfn, em, img, ins, kbd, q, s, samp,\nsmall, strike, strong, sub, sup, tt, var,\nb, u, i, center,\ndl, dt, dd, ol, ul, li,\nfieldset, form, label, legend,\ntable, caption, tbody, tfoot, thead, tr, th, td,\narticle, aside, canvas, details, embed, \nfigure, figcaption, footer, header, hgroup, \nmenu, nav, output, ruby, section, summary,\ntime, mark, audio, video {\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tfont-size: 100%;\n\tfont: inherit;\n\tvertical-align: baseline;\n}\n/* HTML5 display-role reset for older browsers */\narticle, aside, details, figcaption, figure, \nfooter, header, hgroup, menu, nav, section {\n\tdisplay: block;\n}\nbody {\n\tline-height: 1;\n}\nol, ul {\n\tlist-style: none;\n}\nblockquote, q {\n\tquotes: none;\n}\nblockquote:before, blockquote:after,\nq:before, q:after {\n\tcontent: '';\n\tcontent: none;\n}\ntable {\n\tborder-collapse: collapse;\n\tborder-spacing: 0;\n}\n\n$('.nr-dashboard-theme md-select-menu md-option[selected]').css({ 'background-color': '#3f3f3f !important' });\n\n// var stylesheet = document.styleSheets[0],\n//     selector = \".abc\", rule = \"{color: red}\";\n\n// if (stylesheet.insertRule) {\n//     stylesheet.insertRule(selector + rule, stylesheet.cssRules.length);\n// } else if (stylesheet.addRule) {\n//     stylesheet.addRule(selector, rule, -1);\n// }\n\ntable.trace-table {\n    color: #333;\n    font-family: Helvetica, Arial, sans-serif;\n    width: 100%;\n    border-collapse: collapse;\n    border-spacing: 0;\n    overflow-x: auto;\n    overflow-y: auto;\n}\ntable.trace-table tr td,\ntable.trace-table tr th {\n    border: 1px solid transparent;\n    /* No more visible border */\n    height: 30px;\n    transition: all 0.3s;\n    /* Simple transition for hover effect */\n}\ntable.trace-table tr th {\n    background: #DFDFDF;\n    /* Darken header a bit */\n    font-weight: bold;\n}\ntable.trace-table tr td {\n    background: #FAFAFA;\n    text-align: center;\n}\n\ntable.trace-table tr:nth-child(even) td {\n    background: gray;\n}\n\ntr:nth-child(odd) table.trace-table td {\n    background: blue;\n}\ntable.trace-table tr td:hover {\n    background: red;\n    color: yellow;\n}\n\n\n</script>",
		"storeOutMessages": true,
		"fwdInMessages": true,
		"templateScope": "local",
		"x": 270,
		"y": 100,
		"wires": [
			[]
		]
	},
	{
		"id": "e060316b.f3e54",
		"type": "ui_button",
		"z": "497b3aa6.920134",
		"name": "",
		"group": "ad5ab1f0.4158e",
		"order": 7,
		"width": 0,
		"height": 0,
		"passthru": false,
		"label": "Clear account",
		"tooltip": "",
		"color": "yellow",
		"bgcolor": "red",
		"icon": "",
		"payload": "",
		"payloadType": "str",
		"topic": "",
		"x": 620,
		"y": 880,
		"wires": [
			[
				"71751cff.64e0b4"
			]
		]
	},
	{
		"id": "71751cff.64e0b4",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "DeleteForgeApps",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [
			{
				"value": "",
				"isEnvironmentVariable": false,
				"key": "key"
			}
		],
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 720,
		"y": 920,
		"wires": [
			[
				"958d8376.4aee",
				"2b07e0f7.cec42"
			],
			[
				"bb425af1.187838"
			]
		]
	},
	{
		"id": "bb425af1.187838",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 770,
		"y": 960,
		"wires": []
	},
	{
		"id": "90452bc8.047d08",
		"type": "ui_button",
		"z": "497b3aa6.920134",
		"name": "",
		"group": "ad5ab1f0.4158e",
		"order": 6,
		"width": 0,
		"height": 0,
		"passthru": false,
		"label": "Create/Update",
		"tooltip": "",
		"color": "",
		"bgcolor": "#3f3f3f",
		"icon": "",
		"payload": "",
		"payloadType": "str",
		"topic": "",
		"x": 620,
		"y": 1260,
		"wires": [
			[
				"753f7513.6acdcc"
			]
		]
	},
	{
		"id": "d6a27bd9.453d38",
		"type": "ui_dropdown",
		"z": "497b3aa6.920134",
		"name": "",
		"label": "Engine",
		"tooltip": "",
		"place": "Select engine",
		"group": "ad5ab1f0.4158e",
		"order": 3,
		"width": 0,
		"height": 0,
		"passthru": true,
		"options": [],
		"payload": "",
		"topic": "engine",
		"x": 590,
		"y": 1060,
		"wires": [
			[
				"4355bfd6.647a6"
			]
		]
	},
	{
		"id": "918771f.48c849",
		"type": "ui_dropdown",
		"z": "497b3aa6.920134",
		"name": "",
		"label": "AppBundle",
		"tooltip": "",
		"place": "Select a local AppBundle",
		"group": "ad5ab1f0.4158e",
		"order": 1,
		"width": 0,
		"height": 0,
		"passthru": true,
		"options": [],
		"payload": "",
		"topic": "appbundlesId",
		"x": 610,
		"y": 1160,
		"wires": [
			[
				"4355bfd6.647a6"
			]
		]
	},
	{
		"id": "bd98d44.d2b3a28",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "ListEngines",
		"raw": false,
		"page": "",
		"all": true,
		"description": "",
		"alias": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [
			{
				"value": "",
				"isEnvironmentVariable": false,
				"key": "key"
			}
		],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 280,
		"y": 1060,
		"wires": [
			[
				"1b1bef73.9d5d91"
			],
			[
				"25fecc26.a3e604"
			]
		]
	},
	{
		"id": "25fecc26.a3e604",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 310,
		"y": 1100,
		"wires": []
	},
	{
		"id": "1b1bef73.9d5d91",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "var engines = msg.payload.data.sort();\n\nreturn ({\n    options: engines,\n    payload: 'Autodesk.AutoCAD+23'\n});\n\n// msg.options containing an array. \n// If just text then the value will be \n// the same as the label, otherwise you \n// can specify both by using an object \n// of \"label\":\"value\"",
		"outputs": 1,
		"noerr": 0,
		"x": 450,
		"y": 1060,
		"wires": [
			[
				"d6a27bd9.453d38"
			]
		]
	},
	{
		"id": "39417852.fd4d78",
		"type": "readdir",
		"z": "497b3aa6.920134",
		"name": "",
		"dir": "/Users/cyrille/Projects/forge-rsdk-codegen/samples/",
		"as": "single",
		"recursive": false,
		"outproperty": "payload",
		"x": 260,
		"y": 1160,
		"wires": [
			[
				"19f8ae37.a54cc2"
			]
		]
	},
	{
		"id": "19f8ae37.a54cc2",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "var bundles = msg.payload || [];\n\nbundles = bundles\n  .filter(function (elt) { return (elt.endsWith('.zip')); })\n  .map(function (elt) { return(elt.substring(elt.lastIndexOf('/') + 1)); })\n  .map(function (elt) { return(elt.replace('.zip', '')); })\n;\n\nvar defaultValue = bundles.length === 1 ? bundles[0] : null;\n\nreturn ({\n    options: bundles,\n    payload: defaultValue\n});\n\n// msg.options containing an array. \n// If just text then the value will be \n// the same as the label, otherwise you \n// can specify both by using an object \n// of \"label\":\"value\"",
		"outputs": 1,
		"noerr": 0,
		"x": 450,
		"y": 1160,
		"wires": [
			[
				"918771f.48c849"
			]
		]
	},
	{
		"id": "ebbb2db5.10d58",
		"type": "ui_text",
		"z": "497b3aa6.920134",
		"group": "ad5ab1f0.4158e",
		"order": 4,
		"width": "0",
		"height": "0",
		"name": "App Bundle Zip info",
		"label": "",
		"format": "For this sample the .ZIP name is used as suffix to define <b>AppBundle</b> and <b>Activity</b>                     names. Activities will have file and params input, and file output.",
		"layout": "row-left",
		"x": 640,
		"y": 1120,
		"wires": []
	},
	{
		"id": "60196352.097c3c",
		"type": "ui_text",
		"z": "497b3aa6.920134",
		"group": "ad5ab1f0.4158e",
		"order": 2,
		"width": "0",
		"height": "0",
		"name": "Tip",
		"label": "",
		"format": "<b>Tip:</b> Make sure .ZIP bundles are placed at <b>/bundles/</b> folder",
		"layout": "row-left",
		"x": 590,
		"y": 1020,
		"wires": []
	},
	{
		"id": "48bbe854.de9bd8",
		"type": "ui_ui_control",
		"z": "497b3aa6.920134",
		"name": "",
		"events": "all",
		"x": 460,
		"y": 760,
		"wires": [
			[]
		]
	},
	{
		"id": "d68254c8.4f0ba8",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "var tab = !msg.options || msg.options.length === 0 ? 'Configure' : 'Design Automation';\n\nreturn ({\n    payload: { tab: tab }\n});",
		"outputs": 1,
		"noerr": 0,
		"x": 330,
		"y": 760,
		"wires": [
			[
				"48bbe854.de9bd8",
				"3db7f2e4.ae08de"
			]
		]
	},
	{
		"id": "4355bfd6.647a6",
		"type": "join",
		"z": "497b3aa6.920134",
		"name": "",
		"mode": "custom",
		"build": "object",
		"property": "payload",
		"propertyType": "msg",
		"key": "topic",
		"joiner": "\\n",
		"joinerType": "str",
		"accumulate": true,
		"timeout": "",
		"count": "1",
		"reduceRight": false,
		"reduceExp": "",
		"reduceInit": "",
		"reduceInitType": "",
		"reduceFixup": "",
		"x": 810,
		"y": 1060,
		"wires": [
			[
				"48240e51.bb6b2"
			]
		]
	},
	{
		"id": "48240e51.bb6b2",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "daConfig",
				"pt": "flow",
				"to": "payload",
				"tot": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 970,
		"y": 1060,
		"wires": [
			[]
		]
	},
	{
		"id": "ab3f8ef8.203bd",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 990,
		"y": 1260,
		"wires": []
	},
	{
		"id": "958d8376.4aee",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "return ({\n    payload: { tab: 'Configure' }\n});",
		"outputs": 1,
		"noerr": 0,
		"x": 910,
		"y": 920,
		"wires": [
			[
				"59e3ffd9.2d12f"
			]
		]
	},
	{
		"id": "59e3ffd9.2d12f",
		"type": "ui_ui_control",
		"z": "497b3aa6.920134",
		"name": "",
		"events": "all",
		"x": 1040,
		"y": 920,
		"wires": [
			[]
		]
	},
	{
		"id": "4ce571ce.27367",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "ListActivities",
		"raw": false,
		"page": "",
		"all": true,
		"description": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [
			{
				"value": "",
				"isEnvironmentVariable": false,
				"key": "key"
			}
		],
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 300,
		"y": 600,
		"wires": [
			[
				"3c01c4f.f61b83c"
			],
			[
				"59e64923.401848"
			]
		]
	},
	{
		"id": "d409c5dd.a77b08",
		"type": "inject",
		"z": "497b3aa6.920134",
		"name": "Start",
		"topic": "",
		"payload": "",
		"payloadType": "date",
		"repeat": "",
		"crontab": "",
		"once": true,
		"onceDelay": 0.1,
		"x": 110,
		"y": 140,
		"wires": [
			[
				"e2a671c4.a50fc"
			]
		]
	},
	{
		"id": "78eef79f.e4d0a8",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "ListAppbundles",
		"raw": false,
		"page": "",
		"all": true,
		"description": "",
		"alias": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [
			{
				"value": "",
				"isEnvironmentVariable": false,
				"key": "key"
			}
		],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 430,
		"y": 1500,
		"wires": [
			[
				"8dba664c.d11a68"
			],
			[
				"9ca8ce75.6046a"
			]
		]
	},
	{
		"id": "9ca8ce75.6046a",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 470,
		"y": 1540,
		"wires": []
	},
	{
		"id": "36ea01a6.21aa8e",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "BundleSpec",
		"rules": [
			{
				"t": "set",
				"p": "payload.package",
				"pt": "msg",
				"to": "payload.appbundlesId & \"AppBundle\"",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "payload.id",
				"pt": "msg",
				"to": "payload.package",
				"tot": "msg"
			},
			{
				"t": "set",
				"p": "payload.description",
				"pt": "msg",
				"to": "\"Description for \" & payload.package",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "payload.zipFileName",
				"pt": "msg",
				"to": "$string($flowContext(\"daConst\").BundlesPath)\t& payload.appbundlesId \t& '.zip'",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "payload.qualifiedAppBundleId",
				"pt": "msg",
				"to": "$string($flowContext(\"daConst\").NickName) \t& '.' & payload.package\t& '+' & $string($flowContext(\"daConst\").Alias)",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "payload.bundles",
				"pt": "msg",
				"to": "payload.qualifiedAppBundleId",
				"tot": "msg"
			},
			{
				"t": "set",
				"p": "payload.appbundlesId",
				"pt": "msg",
				"to": "payload.id",
				"tot": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 450,
		"y": 1420,
		"wires": [
			[
				"78eef79f.e4d0a8",
				"8dba664c.d11a68",
				"34bb04ab.f9644c"
			]
		]
	},
	{
		"id": "8dba664c.d11a68",
		"type": "join",
		"z": "497b3aa6.920134",
		"name": "",
		"mode": "custom",
		"build": "array",
		"property": "payload",
		"propertyType": "msg",
		"key": "topic",
		"joiner": "\\n",
		"joinerType": "str",
		"accumulate": false,
		"timeout": "",
		"count": "2",
		"reduceRight": false,
		"reduceExp": "",
		"reduceInit": "",
		"reduceInitType": "",
		"reduceFixup": "",
		"x": 650,
		"y": 1540,
		"wires": [
			[
				"43318aa8.a647f4",
				"3b26c3ec.1f69dc"
			]
		]
	},
	{
		"id": "43318aa8.a647f4",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 1540,
		"wires": []
	},
	{
		"id": "3b26c3ec.1f69dc",
		"type": "switch",
		"z": "497b3aa6.920134",
		"name": "",
		"property": "payload[1].data",
		"propertyType": "msg",
		"rules": [
			{
				"t": "cont",
				"v": "payload[0].qualifiedAppBundleId",
				"vt": "msg"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 210,
		"y": 1660,
		"wires": [
			[
				"dd576bef.8c11e8"
			],
			[
				"2d16f144.bf901e"
			]
		]
	},
	{
		"id": "92b38bd5.b749a8",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 1900,
		"wires": []
	},
	{
		"id": "1e536f70.6e9401",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "CreateAppbundles",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"alias": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 520,
		"y": 1920,
		"wires": [
			[
				"92b38bd5.b749a8",
				"61f80968.df31f8",
				"bb9fce.376db03"
			],
			[
				"41e718e6.0357a8"
			]
		]
	},
	{
		"id": "2d16f144.bf901e",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "payload",
				"pt": "msg",
				"to": "payload[0]",
				"tot": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 460,
		"y": 1880,
		"wires": [
			[
				"1e536f70.6e9401",
				"b4b7d23d.7963f"
			]
		]
	},
	{
		"id": "41e718e6.0357a8",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 1940,
		"wires": []
	},
	{
		"id": "b56ac3b3.80ce3",
		"type": "file in",
		"z": "497b3aa6.920134",
		"name": "Bundle",
		"filename": "",
		"format": "",
		"chunk": false,
		"sendError": false,
		"encoding": "none",
		"x": 320,
		"y": 2140,
		"wires": [
			[
				"61f80968.df31f8"
			]
		]
	},
	{
		"id": "60b23529.1e75ec",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "set payload and headers",
		"func": "var buffer =msg.payload[0];\nvar uploadParameters =msg.payload[1];\nif (!uploadParameters.hasOwnProperty('uploadParameters')) {\n    buffer =msg.payload[1];\n    uploadParameters =msg.payload[2];\n}\nuploadParameters =uploadParameters.uploadParameters;\n\nmsg.url = uploadParameters.endpointURL;\n//msg.headers = uploadParameters.formData;\nmsg.headers = {\n    'Content-Type': 'multipart/form-data'\n};\nmsg.payload = uploadParameters.formData;\nmsg.payload.file = buffer;\n \nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 350,
		"y": 2200,
		"wires": [
			[
				"cbd88395.59a65"
			]
		]
	},
	{
		"id": "61f80968.df31f8",
		"type": "join",
		"z": "497b3aa6.920134",
		"name": "",
		"mode": "custom",
		"build": "array",
		"property": "payload",
		"propertyType": "msg",
		"key": "topic",
		"joiner": "\\n",
		"joinerType": "str",
		"accumulate": false,
		"timeout": "",
		"count": "2",
		"reduceRight": false,
		"reduceExp": "",
		"reduceInit": "",
		"reduceInitType": "",
		"reduceFixup": "",
		"x": 530,
		"y": 2120,
		"wires": [
			[
				"60b23529.1e75ec",
				"dc3b0b9a.fb5238"
			]
		]
	},
	{
		"id": "cbd88395.59a65",
		"type": "http request",
		"z": "497b3aa6.920134",
		"name": "to S3",
		"method": "POST",
		"ret": "obj",
		"paytoqs": false,
		"url": "",
		"tls": "",
		"proxy": "",
		"authType": "basic",
		"x": 550,
		"y": 2200,
		"wires": [
			[
				"52902a5c.abf8a4"
			]
		]
	},
	{
		"id": "b4b7d23d.7963f",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "filename",
				"pt": "msg",
				"to": "payload.zipFileName",
				"tot": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 310,
		"y": 2100,
		"wires": [
			[
				"b56ac3b3.80ce3"
			]
		]
	},
	{
		"id": "52902a5c.abf8a4",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2200,
		"wires": []
	},
	{
		"id": "bb9fce.376db03",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "appbundlesId",
				"pt": "msg",
				"to": "payload.id",
				"tot": "msg"
			},
			{
				"t": "set",
				"p": "alias",
				"pt": "msg",
				"to": "daConst.Alias",
				"tot": "flow"
			},
			{
				"t": "set",
				"p": "version",
				"pt": "msg",
				"to": "1",
				"tot": "num"
			},
			{
				"t": "delete",
				"p": "payload.uploadParameters",
				"pt": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 460,
		"y": 1980,
		"wires": [
			[
				"e958df76.fd2f"
			]
		]
	},
	{
		"id": "e958df76.fd2f",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "Create Alias",
		"topic": "",
		"forge": "",
		"operation": "CreateAppbundlesAlias",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"alias": "",
		"version": "",
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [
			{
				"value": "",
				"isEnvironmentVariable": false,
				"key": "key"
			}
		],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 490,
		"y": 2020,
		"wires": [
			[
				"8874e4c3.a72c78",
				"1cc310d2.9fc1cf"
			],
			[
				"25ebc133.23129e"
			]
		]
	},
	{
		"id": "8874e4c3.a72c78",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2000,
		"wires": []
	},
	{
		"id": "34bb04ab.f9644c",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 1420,
		"wires": []
	},
	{
		"id": "25ebc133.23129e",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2040,
		"wires": []
	},
	{
		"id": "dc3b0b9a.fb5238",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2120,
		"wires": []
	},
	{
		"id": "4bc33364.db46ec",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "Create Version",
		"topic": "",
		"forge": "",
		"operation": "CreateAppbundlesVersion",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"alias": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "$(engine.path)\\accoreconsole.exe /i test /al $(appbundles[UpdateDWGParamAppBundle].path) /s script",
		"parameters": [],
		"settings": [],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 520,
		"y": 1700,
		"wires": [
			[
				"f63ed2c3.9704d",
				"61f80968.df31f8",
				"c84677e7.868d68"
			],
			[
				"dcdd18c2.647228"
			]
		]
	},
	{
		"id": "f63ed2c3.9704d",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 1680,
		"wires": []
	},
	{
		"id": "dcdd18c2.647228",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 1720,
		"wires": []
	},
	{
		"id": "dd576bef.8c11e8",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "payload",
				"pt": "msg",
				"to": "payload[0]",
				"tot": "msg"
			},
			{
				"t": "delete",
				"p": "payload.package",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "payload.version",
				"pt": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 460,
		"y": 1660,
		"wires": [
			[
				"4bc33364.db46ec",
				"b4b7d23d.7963f"
			]
		]
	},
	{
		"id": "3f3ffa7e.2bd346",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Upload bundle to S3",
		"info": "",
		"x": 190,
		"y": 2060,
		"wires": []
	},
	{
		"id": "a3f3c883.925c88",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Create our bundle and alias",
		"info": "",
		"x": 500,
		"y": 1840,
		"wires": []
	},
	{
		"id": "9b1f8810.0cc9e8",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Does our bundle exists?",
		"info": "",
		"x": 210,
		"y": 1620,
		"wires": []
	},
	{
		"id": "13f54657.1e3fca",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Create a new version and change alias",
		"info": "",
		"x": 530,
		"y": 1620,
		"wires": []
	},
	{
		"id": "e69546dd.190498",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Prepare data",
		"info": "",
		"x": 450,
		"y": 1380,
		"wires": []
	},
	{
		"id": "ccf6c473.608618",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Get bundles list",
		"info": "",
		"x": 420,
		"y": 1460,
		"wires": []
	},
	{
		"id": "5d0616ef.6dfc68",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "Update Alias",
		"topic": "",
		"forge": "",
		"operation": "UpdateAppbundlesAlias",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"alias": "",
		"version": "",
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [
			{
				"value": "",
				"isEnvironmentVariable": false,
				"key": "key"
			}
		],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 510,
		"y": 1780,
		"wires": [
			[
				"2fabb27.1147e4e",
				"1cc310d2.9fc1cf"
			],
			[
				"391bb8ce.955a38"
			]
		]
	},
	{
		"id": "2fabb27.1147e4e",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 1760,
		"wires": []
	},
	{
		"id": "391bb8ce.955a38",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 1800,
		"wires": []
	},
	{
		"id": "c84677e7.868d68",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "appbundlesId",
				"pt": "msg",
				"to": "payload.id",
				"tot": "msg"
			},
			{
				"t": "set",
				"p": "alias",
				"pt": "msg",
				"to": "daConst.Alias",
				"tot": "flow"
			},
			{
				"t": "delete",
				"p": "payload.uploadParameters",
				"pt": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 460,
		"y": 1740,
		"wires": [
			[
				"5d0616ef.6dfc68"
			]
		]
	},
	{
		"id": "753f7513.6acdcc",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "get flow.daConfig",
		"rules": [
			{
				"t": "set",
				"p": "payload",
				"pt": "msg",
				"to": "daConfig",
				"tot": "flow"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 830,
		"y": 1260,
		"wires": [
			[
				"ab3f8ef8.203bd",
				"36ea01a6.21aa8e"
			]
		]
	},
	{
		"id": "e2a671c4.a50fc",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "daConst.webhookURL",
				"pt": "flow",
				"to": "http://05f539e9.ngrok.io",
				"tot": "str"
			},
			{
				"t": "set",
				"p": "daConst.webhookPath",
				"pt": "flow",
				"to": "/api/forge/callback/designautomation",
				"tot": "str"
			},
			{
				"t": "set",
				"p": "daConst.NickName",
				"pt": "flow",
				"to": "oZZ0CN7qXTGAiqSbmEhLlmYcKXt0YVoU",
				"tot": "str"
			},
			{
				"t": "set",
				"p": "daConst.Latest",
				"pt": "flow",
				"to": "$LATEST",
				"tot": "str"
			},
			{
				"t": "set",
				"p": "daConst.Alias",
				"pt": "flow",
				"to": "dev",
				"tot": "str"
			},
			{
				"t": "set",
				"p": "daConst.BundlesPath",
				"pt": "flow",
				"to": "/Users/cyrille/Projects/forge-rsdk-codegen/samples/",
				"tot": "str"
			},
			{
				"t": "set",
				"p": "daConst.Bucket",
				"pt": "flow",
				"to": "$lowercase($flowContext('daConst').NickName & '-designautomation')\t",
				"tot": "jsonata"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 260,
		"y": 140,
		"wires": [
			[
				"b8763fd0.d7443"
			]
		]
	},
	{
		"id": "2b07e0f7.cec42",
		"type": "delay",
		"z": "497b3aa6.920134",
		"name": "",
		"pauseType": "delay",
		"timeout": "15",
		"timeoutUnits": "seconds",
		"rate": "1",
		"nbRateUnits": "1",
		"rateUnits": "second",
		"randomFirst": "1",
		"randomLast": "5",
		"randomUnits": "seconds",
		"drop": false,
		"x": 920,
		"y": 880,
		"wires": [
			[
				"4ce571ce.27367"
			]
		]
	},
	{
		"id": "93beb685.ec0238",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "*** Create AppBundle ***",
		"info": "",
		"x": 170,
		"y": 1360,
		"wires": []
	},
	{
		"id": "d40e3401.4e5c18",
		"type": "ui_text",
		"z": "497b3aa6.920134",
		"group": "ad5ab1f0.4158e",
		"order": 5,
		"width": "1",
		"height": "1",
		"name": "Spacer",
		"label": "",
		"format": "",
		"layout": "row-left",
		"x": 600,
		"y": 1220,
		"wires": []
	},
	{
		"id": "7892ff55.96edc",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "*** Create Activity ***",
		"info": "",
		"x": 150,
		"y": 2300,
		"wires": []
	},
	{
		"id": "45c0712f.7018f",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Prepare data",
		"info": "",
		"x": 450,
		"y": 2360,
		"wires": []
	},
	{
		"id": "1cc310d2.9fc1cf",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "ActivitySpec",
		"rules": [
			{
				"t": "set",
				"p": "appBundleName",
				"pt": "msg",
				"to": "$match(msg.appbundlesId, /^.*\\.(.*)$/).groups[0]",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "id",
				"pt": "msg",
				"to": "$match(msg.appbundlesId, /^.*\\.(.*)AppBundle$/).groups[0]\t& \"Activity\"",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "NickName",
				"pt": "msg",
				"to": "$match(msg.appbundlesId, /^(.*)\\.(.*)$/).groups[0]\t",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "qualifiedActivityId",
				"pt": "msg",
				"to": "msg.NickName\t& '.' & msg.id\t& '+' & msg.alias",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "description",
				"pt": "msg",
				"to": "\"Description for \" & msg.id",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "engine",
				"pt": "msg",
				"to": "daConfig.engine",
				"tot": "flow"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 450,
		"y": 2400,
		"wires": [
			[
				"6cf4c5fc.f92a2c"
			]
		]
	},
	{
		"id": "b8fe9fc4.42a6d",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Get activity list",
		"info": "",
		"x": 420,
		"y": 2440,
		"wires": []
	},
	{
		"id": "fde0d6b3.bc3648",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "ListActivities",
		"raw": false,
		"page": "",
		"all": true,
		"description": "",
		"alias": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [
			{
				"value": "",
				"isEnvironmentVariable": false,
				"key": "key"
			}
		],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 420,
		"y": 2480,
		"wires": [
			[
				"f5c725a9.82a9e8"
			],
			[
				"5a0b583e.d05c98"
			]
		]
	},
	{
		"id": "5a0b583e.d05c98",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 450,
		"y": 2520,
		"wires": []
	},
	{
		"id": "7b7055b9.bba14c",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2400,
		"wires": []
	},
	{
		"id": "f5c725a9.82a9e8",
		"type": "join",
		"z": "497b3aa6.920134",
		"name": "",
		"mode": "custom",
		"build": "array",
		"property": "payload",
		"propertyType": "msg",
		"key": "topic",
		"joiner": "\\n",
		"joinerType": "str",
		"accumulate": false,
		"timeout": "",
		"count": "2",
		"reduceRight": false,
		"reduceExp": "",
		"reduceInit": "",
		"reduceInitType": "",
		"reduceFixup": "",
		"x": 650,
		"y": 2520,
		"wires": [
			[
				"96ae3e30.9b644",
				"69178c88.585144"
			]
		]
	},
	{
		"id": "96ae3e30.9b644",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2520,
		"wires": []
	},
	{
		"id": "60a903c0.de546c",
		"type": "inject",
		"z": "497b3aa6.920134",
		"name": "Create AppBundle Msg",
		"topic": "",
		"payload": "{\"payload\":{\"version\":1,\"id\":\"dev\"},\"socketid\":\"O7mWxu4-FHeXVOATAAAB\",\"_msgid\":\"9fadc501.1a5c38\",\"op\":\"da:CreateAppbundlesAlias\",\"appbundlesId\":\"oZZ0CN7qXTGAiqSbmEhLlmYcKXt0YVoU.UpdateDWGParamAppBundle\",\"alias\":\"dev\",\"version\":1}",
		"payloadType": "json",
		"repeat": "",
		"crontab": "",
		"once": false,
		"onceDelay": 0.1,
		"x": 160,
		"y": 2380,
		"wires": [
			[
				"538c05a4.8a215c"
			]
		]
	},
	{
		"id": "e4a9d8ff.ec3ac8",
		"type": "inject",
		"z": "497b3aa6.920134",
		"name": "Update AppBundle Msg",
		"topic": "",
		"payload": "{\"payload\":{\"version\":2,\"id\":\"dev\"},\"socketid\":\"H4lzLbxTmB1_8xCUAAAD\",\"_msgid\":\"73db72d0.10406c\",\"op\":\"da:UpdateAppbundlesAlias\",\"appbundlesId\":\"oZZ0CN7qXTGAiqSbmEhLlmYcKXt0YVoU.UpdateDWGParamAppBundle\",\"alias\":\"dev\"}",
		"payloadType": "json",
		"repeat": "",
		"crontab": "",
		"once": false,
		"onceDelay": 0.1,
		"x": 170,
		"y": 2420,
		"wires": [
			[
				"538c05a4.8a215c"
			]
		]
	},
	{
		"id": "6631247.c2779dc",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 190,
		"y": 2500,
		"wires": []
	},
	{
		"id": "6cf4c5fc.f92a2c",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "function EngineAttributes(engine) {\n\tif (engine.includes('3dsMax'))\n\t\treturn ({\n\t\t\tcommandLine: '$(engine.path)\\\\3dsmaxbatch.exe -sceneFile $(args[inputFile].path) $(settings[script].path)',\n\t\t\textension: 'max',\n\t\t\tscript: \"da = dotNetClass(\\'Autodesk.Forge.Sample.DesignAutomation.Max.RuntimeExecute\\')\\nda.ModifyWindowWidthHeight()\\n\"\n\t\t});\n\tif (engine.includes('AutoCAD'))\n\t\treturn ({\n\t\t\tcommandLine: '$(engine.path)\\\\accoreconsole.exe /i $(args[inputFile].path) /al $(appbundles[{0}].path) /s $(settings[script].path)',\n\t\t\textension: 'dwg',\n\t\t\tscript: \"UpdateParam\\n\"\n\t\t});\n\tif (engine.includes('Inventor'))\n\t\treturn ({\n\t\t\tcommandLine: '$(engine.path)\\\\InventorCoreConsole.exe /i $(args[inputFile].path) /al $(appbundles[{0}].path)',\n\t\t\textension: 'ipt',\n\t\t\tscript: ''\n\t\t});\n\tif (engine.includes('Revit'))\n\t\treturn ({\n\t\t\tcommandLine: '$(engine.path)\\\\revitcoreconsole.exe /i $(args[inputFile].path) /al $(appbundles[{0}].path)',\n\t\t\textension: 'rvt',\n\t\t\tscript: ''\n\t\t});\n\n\tthrow new Error('Invalid engine');\n}\n\nvar engineAttributes =EngineAttributes(msg.engine);\nmsg.commandline = engineAttributes.commandLine.replace('{0}', msg.appBundleName);\n\nmsg.activityId = msg.id;\nmsg.appbundles = msg.NickName + '.' + msg.appBundleName + '+' + msg.alias;\nmsg.parameters = [\n\t{\n\t\tdescription: 'input file',\n\t\tlocalName: '$(inputFile)',\n\t\tondemand: false,\n\t\trequired: true,\n\t\tverb: 'get',\n\t\tzip: false,\n\t\tid: 'inputFile'\n\t},\n\t{\n\t\tdescription: 'input json',\n\t\tlocalName: 'params.json',\n\t\tondemand: false,\n\t\trequired: false,\n\t\tverb: 'get',\n\t\tzip: false,\n\t\tid: 'inputJson'\n\t},\n\t{\n\t\tdescription: 'output file',\n\t\tlocalName: 'outputFile.' + engineAttributes.extension,\n\t\tondemand: false,\n\t\trequired: true,\n\t\tverb: 'put',\n\t\tzip: false,\n\t\tid: 'outputFile'\n\t}\n];\nmsg.settings = [\n\t{\n\t    key: 'script',\n\t\tvalue: engineAttributes.script\n\t}\n];\n\t\t\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 620,
		"y": 2400,
		"wires": [
			[
				"7b7055b9.bba14c",
				"f5c725a9.82a9e8",
				"fde0d6b3.bc3648"
			]
		]
	},
	{
		"id": "538c05a4.8a215c",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "return msg.payload;",
		"outputs": 1,
		"noerr": 0,
		"x": 190,
		"y": 2460,
		"wires": [
			[
				"6631247.c2779dc",
				"1cc310d2.9fc1cf"
			]
		]
	},
	{
		"id": "658613da.2732ec",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Below is for testing",
		"info": "",
		"x": 170,
		"y": 2340,
		"wires": []
	},
	{
		"id": "d4ccd28d.37ddb",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Does our activity exists?",
		"info": "",
		"x": 210,
		"y": 2660,
		"wires": []
	},
	{
		"id": "69178c88.585144",
		"type": "switch",
		"z": "497b3aa6.920134",
		"name": "",
		"property": "payload[1].data",
		"propertyType": "msg",
		"rules": [
			{
				"t": "cont",
				"v": "qualifiedActivityId",
				"vt": "msg"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 210,
		"y": 2700,
		"wires": [
			[
				"94593c38.55864",
				"ecbac369.03886"
			],
			[
				"d8d991b8.491b2"
			]
		]
	},
	{
		"id": "90d60fab.cc5f3",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Create our activity and alias",
		"info": "",
		"x": 500,
		"y": 2720,
		"wires": []
	},
	{
		"id": "d8d991b8.491b2",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "delete",
				"p": "payload",
				"pt": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 470,
		"y": 2760,
		"wires": [
			[
				"6f36a04f.02fe3",
				"376b1c26.953f44"
			]
		]
	},
	{
		"id": "6f36a04f.02fe3",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "CreateActivity",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"alias": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [],
		"settings": [],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 510,
		"y": 2800,
		"wires": [
			[
				"e19758ad.0ece08",
				"c952ed0c.789d"
			],
			[
				"eb659ecb.9cdce"
			]
		]
	},
	{
		"id": "e19758ad.0ece08",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2780,
		"wires": []
	},
	{
		"id": "eb659ecb.9cdce",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2820,
		"wires": []
	},
	{
		"id": "94593c38.55864",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2680,
		"wires": []
	},
	{
		"id": "c4d0e74e.50d358",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "We are all good :)",
		"info": "as this activity points to a AppBundle\n\"dev\" alias (which points to the last version\nof the bundle),\nthere is no need to update it (for this sample),\nbut this may be extended for different\ncontexts",
		"x": 460,
		"y": 2660,
		"wires": []
	},
	{
		"id": "c952ed0c.789d",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "activityId",
				"pt": "msg",
				"to": "payload.id",
				"tot": "msg"
			},
			{
				"t": "set",
				"p": "alias",
				"pt": "msg",
				"to": "daConst.Alias",
				"tot": "flow"
			},
			{
				"t": "set",
				"p": "version",
				"pt": "msg",
				"to": "1",
				"tot": "num"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 460,
		"y": 2860,
		"wires": [
			[
				"76af3055.9547b",
				"e68ec6b2.fff948"
			]
		]
	},
	{
		"id": "76af3055.9547b",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "Create Alias",
		"topic": "",
		"forge": "",
		"operation": "CreateActivityAlias",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"alias": "",
		"version": "",
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [
			{
				"value": "",
				"isEnvironmentVariable": false,
				"key": "key"
			}
		],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"x": 490,
		"y": 2900,
		"wires": [
			[
				"e68ec6b2.fff948",
				"ecbac369.03886",
				"4ce571ce.27367"
			],
			[
				"f398eac7.7f0f28"
			]
		]
	},
	{
		"id": "e68ec6b2.fff948",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2880,
		"wires": []
	},
	{
		"id": "f398eac7.7f0f28",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2920,
		"wires": []
	},
	{
		"id": "376b1c26.953f44",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 850,
		"y": 2740,
		"wires": []
	},
	{
		"id": "e8e9b898.0fb358",
		"type": "ui_ui_control",
		"z": "497b3aa6.920134",
		"name": "",
		"events": "all",
		"x": 580,
		"y": 3000,
		"wires": [
			[]
		]
	},
	{
		"id": "ecbac369.03886",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "return ({\n    payload: { tab: 'Design Automation' }\n});",
		"outputs": 1,
		"noerr": 0,
		"x": 450,
		"y": 3000,
		"wires": [
			[
				"e8e9b898.0fb358"
			]
		]
	},
	{
		"id": "3db7f2e4.ae08de",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 330,
		"y": 800,
		"wires": []
	},
	{
		"id": "bf0fa088.c735c",
		"type": "ui_ui_control",
		"z": "497b3aa6.920134",
		"name": "Connect",
		"events": "connect",
		"x": 80,
		"y": 420,
		"wires": [
			[
				"4ce571ce.27367",
				"bd98d44.d2b3a28",
				"39417852.fd4d78",
				"60cfbe03.e2b5",
				"c7ef883b.058b38",
				"eac71b3c.87df48"
			]
		]
	},
	{
		"id": "10102da9.04dc82",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "*** Start WorkItem ***",
		"info": "",
		"x": 1260,
		"y": 300,
		"wires": []
	},
	{
		"id": "c144c0d6.cb369",
		"type": "join",
		"z": "497b3aa6.920134",
		"name": "",
		"mode": "custom",
		"build": "object",
		"property": "payload",
		"propertyType": "msg",
		"key": "topic",
		"joiner": "\\n",
		"joinerType": "str",
		"accumulate": true,
		"timeout": "",
		"count": "1",
		"reduceRight": false,
		"reduceExp": "",
		"reduceInit": "",
		"reduceInitType": "",
		"reduceFixup": "",
		"x": 790,
		"y": 520,
		"wires": [
			[
				"32da51d2.81fe8e"
			]
		]
	},
	{
		"id": "32da51d2.81fe8e",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "daWorkItem",
				"pt": "flow",
				"to": "payload",
				"tot": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 960,
		"y": 520,
		"wires": [
			[
				"b58817f6.26f1f8"
			]
		]
	},
	{
		"id": "c50937fe.525ad8",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "get flow.daWorkItem",
		"rules": [
			{
				"t": "set",
				"p": "payload",
				"pt": "msg",
				"to": "daWorkItem",
				"tot": "flow"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 820,
		"y": 660,
		"wires": [
			[
				"b767d3e.8515a3",
				"2f6f15a5.660e0a"
			]
		]
	},
	{
		"id": "b767d3e.8515a3",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1010,
		"y": 660,
		"wires": []
	},
	{
		"id": "60cfbe03.e2b5",
		"type": "readdir",
		"z": "497b3aa6.920134",
		"name": "",
		"dir": "/Users/cyrille/Projects/forge-rsdk-codegen/samples/",
		"as": "single",
		"recursive": false,
		"outproperty": "payload",
		"x": 320,
		"y": 500,
		"wires": [
			[
				"67b8da73.5447c4"
			]
		]
	},
	{
		"id": "67b8da73.5447c4",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "var bundles = msg.payload || [];\n\nbundles = bundles\n  .filter(function (elt) { return (elt.endsWith('.dwg') || elt.endsWith('.rvt') || elt.endsWith('.ipt')); })\n  .map(function (elt) { return(elt.substring(elt.lastIndexOf('/') + 1)); })\n;\n\nvar defaultValue = bundles.length === 1 ? bundles[0] : null;\n\nreturn ({\n    options: bundles,\n    payload: defaultValue\n});\n\n// msg.options containing an array. \n// If just text then the value will be \n// the same as the label, otherwise you \n// can specify both by using an object \n// of \"label\":\"value\"",
		"outputs": 1,
		"noerr": 0,
		"x": 330,
		"y": 540,
		"wires": [
			[
				"bc28aa31.240f38"
			]
		]
	},
	{
		"id": "cb6f9e24.3eb8e",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "*** Configure Panel ***",
		"info": "",
		"x": 160,
		"y": 860,
		"wires": []
	},
	{
		"id": "59e64923.401848",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 330,
		"y": 640,
		"wires": []
	},
	{
		"id": "58c25d69.795584",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "*** Initialization ***",
		"info": "",
		"x": 150,
		"y": 40,
		"wires": []
	},
	{
		"id": "bc28aa31.240f38",
		"type": "ui_dropdown",
		"z": "497b3aa6.920134",
		"name": "",
		"label": "File",
		"tooltip": "",
		"place": "Select option",
		"group": "f6b942da.65ecf",
		"order": 3,
		"width": 0,
		"height": 0,
		"passthru": true,
		"options": [],
		"payload": "",
		"topic": "file",
		"x": 570,
		"y": 540,
		"wires": [
			[
				"c144c0d6.cb369"
			]
		]
	},
	{
		"id": "bd32592a.ca5f08",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Prepare data",
		"info": "",
		"x": 1310,
		"y": 360,
		"wires": []
	},
	{
		"id": "2f6f15a5.660e0a",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "WorkItemSpec",
		"rules": [
			{
				"t": "set",
				"p": "activityId",
				"pt": "msg",
				"to": "$flowContext('daConst').NickName & '.' & payload.activityId",
				"tot": "jsonata"
			},
			{
				"t": "delete",
				"p": "payload.activityId",
				"pt": "msg"
			},
			{
				"t": "set",
				"p": "bucket",
				"pt": "msg",
				"to": "$lowercase(\t    $flowContext('daConst').NickName\t    & \"-designautomation\"\t)",
				"tot": "jsonata"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 1320,
		"y": 400,
		"wires": [
			[
				"c71893fc.60d45"
			]
		]
	},
	{
		"id": "67533bea.b52944",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Upload sample file to OSS",
		"info": "",
		"x": 1350,
		"y": 440,
		"wires": []
	},
	{
		"id": "8ad20fb8.b72bb",
		"type": "inject",
		"z": "497b3aa6.920134",
		"name": "Test",
		"topic": "",
		"payload": "{\"file\":\"autocad-sample-file.dwg\",\"activityId\":\"UpdateDWGParamActivity+dev\",\"width\":45,\"height\":23}",
		"payloadType": "json",
		"repeat": "",
		"crontab": "",
		"once": false,
		"onceDelay": 0.1,
		"x": 1090,
		"y": 400,
		"wires": [
			[
				"2f6f15a5.660e0a"
			]
		]
	},
	{
		"id": "c71893fc.60d45",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "key",
				"pt": "msg",
				"to": "payload.file",
				"tot": "msg"
			},
			{
				"t": "set",
				"p": "filename",
				"pt": "msg",
				"to": "$flowContext('daConst').BundlesPath & msg.payload.file",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "outputfilename",
				"pt": "msg",
				"to": "$string($millis()) \t& msg.payload.file",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "inputfilename",
				"pt": "msg",
				"to": "payload.file",
				"tot": "msg"
			},
			{
				"t": "set",
				"p": "bucket",
				"pt": "msg",
				"to": "daConst.Bucket",
				"tot": "flow"
			},
			{
				"t": "set",
				"p": "width",
				"pt": "msg",
				"to": "payload.width",
				"tot": "msg"
			},
			{
				"t": "set",
				"p": "height",
				"pt": "msg",
				"to": "payload.height",
				"tot": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 1320,
		"y": 480,
		"wires": [
			[
				"781e6b07.60cc74"
			]
		]
	},
	{
		"id": "781e6b07.60cc74",
		"type": "subflow:3f75d555.5599aa",
		"z": "497b3aa6.920134",
		"name": "",
		"env": [
			{
				"name": "forceBucketCreation",
				"type": "bool",
				"value": "true"
			}
		],
		"x": 1560,
		"y": 480,
		"wires": [
			[
				"5d8f318b.de728"
			],
			[
				"d77a0cda.0d488"
			]
		]
	},
	{
		"id": "5d8f318b.de728",
		"type": "subflow:4aecadf2.352044",
		"z": "497b3aa6.920134",
		"name": "",
		"env": [],
		"x": 1530,
		"y": 540,
		"wires": [
			[
				"381bf826.48b648",
				"5793720b.48b3fc",
				"33ed1626.9bba8a"
			],
			[
				"867a4f48.4f93d",
				"b2318c0a.e1a56"
			],
			[
				"867a4f48.4f93d",
				"b2318c0a.e1a56"
			],
			[
				"8c09b73a.1cfe58"
			]
		]
	},
	{
		"id": "867a4f48.4f93d",
		"type": "subflow:c93aef0f.c6081",
		"z": "497b3aa6.920134",
		"name": "",
		"env": [],
		"x": 1520,
		"y": 600,
		"wires": [
			[
				"7a982177.7f4f7",
				"5793720b.48b3fc",
				"33ed1626.9bba8a"
			],
			[
				"23fdf492.c55cdc"
			]
		]
	},
	{
		"id": "d77a0cda.0d488",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 480,
		"wires": []
	},
	{
		"id": "8c09b73a.1cfe58",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 560,
		"wires": []
	},
	{
		"id": "23fdf492.c55cdc",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 640,
		"wires": []
	},
	{
		"id": "7a982177.7f4f7",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 600,
		"wires": []
	},
	{
		"id": "381bf826.48b648",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 520,
		"wires": []
	},
	{
		"id": "973c997d.0a1ae8",
		"type": "forge-oss",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "CopyObject",
		"raw": false,
		"all": false,
		"bucket": "",
		"bucketType": "str",
		"policyKey": "transient",
		"key": "",
		"contentType": "application/octet-stream",
		"contentDisposition": "",
		"copy": "",
		"localFilename": "",
		"limit": 10,
		"startAt": "",
		"beginsWith": "",
		"with": null,
		"ifMatch": "",
		"ifNoneMatch": "",
		"ifModifiedSince": "",
		"range": "",
		"access": "read",
		"singleUse": false,
		"minutesExpiration": 60,
		"acceptEncoding": "",
		"guid": "autodesk",
		"region": "US",
		"x": 1400,
		"y": 960,
		"wires": [
			[
				"ce2db1f1.311f2",
				"d3b9c331.14b75"
			],
			[
				"1586c1aa.76882e"
			]
		]
	},
	{
		"id": "1586c1aa.76882e",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 980,
		"wires": []
	},
	{
		"id": "d3b9c331.14b75",
		"type": "forge-oss",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "outputfile",
		"forge": "",
		"operation": "CreateSignature",
		"raw": false,
		"all": false,
		"bucket": "",
		"bucketType": "str",
		"policyKey": "transient",
		"key": "",
		"contentType": "application/octet-stream",
		"contentDisposition": "",
		"copy": "",
		"localFilename": "",
		"limit": 10,
		"startAt": "",
		"beginsWith": "",
		"with": null,
		"ifMatch": "",
		"ifNoneMatch": "",
		"ifModifiedSince": "",
		"range": "",
		"access": "readwrite",
		"singleUse": false,
		"minutesExpiration": 60,
		"acceptEncoding": "",
		"guid": "autodesk",
		"region": "US",
		"x": 1420,
		"y": 1040,
		"wires": [
			[
				"f39bc473.02c6d8",
				"f965885e.2ec868"
			],
			[
				"4b781d23.aa4064"
			]
		]
	},
	{
		"id": "4b781d23.aa4064",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 1060,
		"wires": []
	},
	{
		"id": "5793720b.48b3fc",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "copy",
				"pt": "msg",
				"to": "outputfilename",
				"tot": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 1320,
		"y": 920,
		"wires": [
			[
				"973c997d.0a1ae8"
			]
		]
	},
	{
		"id": "ce2db1f1.311f2",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 940,
		"wires": []
	},
	{
		"id": "f39bc473.02c6d8",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 1020,
		"wires": []
	},
	{
		"id": "2bab7c34.ed0324",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "callbackUrl",
				"pt": "msg",
				"to": "$flowContext('daConst').webhookURL\t& '/api/forge/callback/designautomation?'\t& 'id=0&'\t& 'outputFileName=' & msg.outputfilename & '&'\t& 'inputFileName=' & msg.inputfilename",
				"tot": "jsonata"
			},
			{
				"t": "set",
				"p": "inputFileArgument",
				"pt": "msg",
				"to": "payload.inputfile.signedUrl",
				"tot": "msg"
			},
			{
				"t": "set",
				"p": "outputFileArgument",
				"pt": "msg",
				"to": "payload.outputfile.signedUrl",
				"tot": "msg"
			},
			{
				"t": "delete",
				"p": "topic",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "xAdsForce",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "ifMatch",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "policyKey",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "forceBucketCreation",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "contentDisposition",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "copy",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "bucket",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "contentType",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "base64",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "urn",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "sha1",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "region",
				"pt": "msg"
			},
			{
				"t": "delete",
				"p": "objectId",
				"pt": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 1320,
		"y": 1280,
		"wires": [
			[
				"f0fb79aa.8f7c28",
				"5c88158b.31013c"
			]
		]
	},
	{
		"id": "5ca491d4.2cbbf",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Create signed URL for output file",
		"info": "",
		"x": 1370,
		"y": 880,
		"wires": []
	},
	{
		"id": "951ca07a.9dc06",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Launch WorkItem",
		"info": "",
		"x": 1320,
		"y": 1240,
		"wires": []
	},
	{
		"id": "f0fb79aa.8f7c28",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 1280,
		"wires": []
	},
	{
		"id": "c800cafd.663f18",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "CreateWorkitems",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"alias": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": null,
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": null
			}
		],
		"settings": [
			{
				"key": "key",
				"type": "StringSetting"
			}
		],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"limitProcessingTimeSec": "",
		"baseUrls": "",
		"signature": "",
		"arguments": [],
		"limitPayloadSizeInKB": "",
		"limitVersions": "",
		"limitAliases": "",
		"limitPublicAliases": "",
		"limitAppUploadSizeInMB": "",
		"limitMonthlyProcessingTimeInHours": "",
		"backendLimits": [],
		"x": 1500,
		"y": 1340,
		"wires": [
			[
				"ffbe0f80.51fb4",
				"b3951813.4124b8",
				"483cd86.6a3b728"
			],
			[
				"1310a7b6.a2c018"
			]
		]
	},
	{
		"id": "1310a7b6.a2c018",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 1360,
		"wires": []
	},
	{
		"id": "ffbe0f80.51fb4",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 1320,
		"wires": []
	},
	{
		"id": "f5af61b0.488d2",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Create signed URL for input file",
		"info": "",
		"x": 1370,
		"y": 720,
		"wires": []
	},
	{
		"id": "33ed1626.9bba8a",
		"type": "forge-oss",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "inputfile",
		"forge": "",
		"operation": "CreateSignature",
		"raw": false,
		"all": false,
		"bucket": "",
		"bucketType": "str",
		"policyKey": "transient",
		"key": "",
		"contentType": "application/octet-stream",
		"contentDisposition": "",
		"copy": "",
		"localFilename": "",
		"limit": 10,
		"startAt": "",
		"beginsWith": "",
		"with": null,
		"ifMatch": "",
		"ifNoneMatch": "",
		"ifModifiedSince": "",
		"range": "",
		"access": "read",
		"singleUse": true,
		"minutesExpiration": "45",
		"acceptEncoding": "",
		"guid": "autodesk",
		"region": "US",
		"x": 1420,
		"y": 760,
		"wires": [
			[
				"d6e1022c.43b7d",
				"f965885e.2ec868"
			],
			[
				"f3013828.a0d168"
			]
		]
	},
	{
		"id": "f3013828.a0d168",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 780,
		"wires": []
	},
	{
		"id": "d6e1022c.43b7d",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 740,
		"wires": []
	},
	{
		"id": "b8763fd0.d7443",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 410,
		"y": 140,
		"wires": []
	},
	{
		"id": "f965885e.2ec868",
		"type": "join",
		"z": "497b3aa6.920134",
		"name": "",
		"mode": "custom",
		"build": "object",
		"property": "payload",
		"propertyType": "msg",
		"key": "topic",
		"joiner": "\\n",
		"joinerType": "str",
		"accumulate": false,
		"timeout": "",
		"count": "2",
		"reduceRight": false,
		"reduceExp": "",
		"reduceInit": "",
		"reduceInitType": "",
		"reduceFixup": "",
		"x": 1290,
		"y": 1200,
		"wires": [
			[
				"2bab7c34.ed0324"
			]
		]
	},
	{
		"id": "5c88158b.31013c",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "// 1. input file\nvar inputFileArgument = {\n\turl: msg.inputFileArgument,\n\theaders: {\n\t\tAuthorization: '',\n\t\t'Content-type': 'application/octet-stream'\n\t},\n\tverb: 'get',\n\tkey: 'inputFile'\n};\n// 2. input json\nvar inputJson = {\n\twidth: parseFloat(msg.width),\n\theight: parseFloat(msg.height)\n};\nvar inputJsonArgument = {\n\turl: \"data:application/json, \" + JSON.stringify(inputJson).replace(/\"/g, \"'\"),\n\tkey: 'inputJson'\n};\n// 3. output file\nvar outputFileArgument = {\n\turl: msg.outputFileArgument,\n\theaders: {\n\t\t'Content-type': 'application/octet-stream'\n\t},\n\tverb: 'put',\n\tkey: 'outputFile'\n};\n\n// prepare & submit workitem\n\t// the callback contains the connectionId (used to identify the client) and the outputFileName of this workitem\nvar callbackUrl = flow.get('daConst').webhookURL\n    + flow.get('daConst').webhookPath + '?'\n    + 'outputFileName=' + msg.outputfilename + '&'\n    + 'inputFileName=' + msg.inputfilename\n;\nvar onCompleteArgument = {\n\turl: callbackUrl,\n\tverb: 'post',\n\tkey: 'onComplete'\n};\n\n// msg.arguments = {\n// \tinputFile: inputFileArgument,\n// \tinputJson: inputJsonArgument,\n// \toutputFile: outputFileArgument,\n// \tonComplete: {\n// \t\tverb: 'post',\n// \t\turl: callbackUrl\n// \t}\n// };\n\nmsg.arguments = [\n\tinputFileArgument,\n\tinputJsonArgument,\n\toutputFileArgument,\n\tonCompleteArgument \n];\n\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 1290,
		"y": 1320,
		"wires": [
			[
				"c800cafd.663f18",
				"43d4dc0c.964c24"
			]
		]
	},
	{
		"id": "55cc8193.b9e32",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Callback",
		"info": "",
		"x": 1300,
		"y": 1680,
		"wires": []
	},
	{
		"id": "27344ed5.7eb6e2",
		"type": "http in",
		"z": "497b3aa6.920134",
		"name": "Webhook",
		"url": "/api/forge/callback/designautomation",
		"method": "post",
		"upload": false,
		"swaggerDoc": "",
		"x": 1300,
		"y": 1720,
		"wires": [
			[
				"8ef2c918.68fe98",
				"33c151bf.1016ae",
				"83001b2c.0a15e8",
				"6e015e6f.19d99"
			]
		]
	},
	{
		"id": "8ef2c918.68fe98",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": true,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1880,
		"y": 1720,
		"wires": []
	},
	{
		"id": "83001b2c.0a15e8",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "url",
				"pt": "msg",
				"to": "payload.reportUrl",
				"tot": "msg"
			},
			{
				"t": "delete",
				"p": "payload",
				"pt": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 1360,
		"y": 1800,
		"wires": [
			[
				"bf94196d.1b3718"
			]
		]
	},
	{
		"id": "b58817f6.26f1f8",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1010,
		"y": 560,
		"wires": []
	},
	{
		"id": "33c151bf.1016ae",
		"type": "http response",
		"z": "497b3aa6.920134",
		"name": "",
		"statusCode": "200",
		"headers": {},
		"x": 1520,
		"y": 1700,
		"wires": []
	},
	{
		"id": "8120cec5.36fd8",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": true,
		"tosidebar": true,
		"console": true,
		"tostatus": false,
		"complete": "payload",
		"targetType": "msg",
		"x": 1880,
		"y": 1780,
		"wires": []
	},
	{
		"id": "bf94196d.1b3718",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "GetReport",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"alias": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"limitProcessingTimeSec": "",
		"baseUrls": "",
		"signature": "",
		"arguments": [],
		"limitPayloadSizeInKB": "",
		"limitVersions": "",
		"limitAliases": "",
		"limitPublicAliases": "",
		"limitAppUploadSizeInMB": "",
		"limitMonthlyProcessingTimeInHours": "",
		"backendLimits": [],
		"url": "",
		"x": 1540,
		"y": 1800,
		"wires": [
			[
				"8120cec5.36fd8",
				"4c0eba49.199434",
				"f290d0ba.bf92e"
			],
			[
				"b94bb7f3.091698"
			]
		]
	},
	{
		"id": "b94bb7f3.091698",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 1820,
		"wires": []
	},
	{
		"id": "b3951813.4124b8",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "if (!global.get('workitems'))\n    global.set('workitems', {});\n\nglobal.get('workitems')[msg.payload.id] = msg.outputFileArgument;\n\nreturn (global.get('workitems'));",
		"outputs": 1,
		"noerr": 0,
		"x": 1690,
		"y": 1400,
		"wires": [
			[
				"83949db5.c55d7"
			]
		]
	},
	{
		"id": "83949db5.c55d7",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": false,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 1400,
		"wires": []
	},
	{
		"id": "6e015e6f.19d99",
		"type": "switch",
		"z": "497b3aa6.920134",
		"name": "",
		"property": "payload.status",
		"propertyType": "msg",
		"rules": [
			{
				"t": "eq",
				"v": "success",
				"vt": "str"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 1330,
		"y": 2080,
		"wires": [
			[
				"4a80e673.878ad8",
				"826bc2fb.f99e2"
			],
			[
				"7d3a5dbd.3ff754",
				"ee82368a.d98f78"
			]
		]
	},
	{
		"id": "66414f08.d377b",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": true,
		"tosidebar": true,
		"console": true,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1880,
		"y": 2240,
		"wires": []
	},
	{
		"id": "7d3a5dbd.3ff754",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 2080,
		"wires": []
	},
	{
		"id": "4a80e673.878ad8",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "var url = '';\n\nif (global.get('workitems')) {\n    url = global.get('workitems')[msg.payload.id];\n    global.get('workitems')[msg.payload.id] = undefined;\n}\n\nreturn ({\n    id: msg.payload.id,\n    url: url    \n});",
		"outputs": 1,
		"noerr": 0,
		"x": 1510,
		"y": 2240,
		"wires": [
			[
				"66414f08.d377b",
				"1e71f90a.434d27"
			]
		]
	},
	{
		"id": "ac83d91e.a19c38",
		"type": "ui_led",
		"z": "497b3aa6.920134",
		"group": "e2baef12.fa13b",
		"order": 1,
		"width": 0,
		"height": 0,
		"label": "",
		"labelPlacement": "left",
		"labelAlignment": "left",
		"colorForValue": [
			{
				"color": "red",
				"value": "false",
				"valueType": "bool"
			},
			{
				"color": "green",
				"value": "true",
				"valueType": "bool"
			}
		],
		"allowColorForValueInMessage": false,
		"name": "status",
		"x": 1770,
		"y": 2140,
		"wires": []
	},
	{
		"id": "826bc2fb.f99e2",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "return ({\n    payload: true   \n});",
		"outputs": 1,
		"noerr": 0,
		"x": 1510,
		"y": 2120,
		"wires": [
			[
				"ac83d91e.a19c38"
			]
		]
	},
	{
		"id": "ee82368a.d98f78",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "return ({\n    payload: false   \n});",
		"outputs": 1,
		"noerr": 0,
		"x": 1510,
		"y": 2160,
		"wires": [
			[
				"ac83d91e.a19c38"
			]
		]
	},
	{
		"id": "94d08b1d.1a7688",
		"type": "inject",
		"z": "497b3aa6.920134",
		"name": "Test",
		"topic": "",
		"payload": "[11/16/2019 12:33:14] Job information:\"CommandLine\":[  \"$(engine.path)\\\\accoreconsole.exe /i $(args[inputFile].path) /al $(appbundles[UpdateDWGParamAppBundle].path) /s $(settings[script].path)\"]\"Settings\":{  \"script\": {    \"value\": \"UpdateParam\\n\"  },  \"dasreportfailedlimits\": {    \"value\": \"true\",    \"isEnvironmentVariable\": true  }}\"Id\":\"1feedfa822a544e7a72f909c44f1b3a2\"\"ActivityId\":\"oZZ0CN7qXTGAiqSbmEhLlmYcKXt0YVoU.UpdateDWGParamActivity+dev\"\"Engine.Id\":\"Autodesk.AutoCAD!21\"\"Apps\": [\"App.Id\":\"oZZ0CN7qXTGAiqSbmEhLlmYcKXt0YVoU.UpdateDWGParamAppBundle!1\"]\"BoundArguments\":{  \"inputFile\": {    \"localName\": \"$(inputFile)\",    \"url\": \"https://developer.api.autodesk.com/oss/v2/signedresources/e2ad2c8e-913c-41fa-b82e-37bbd14f6800?region=US\",    \"headers\": {      \"Authorization\": \"\",      \"Content-type\": \"application/octet-stream\"    }  },  \"inputJson\": {    \"localName\": \"params.json\",    \"url\": \"data:application/json, {'width':34,'h...",
		"payloadType": "str",
		"repeat": "",
		"crontab": "",
		"once": false,
		"onceDelay": 0.1,
		"x": 1110,
		"y": 1880,
		"wires": [
			[
				"7b6a65bc.db37fc"
			]
		]
	},
	{
		"id": "4c0eba49.199434",
		"type": "file",
		"z": "497b3aa6.920134",
		"name": "report.txt",
		"filename": "/Users/cyrille/Downloads/report.txt",
		"appendNewline": false,
		"createDir": true,
		"overwriteFile": "true",
		"encoding": "none",
		"x": 1720,
		"y": 1880,
		"wires": [
			[]
		]
	},
	{
		"id": "7b6a65bc.db37fc",
		"type": "file in",
		"z": "497b3aa6.920134",
		"name": "report.txt",
		"filename": "/Users/cyrille/Downloads/report.txt",
		"format": "utf8",
		"chunk": false,
		"sendError": false,
		"encoding": "none",
		"x": 1100,
		"y": 1920,
		"wires": [
			[
				"f290d0ba.bf92e"
			]
		]
	},
	{
		"id": "f290d0ba.bf92e",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "function htmlEntities(str) {\n    return String(str)\n        .replace(/&/g, '&amp;')\n        .replace(/</g, '&lt;')\n        .replace(/>/g, '&gt;')\n        //.replace(/\"/g, '&quot;')\n        .replace(/ /g, '&space;')\n    ;\n}\n\nvar txt = msg.payload;\nmsg.payload = {};\nmsg.payload.rows =txt.split(\"\\n\");\n// msg.payload.rows = msg.payload.rows.map(function (row) {\n//   return (htmlEntities(row)); \n// });\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 1530,
		"y": 1920,
		"wires": [
			[
				"fa92adb1.16d"
			]
		]
	},
	{
		"id": "fa92adb1.16d",
		"type": "template",
		"z": "497b3aa6.920134",
		"name": "css",
		"field": "payload.style",
		"fieldType": "msg",
		"format": "handlebars",
		"syntax": "mustache",
		"template": "table.trace-table {\n    color: #333;\n    font-family: Helvetica, Arial, sans-serif;\n    width: 100%;\n    border-collapse: collapse;\n    border-spacing: 0;\n    overflow-x: auto;\n    overflow-y: auto;\n}\ntable.trace-table tr td,\ntable.trace-table tr th {\n    border: 1px solid transparent;\n    /* No more visible border */\n    height: 30px;\n    transition: all 0.3s;\n    /* Simple transition for hover effect */\n}\ntable.trace-table tr th {\n    background: #DFDFDF;\n    /* Darken header a bit */\n    font-weight: bold;\n}\ntable.trace-table tr td {\n    background: #FAFAFA;\n    text-align: center;\n}\n\ntable.trace-table tr:nth-child(even) td {\n    background: gray;\n}\n\ntr:nth-child(odd) table.trace-table td {\n    background: blue;\n}\ntable.trace-table tr td:hover {\n    background: red;\n    color: yellow;\n}\n",
		"output": "str",
		"x": 1530,
		"y": 1960,
		"wires": [
			[
				"8d09410a.89673"
			]
		]
	},
	{
		"id": "8d09410a.89673",
		"type": "template",
		"z": "497b3aa6.920134",
		"name": "html",
		"field": "payload",
		"fieldType": "msg",
		"format": "html",
		"syntax": "mustache",
		"template": "<style>{{{payload.style}}}</style>\n\n<table id=\"div-table\" class=\"trace-table\" border=\"1\">\n    <thead>\n        <tr><th colspan=\"1\">{{topic}}</th></tr>\n    </thead>\n    \n    {{#payload.rows.length}}\n        {{#payload.rows}}<tr><td><pre>{{.}}</pre></td></tr>{{/payload.rows}}\n    {{/payload.rows.length}}\n\n    {{^payload.rows.length}}\n        <tr><td><pre>{{payload.rows}}</pre></td></tr>\n    {{/payload.rows.length}}\n</table>\n",
		"output": "str",
		"x": 1650,
		"y": 1960,
		"wires": [
			[
				"cb026379.6865f"
			]
		]
	},
	{
		"id": "cb026379.6865f",
		"type": "ui_template",
		"z": "497b3aa6.920134",
		"group": "e2baef12.fa13b",
		"name": "result.txt",
		"order": 4,
		"width": "12",
		"height": "8",
		"format": "<div ng-bind-html=\"msg.payload\" id=\"div-table\" height=\"500\" width=\"100%\"></div>\n\n<script>\n    (function(scope) {\n        scope.$watch('msg.payload', function(data) {\n            var elmt = document.getElementById(\"div-table\");\n            console.log(elmt);\n            // this one is null... why?\n            var elmtTable = document.getElementById(\"trace-table\");\n            console.log(elmtTable);\n            var nrCh = elmt.children.length;\n            console.log(\"nrCh: \" + nrCh);\n            if (nrCh > 0) {\n                // the only div child is the table !\n                var elmtChild = elmt.children[0];\n                console.log(elmtChild);\n                elmtChild.scrollIntoView(false);\n                console.log('scroll to bottom');\n            }\n        });\n    })(scope);\n\n</script>",
		"storeOutMessages": false,
		"fwdInMessages": false,
		"templateScope": "local",
		"x": 1780,
		"y": 1960,
		"wires": [
			[]
		]
	},
	{
		"id": "1e71f90a.434d27",
		"type": "template",
		"z": "497b3aa6.920134",
		"name": "html",
		"field": "payload",
		"fieldType": "msg",
		"format": "html",
		"syntax": "mustache",
		"template": "<a href=\"{{payload.url}}\" style=\"color: white; text-decoration: none;\">{{payload.id}}</a>",
		"output": "str",
		"x": 1630,
		"y": 2380,
		"wires": [
			[
				"9ab4bd54.0384e"
			]
		]
	},
	{
		"id": "1879b3c4.84f35c",
		"type": "inject",
		"z": "497b3aa6.920134",
		"name": "Test",
		"topic": "",
		"payload": "{\"id\":34455,\"url\":\"http://forge.autodesk.com\"}",
		"payloadType": "json",
		"repeat": "",
		"crontab": "",
		"once": false,
		"onceDelay": 0.1,
		"x": 1110,
		"y": 2380,
		"wires": [
			[
				"1e71f90a.434d27"
			]
		]
	},
	{
		"id": "a8568b5f.0a59d8",
		"type": "link out",
		"z": "497b3aa6.920134",
		"name": "To Report",
		"links": [
			"6ece8426.cb81dc",
			"4961e49.183b81c"
		],
		"x": 735,
		"y": 700,
		"wires": []
	},
	{
		"id": "4961e49.183b81c",
		"type": "link in",
		"z": "497b3aa6.920134",
		"name": "From Start WorkItem",
		"links": [
			"a8568b5f.0a59d8"
		],
		"x": 1155,
		"y": 1800,
		"wires": [
			[
				"276e69ac.d16736",
				"9c38a11a.72cea",
				"5e2b0dfb.a66974"
			]
		]
	},
	{
		"id": "276e69ac.d16736",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "return ({ payload: 'invalid' });",
		"outputs": 1,
		"noerr": 0,
		"x": 1290,
		"y": 2020,
		"wires": [
			[
				"ac83d91e.a19c38"
			]
		]
	},
	{
		"id": "9c38a11a.72cea",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "msg.payload = {};\nmsg.payload.rows = [];\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 1290,
		"y": 1980,
		"wires": [
			[
				"fa92adb1.16d"
			]
		]
	},
	{
		"id": "6da1415a.ea156",
		"type": "inject",
		"z": "497b3aa6.920134",
		"name": "Test",
		"topic": "",
		"payload": "{\"id\":34455,\"url\":\"http://forge.autodesk.com\"}",
		"payloadType": "json",
		"repeat": "",
		"crontab": "",
		"once": false,
		"onceDelay": 0.1,
		"x": 1110,
		"y": 2440,
		"wires": [
			[
				"73f98a21.41af84"
			]
		]
	},
	{
		"id": "73f98a21.41af84",
		"type": "template",
		"z": "497b3aa6.920134",
		"name": "html",
		"field": "payload",
		"fieldType": "msg",
		"format": "html",
		"syntax": "mustache",
		"template": "<a href=\"{{payload.url}}\" target=\"_blank\" ng-style=\"{color: white}\">{{payload.id}}</a>",
		"output": "str",
		"x": 1630,
		"y": 2440,
		"wires": [
			[
				"9ab4bd54.0384e"
			]
		]
	},
	{
		"id": "9ab4bd54.0384e",
		"type": "ui_template",
		"z": "497b3aa6.920134",
		"group": "e2baef12.fa13b",
		"name": "result file",
		"order": 3,
		"width": "0",
		"height": "0",
		"format": "<div ng-bind-html=\"msg.payload\" ng-style=\"{color: white}\"></div>\n",
		"storeOutMessages": false,
		"fwdInMessages": false,
		"templateScope": "local",
		"x": 1780,
		"y": 2440,
		"wires": [
			[]
		]
	},
	{
		"id": "b1fdd925.6897b8",
		"type": "forge-da",
		"z": "497b3aa6.920134",
		"name": "",
		"topic": "",
		"forge": "",
		"operation": "GetWorkitems",
		"raw": false,
		"page": "",
		"all": false,
		"description": "",
		"alias": "",
		"version": 1,
		"activityId": "",
		"receiver": "",
		"appbundles": "",
		"commandline": "",
		"parameters": [
			{
				"id": "",
				"localName": "",
				"verb": "get",
				"zip": false,
				"ondemand": false,
				"required": false,
				"description": ""
			}
		],
		"settings": [],
		"engine": "",
		"appbundlesId": "",
		"package": "",
		"nickname": "me",
		"exponent": "",
		"modulus": "",
		"workitemId": "",
		"limitProcessingTimeSec": "",
		"baseUrls": "",
		"signature": "",
		"arguments": [],
		"limitPayloadSizeInKB": "",
		"limitVersions": "",
		"limitAliases": "",
		"limitPublicAliases": "",
		"limitAppUploadSizeInMB": "",
		"limitMonthlyProcessingTimeInHours": "",
		"backendLimits": [],
		"url": "",
		"x": 1570,
		"y": 1520,
		"wires": [
			[
				"e7be1bb9.06fb28",
				"5d82f0d2.6a65",
				"69ceab64.ecfae4"
			],
			[
				"42f71f59.47ad6"
			]
		]
	},
	{
		"id": "e7be1bb9.06fb28",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Result",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 1480,
		"wires": []
	},
	{
		"id": "42f71f59.47ad6",
		"type": "debug",
		"z": "497b3aa6.920134",
		"name": "Errors",
		"active": true,
		"tosidebar": true,
		"console": false,
		"tostatus": false,
		"complete": "true",
		"targetType": "full",
		"x": 1870,
		"y": 1520,
		"wires": []
	},
	{
		"id": "483cd86.6a3b728",
		"type": "change",
		"z": "497b3aa6.920134",
		"name": "",
		"rules": [
			{
				"t": "set",
				"p": "workitemId",
				"pt": "msg",
				"to": "payload.id",
				"tot": "msg"
			}
		],
		"action": "",
		"property": "",
		"from": "",
		"to": "",
		"reg": false,
		"x": 1330,
		"y": 1460,
		"wires": [
			[
				"b1fdd925.6897b8"
			]
		]
	},
	{
		"id": "32ecfb2.c0d3404",
		"type": "delay",
		"z": "497b3aa6.920134",
		"name": "",
		"pauseType": "delay",
		"timeout": "2",
		"timeoutUnits": "seconds",
		"rate": "1",
		"nbRateUnits": "1",
		"rateUnits": "second",
		"randomFirst": "1",
		"randomLast": "5",
		"randomUnits": "seconds",
		"drop": false,
		"x": 1300,
		"y": 1500,
		"wires": [
			[
				"b1fdd925.6897b8"
			]
		]
	},
	{
		"id": "5d82f0d2.6a65",
		"type": "switch",
		"z": "497b3aa6.920134",
		"name": "",
		"property": "payload.status",
		"propertyType": "msg",
		"rules": [
			{
				"t": "eq",
				"v": "success",
				"vt": "str"
			},
			{
				"t": "else"
			}
		],
		"checkall": "true",
		"repair": false,
		"outputs": 2,
		"x": 1590,
		"y": 1460,
		"wires": [
			[
				"e7be1bb9.06fb28"
			],
			[
				"32ecfb2.c0d3404"
			]
		]
	},
	{
		"id": "6f98d.11c2d674",
		"type": "comment",
		"z": "497b3aa6.920134",
		"name": "Progress",
		"info": "",
		"x": 1760,
		"y": 1560,
		"wires": []
	},
	{
		"id": "69ceab64.ecfae4",
		"type": "ui_text",
		"z": "497b3aa6.920134",
		"group": "e2baef12.fa13b",
		"order": 2,
		"width": 0,
		"height": 0,
		"name": "status text",
		"label": "",
		"format": "{{msg.payload.status}}",
		"layout": "row-left",
		"x": 1770,
		"y": 1600,
		"wires": []
	},
	{
		"id": "5e2b0dfb.a66974",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "msg.payload = { status: \"initializing\" };\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 1170,
		"y": 1560,
		"wires": [
			[
				"69ceab64.ecfae4"
			]
		]
	},
	{
		"id": "43d4dc0c.964c24",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "msg.payload = { status: \"preparing data\" };\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 1170,
		"y": 1640,
		"wires": [
			[
				"69ceab64.ecfae4"
			]
		]
	},
	{
		"id": "b2318c0a.e1a56",
		"type": "function",
		"z": "497b3aa6.920134",
		"name": "",
		"func": "msg.payload = { status: \"uploading file\" };\nreturn (msg);",
		"outputs": 1,
		"noerr": 0,
		"x": 1170,
		"y": 1600,
		"wires": [
			[
				"69ceab64.ecfae4"
			]
		]
	},
	{
		"id": "f6b942da.65ecf",
		"type": "ui_group",
		"z": "",
		"name": "Launch WorkItem",
		"tab": "61a0dc6c.75a114",
		"order": 1,
		"disp": true,
		"width": "8",
		"collapse": true
	},
	{
		"id": "e2baef12.fa13b",
		"type": "ui_group",
		"z": "",
		"name": "Report",
		"tab": "61a0dc6c.75a114",
		"order": 3,
		"disp": true,
		"width": "12",
		"collapse": false
	},
	{
		"id": "ad5ab1f0.4158e",
		"type": "ui_group",
		"z": "",
		"name": "Create/Update AppBundle & Activity",
		"tab": "6973f5c2.ddad6c",
		"order": 1,
		"disp": true,
		"width": "10",
		"collapse": true
	},
	{
		"id": "61a0dc6c.75a114",
		"type": "ui_tab",
		"z": "",
		"name": "Design Automation",
		"icon": "cogs",
		"order": 1,
		"disabled": false,
		"hidden": false
	},
	{
		"id": "6973f5c2.ddad6c",
		"type": "ui_tab",
		"z": "",
		"name": "Configure",
		"icon": "dashboard",
		"order": 2,
		"disabled": false,
		"hidden": false
	}
]