Specifying arguments to UnarchiverProcess step

gkkhatal

28-05-2020

Hello All

 

I have created a new workflow and have added a "DAM Unarchiver Process"(com.day.cq.dam.core.process.UnarchiverProcess) step in it. The workflow works fine and does its job. E.g. when I upload a zip file, it extracts the contents by creating a new folder. However, I am not able to set additional arguments which it supports.

 

I want to set removeOriginal=true and updateMode=OVERWRITE. When I set these arguments from process step, those don't get applied. I tried following syntaxes to set the arguments but it never works. Is this an issue in this step? Please help.

  1. removeOriginal=true,updateMode=OVERWRITE
  2. removeOriginal:true,updateMode=OVERWRITE

I have even tried to run this workflow programmatically and tried to set the arguments in respective map(PROCESS_ARGS) but even that does not work

 

Thanks

Ganesh

Unarchiver workflow activity

Accepted Solutions (1)

Accepted Solutions (1)

vijis31358935

29-05-2020

Hi @gkkhatal,

Process arguments are comma separated pairs, where each pair consists of name and value separated by double colon.

In this case, can you try adding removeOriginal::true,updateMode::OVERWRITE

 

Thanks for your response. I tried this but still its taking the default arguments and not the provided arguments 😞

Hi @gkkhatal,

By the statement enabled debug logging, you mean DEBUG log level on this class - com.day.cq.dam.core.process.UnarchiverProcess and it is still returning same default update mode?

Also, would like to do another cross check -> In your original post, you mentioned that you tried triggering workflow programatically by setting the map values.

That is via,

wfData.getMetaDataMap().put("updateMode", "..");

wfData.getMetaDataMap().put("removeOriginal", "..");

wfSession.startWorkflow(model, wfData);

 

Trigger the WF programatically again and observe the runtime instance (/var/workflow/model/instances) workflow data - Cross check if this is set here.

 

Hi @vijis31358935,

 

I tried it. But the workflowMetadata will set the values at workflow level and not to the process step level. I tried it anyways and it shows correctly in /var/workflow/instances, but that does not work as expected and the workflow still takes default values.

 

I tried to log the process level arguments(Set via process arguments in WF model) and this is how it shows. Note there are 2 items and the arguments are shown against PROCESS_ARGS:

{PROCESS_ARGS=removeOriginal::true,updateMode::OVERWRITE, PROCESS=com.day.cq.dam.core.process.UnarchiverProcess}

 

Now, I am thinking if those are correct arguments. Do you know valid arguments list for UnarchiverProcess? I could not find valid documentation for it. I had looked into the decompiled UnarchiverProcess and picked these arguments list(removeOriginal & updateMode) but those does not seem to be working.

 

Hi @gkkhatal,

 

Nope. Workflow MetaDataMaps + WorkflowData MetaDataMaps can be used throughout the workflow. Recommended is to use WorkflowData's MetaDataMap.

Unarchiver process step uses com.day.cq.workflow.* family and not com.adobe.granite.workflow.*

In your code where you set the WorkflowData's MetaDataMap, can you use the one from com.day.cq.workflow.* family. If you are already using that, ignore this point.

Decompiled version seems to be straightforward, it just retrieves values from MetaDataMap(com.day.cq.workflow.metadata.MetaDataMap) and the key name you have used also seems to be correct.

I will try from my end in parallel.

Hi @gkkhatal,

Just realised that the args are not retrieved from PROCESS_ARGS for this process - UnarchiverProcess. Instead it is directly retrieved using the key from MetaDataMap, where below are the possible key names

removeOriginal
disableExtract
maxBytes
maxNumItems
maxNumItemsPerDir
saveThreshold
skipFileNamePatterns
updateMode

 

Hi @gkkhatal ,

 

After reproducing the issue in my local, was able to get to this.

We need to make use of the direct DAM Workflow Process named - Unarchiver and not the DAM Unarchiver Process selection from normal Process step.

 

Screenshot below for reference:

vijis31358935_1-1590831267228.png

From CRXDE:

vijis31358935_0-1590831148104.png

 

Hello @vijis31358935,

 

This finally worked. Thanks a lot for your time in this. Appreciate it!

 

Just a curious question. Is there relevant documentation/info about it? Looks like I was heading a wrong direction as I was not able to find precise info. The previous approach was really extracting the zip archive so did not think of changing the appraoch, thinking there was issue in calling the arguments.

 

Thanks again!

Ganesh

Hi @gkkhatal,

 

