Skip to content

Instantly share code, notes, and snippets.

@MadhukarMoogala
Last active June 28, 2019 10:52
Show Gist options
  • Save MadhukarMoogala/f5ef86e2706b0212334b5fc15a3c8e48 to your computer and use it in GitHub Desktop.
Save MadhukarMoogala/f5ef86e2706b0212334b5fc15a3c8e48 to your computer and use it in GitHub Desktop.
Activity_WorkItem_Payload_Json

Activity Payload Json

Here we have added another parameter MaxFileName and modified InputFile such that, upon recieving input zip, it will be unzipped into workingFolder MaxFileName parameter reads the file from unzipped folder this argument sematic explains that \"$(args[InputZip].path)/$(args[MaxFileName].value)\" $(args[myParam1].path) for a given parameter with the key "myParam1", this will be replaced by the file path where the file got uploaded/downloaded to. If the parameter is a zip, it will be replaced by the path to the folder where the zip got unzipped. $(args[myStringParam].value) will be replaced by the string value provided at work item submission of the parameter with the key "myStringParam" (Only for argument using the read verb). Possible values of verb -get, head, put, post, patch, read

{
	"id": "{{activityId}}",
	"commandLine": "$(engine.path)/3dsmaxbatch.exe -sceneFile  \"$(args[InputZip].path)/$(args[MaxFileName].value)\" \"$(settings[script].path)\"",
	"description": "Export a single max file to FBX",
	"appbundles": [
		"{{nickname}}.{{appId}}+{{appAlias}}"
	],
	"engine": "{{engineId}}",
	"parameters": {
		"InputFile": {
			"zip": true,
			"description": "Zip file containing the max file and all its dependencies to be unziped in the workingFolder",
			"ondemand": false,
			"required": true,
			"verb": "get",
			"localName": "workingFolder"
		},
		"MaxFileName" : {
            "zip": false,
            "description": "Name of the max file in the zip file provided as InputZip parameter",
            "ondemand": false,
            "required": true,
            "verb": "read"
        },
		"OutputFile": {
			"zip": false,
			"ondemand": false,
			"verb": "put",
			"description": "Output bmp file",
			"required": true,
			"localName": "output.bmp"
		}
	},
	"settings": {
		"script": "exportFile (sysInfo.currentdir + \"/output.bmp\") #noPrompt using:FBXEXP"
	}
}

WorkItem payload

Note we have assigned a value [name of max file] to MaxFileName argument

{
	"activityId": "{{forgeAppNickname}}.{{activityId}}+{{alias}}",
	"arguments": {
		"MaxFileName": "inputs.max",
		"InputZip": {
			"url": "{{zipFileSignedUrl}}",
			"verb": "get"
		},
		"OutputZip": {
			"url": "{{outputFileSignedUrl}}",
			"verb": "put"
		}
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment