Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

OSGI Workflow attachment list on Assign Task

Avatar

Level 7

 

Hello,

 

I am trying to understand how to pass Attachments from one Assign Task to another. 

On the submission, I can see that I can add a Variable Array of Documents.  That works, all is good.

However, on the subsequent Assign Task, in the pre-populate section, I do not see the ability to assign a Variable Array to the prepopulation.

 

Does this mean that we must write the document Array to the payload?

Actually, that wouldn't work because we can only attach one document to the Prepopulate in Assign Task.

 

If somebody could explain this to me, it would be great.

 

Thanks,  

39 Replies

Avatar

Employee

@crich2784You don't nee to configure to prepopulate or submitted settings of assign task, if you are not invoking the workflow from AF submission, You may use Advanced tab, in assign task's props, if you want to attach files while reviewing the tasks. Hope this helps. Thank you!

Avatar

Level 7

@Mayank_Tiwari thank you for responding. Technically, we are starting the workflow by creating a Forms Application but, there are other workflows starting from a scheduled job.  We need attachments to work in either scenario.

 

I believe I have configured it as you describe and it's not working.  Can you send me a zip of a sample workflow?  The AF can be completely blank - it doesn't matter.  I need to know if I have a bug in my system or I'm not doing something correctly.  I can also send you my workflow.

 

 

 

Avatar

Employee

As I stated earlier, you need to configure the same as below:

 

Mayank_Tiwari_0-1633968242061.png

 

Avatar

Level 7

@Mayank_Tiwari Yes, I did that - not working.  Can you review my workflow, form and startpoint?

Avatar

Employee

Why are you using "submitted to workflow" for AF, when you are not invoking the workflow on AF submission? You are invoking the WF through code, right? You should use, "Absolute path of AF instead". I tried the same, and it is working fine for me, and I am able to attach the files, as per the advanced tab settings. Also, which version of AEM you ar trying this on?

Avatar

Level 7

This is merely an example.  I need both - submitted from a start point AND started from an API call.  The attachments can be attached during any part of the workflow.

 

Here is the important part because I fear we are not communicating well.  

Are you saying that you attached files in Assign Task #1 and the attached files appeared in Assign Task #2?  I am using AEM 6.5 - I believe it is patched too.  Can you verify with me by attaching a screenshot of your Assign Task #2?

 

If my workflow is working for you then, clearly there is something else wrong. 

Avatar

Employee

I installed your workflow package in 6.5.10, and modified it as below. Prepopulated and submitted info are blank in both the Assign tasks as yours.

 

Assign task 1 props:

 

Mayank_Tiwari_0-1633972148049.png

Mayank_Tiwari_1-1633972221470.png

 

Assign task2 props:

Mayank_Tiwari_2-1633972270732.png

Mayank_Tiwari_3-1633972328688.png

I invoked the workflow manually, and these are the attachments I have attached while submitting the tasks, and they are stored at the respective paths, as shown below:

 

Mayank_Tiwari_4-1633972421016.png

 

 

 

 

 

Avatar

Level 7

Ok, yes, in the CRX, that is also working for me.  Great - we're making progress but, this is not what I am asking.  The users need to see the attachments from task #1 to task #2 to task #3, etc from the inbox - the CRX is not accessible by a normal user

 

crich2784_0-1633972789035.png

 

Avatar

Employee

Then you need to configure the submitted info in 1st task and prepopulated in the second task, and make sure both are mapped.

Avatar

Level 7

@Mayank_Tiwari - I'm super sorry . . . I must be dense because I'm not understanding.  

 

If I understand you correctly, on Assign Task #2, you are saying that I need to configure Pre-population to "Relative to payload" and "attachments".  I swear that I've tried this. 

 

If you could kindly modify my workflow and test.  If it works, I would love to see the screenshot and what you modified.  I still think we are miscommunicating.

 

Again, I do not want attach files to my Adaptive Form - I want these to be attached to the Task not the Adaptive form.

Avatar

Employee

I checked with Adobe Engineering and I found that prefilling of Task attachments is not supported yet. That's why it is not working for task attachment. Engineering has confirmed this should be logged as an Enhancement. As of now, we can only prefill the AF attachment component, with the attachments submitted in the AF in the previous Assign task.

For this, you don't need to invoke the workflow on AF submission. It can be invoked manually too. You just need to have the file attachment component in the form you would render in the Assign task.

 

 

image.png

 

Mayank_Tiwari_0-1634037536521.png

 

Mayank_Tiwari_1-1634037575435.png

I have not configured anything in the Advanced tab of both the Assign tasks.

 

AssignTask1 props: only Submitted info is configured.

 

Mayank_Tiwari_2-1634037623104.png

 

AssignTask 2 props. Only prepopulated is configured.

 

Mayank_Tiwari_3-1634037678465.png

 

 

Avatar

Level 7

Super bummer but, thanks for checking - I thought I was going crazy!  

 

Seems like an easy enhancement - I hope my ticket gets converted into an Enhancement request?  We'll see.

Avatar

Employee

You may still use AF/PDF's attachment component, as you will have to anyhow render AF/PDF while opening the assign tasks.

This is the only way to propagate attachments through assignTasks in Forms OSGi workflows, as prefilling of task attachments is not supported yet. 

 

Avatar

Employee

You may still use AF/PDF's attachment component, as you will have to anyhow render AF/PDF while opening the assign tasks.

This is the only way to propagate attachments through assignTasks in Forms OSGi workflows, as prefilling of task attachments is not supported yet. 

Avatar

Level 7

Ok, we are a little closer. 

AttachTask1 -

Removed all attachment configurations from Prepopulate and Submission

On Advanced Tab, check the box to "Allow assignee to attach" and Relative to Payload and attachments.

AttachTask2 - exactly same as above

 

Result:  attachments folder in payload directory was created.  Attachments were there!  Yay!

However, AttachTask2 did NOT have the attachments in the task. Boo!

 

Next test,

AttachTask2 - added in Prepopulation/Attachments section, Relative to payload, attachments.

Still no attachments in task.  Boo!

 

I did several more tests - I still can't get attachments to show up for subsequent tasks.  

 

From @Mayank_Tiwari post, I'm concluding the "Prepopulate" and "Submission" sections of the form are ONLY for file attachments within the AF - NOT the workflow task.  Is this correct?  

 

I am ONLY referring to attachments in the workflow so, I need to stay out of the Prepopulate and Submission sections and focus on Workflow attachments.  Correct?

 

 

Maybe I'm expecting it to behave differently than it's designed.  I am expecting Attachments to show up here on subsequent tasks.  If I click on Workflow details, I can navigate to the previous task assign and see the attachments.  In our use-case, there could be 20 task assignments in 1 process instance - how would anybody know which one to find attachments?

In LiveCycle (screenshot below), the attachments could flow from one assignment to the next assignment in the attachment tab.  

crich2784_0-1633879686451.png

crich2784_1-1633879911476.png

 

 

Avatar

Employee

You may still use AF/PDF's attachment component, as you will have to anyhow render AF/PDF while opening the assign tasks.

This is the only way to propagate attachments through assignTasks in Forms OSGi workflows, as prefilling of task attachments is not supported yet.