No problem. There is no documentation related to this.

Was able to narrow down from this point

  • From the Unarchiver process (the earlier one that we were looking into), could see that MetaDataMap is not retrieved from Arguments dialog field (PROCESS_ARGS), Instead from different dialog field names (that is the key names as direct property names - args.get("removeOriginal", ".."))

Answers (1)

Answers (1)

hamidk92094312

Employee

28-05-2020

What version of AEM ?

Can you check the logs and verify any relevant entries in the log ?

Hello @hamidk92094312, I am using AEM6.5. I have enabled debug logging and I am still seeing default arguments and not the provided arguments
What I meant is did you see any type of ERROR or WARN when the workflow is running ? Any indication that some operations/commands can not be executed/incompatible, ..etc
No @hamidk92094312, there are no errors. The workflow works perfectly fine. The logs show it is taking default values. Below is the debug log:
29.05.2020 17:39:01.265 *INFO* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess scan: scanning archive [/content/dam/ey/migration/Behavior.zip] and verifying configured limits 29.05.2020 17:39:01.265 *INFO* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess scan: configured limits: max bytes [104857600], max files [10000], max files per dir [100] 29.05.2020 17:39:01.265 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess scan: scanned entry [Behavior.xml] - [2275] bytes - folder:[./ - 1 - 100] 29.05.2020 17:39:01.265 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess scan: scanned entry [country.xml] - [47321] bytes - folder:[./ - 2 - 100] 29.05.2020 17:39:01.266 *INFO* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess scan: scan of archive [/content/dam/ey/migration/Behavior.zip] completed. archive is within configured limits. 29.05.2020 17:39:01.266 *INFO* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess scan: archive [/content/dam/ey/migration/Behavior.zip] will result in [2] extracted files with a total of [49596] bytes. 29.05.2020 17:39:01.266 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess execute: calling beforeExtract for [/content/dam/ey/migration/Behavior.zip] 29.05.2020 17:39:01.266 *INFO* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extract: begin extraction of archive [/content/dam/ey/migration/Behavior.zip] - update mode [NEW] 29.05.2020 17:39:01.266 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extract: update mode is [NEW], creating unique folder... 29.05.2020 17:39:01.266 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extract: created extraction folder at [/content/dam/ey/migration/behavior0] for [/content/dam/ey/migration/Behavior.zip] 29.05.2020 17:39:01.266 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: extracting entry [Behavior.xml] in archive [/content/dam/ey/migration/Behavior.zip] 29.05.2020 17:39:01.268 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: created temporary file at [C:\Windows\TEMP\unarchiver-file-1590754141266733201109348783775.tmp] 29.05.2020 17:39:01.270 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: got SHA-1 [74b40387c31f50e12c374a5cc4fd81e93cf890ad] for entry [Behavior.xml] 29.05.2020 17:39:01.271 *INFO* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: created new asset [/content/dam/ey/migration/behavior0/Behavior.xml] from entry [Behavior.xml] 29.05.2020 17:39:01.272 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: deleted temporary file at [C:\Windows\TEMP\unarchiver-file-1590754141266733201109348783775.tmp] 29.05.2020 17:39:01.272 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: extracting entry [country.xml] in archive [/content/dam/ey/migration/Behavior.zip] 29.05.2020 17:39:01.273 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: created temporary file at [C:\Windows\TEMP\unarchiver-file-15907541412723966630415008638870.tmp] 29.05.2020 17:39:01.276 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: got SHA-1 [d862f769e30a8ed7367e87f8a1c817673edf38d4] for entry [country.xml] 29.05.2020 17:39:01.291 *INFO* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: created new asset [/content/dam/ey/migration/behavior0/country.xml] from entry [country.xml] 29.05.2020 17:39:01.292 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extractEntry: deleted temporary file at [C:\Windows\TEMP\unarchiver-file-15907541412723966630415008638870.tmp] 29.05.2020 17:39:01.292 *INFO* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess extract: extraction of archive [/content/dam/ey/migration/Behavior.zip] successfully completed. 29.05.2020 17:39:01.292 *DEBUG* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip] com.day.cq.dam.core.process.UnarchiverProcess execute: calling afterExtract for [/content/dam/ey/migration/Behavior.zip] (extraction successful) 29.05.2020 17:39:01.292 *INFO* [JobHandler: /var/workflow/instances/server0/2020-05-18/unzip-metadata-zip_565:/content/dam/ey/migration/Behavior.zip]