Document needs to be displayed in Task Page

cancel
Showing results for 
Search instead for 
Did you mean: 
naveenv449
Active Member II

Document needs to be displayed in Task Page

Hi All,

I am developing an application in Alfresco Activiti App which has multiple levels with different user actions. At 1st step I am generating a document using a form info and a template. Now, I would like to display the same document to the user in the next level.

I tried with Adding Attach  but I could not display document.

When I tried with Attach only document name is getting displayed like below:

To view this document, I have to go to part of process and then view it like below:

Instead, How can I display the same document in the Tasks page itself?

Could someone help me in this?

Thanks in Advance, 

Naveen Vatambeti.

6 Replies
gdharley
Intermediate

Re: Document needs to be displayed in Task Page

If you know the content ID you can use a Hyperlink with the following URL:

/activiti-app/app/rest/content/5005/rendition/preview

Notice the 5005 in the URL is the content ID of the attachment, you will need to retrieve this when you create/save the document and put it into a variable so you can include it in the Hyperlink definition.

Obviously you could get a lot fancier with a custom form stencil, but whatever you do, you will need to pull the document with the URL shown (I think this is what the tasklist uses).

Greg

naveenv449
Active Member II

Re: Document needs to be displayed in Task Page

Thank you Greg Greg Harley for the quick response. I have tried to check the solution that you have suggested. I could see the document getting loaded when i hit the URL. I am generating the document using Activiti, here could you suggest me how to get the content id when the document is generated? 

Thanks in Advance,

Naveen Vatambeti

gdharley
Intermediate

Re: Document needs to be displayed in Task Page

First, you need to provide me the code you are using the create the document.

In general for Enterprise Edition, you can retrieve any documents associated with the process instance using the RelatedContentService.

E.g. relatedContentService.getRelatedContentForProcessInstance(instanceId, pageSize, page);

Cheers,

Greg

naveenv449
Active Member II

Re: Document needs to be displayed in Task Page

Thanks Greg  for one more quick response. I am actually doing this using Generate Document Activity using a template. I did not write any code to achieve this task.

Thanks in Advance,

Naveen Vatambeti

gdharley
Intermediate

Re: Document needs to be displayed in Task Page

In that case you will need to retrieve associated content using the relatedContentService I posted earlier.
Use a script task or create a  Java delegate.

Greg

vamsikrishna
Member II

Re: Document needs to be displayed in Task Page

Hi Naveen,

I am seeking for the same thing can i contact you regarding to discuss this.

Thanks in Advance

Vamsi