0

I am working on a project where I need to generate output Revit file based on the input json file in the Design automation API for Revit.
Since my input json string was large, I create a json file example "InputFile.json" and upload it to the cloud and pass the signed url to it to the work item and activity as input parameter, the generated output is a zip file example "OutputFile.zip" which is again uploaded to the cloud using the signed url. My project works properly using this process.

But since the name used for the input and output files are fixed, I am facing issue when I send continuous request, I get mismatched output.

Activity request
..
"parameters": {
      "Inputs": {
        "zip": false,
        "ondemand": false,
        "verb": "get",
        "description": "Element parameters",
        "required": true,
        "localName": "InputFile.json"
      },
      "Result": {
        "zip": true,
        "ondemand": false,
        "verb": "put",
        "description": "new created element",
        "required": true,
        "localName": "OutputFile"
      }
    },
...

and the WorkItem request

...
"arguments":{
        "Inputs":{
            "url":"https://storage.googleapis.com/XXXXXXX/InputFile.json?XXXXXXXXXXXXXXXsigned-url"
            },

        "Result":{
            "verb":"put",
            "url":"https://storage.googleapis.com/XXXXXXX/OutputFile.zip?XXXXXXXXXXXXXXXsigned-url",
...

How can I pass dynamically generated names like "InputFile_[DATE].json" and "OutputFile_[DATE].zip"?

Thanks in advance

Regards

JPais
  • 115
  • 2
  • 14
  • The first idea I can think of is to specify the local name of activity with desired name. But it sounds you want to keep the same definition of Activity, i.e. the local name of Output will be always OutputFile? Secondly, I might be misunderstanding youe question, but from your code, it looks Google Signed URL service can specify the file name. Is this not useful in your scenario? I am not familiar with signed URL of Google, I can be wrong. – Xiaodong Liang Jan 21 '20 at 14:38
  • I was confirmed what Jeremy commented is correct. localName is for any url. localname defined as argument/workitem takes precedence over the one defined as parameter/activity – Xiaodong Liang Jan 21 '20 at 16:07

1 Answers1

0

You should be able to replace the localName value when submitting the workitem by adding the "localName" attribute to your argument. Example:

"arguments":{
        "Inputs":{
            "url":"https://storage.googleapis.com/XXXXXXX/InputFile.json?XXXXXXXXXXXXXXXsigned-url"
            },

        "Result":{
            "verb":"put",
            "url":"https://storage.googleapis.com/XXXXXXX/OutputFile.zip?XXXXXXXXXXXXXXXsigned-url",
            "localName": "myOutputFileName"
        }
}

Jeremy
  • 357
  • 1
  • 6