cancel
Showing results for 
Search instead for 
Did you mean: 

2 Questions: document variable and myVariable_LABEL

bizilux
Champ on-the-rise
Champ on-the-rise
I couldnt find this in documents…

first question:
it is a field: "document variable" for generate document task…
I know that it meants the name of the generated pdf document, but how do i make it variable.

Right now i can only type in words, no special characters… so if I type in test, then that generated pdf will have filename test.pdf …
That is no good obviously. I would need probably naming convention like this: year_month_date_NameOfPersonWhoStartedProcess.pdf


second question:
I Am trying to make document template and I'm stuck at one variable.  In a form, user selects who will be his substitute when he goes on vacation. So a field type is "People". Now when i want to use that variable in document… it will show technical value instead of readable label, for example, instead of name "Luka Bizjak", it would show "3000".

And ofcourse myVariable_LABEL doesnt work, that only works for dropdowns… so what can I use for people field?


Can you please answer this two questions and add them to documents… Smiley Happy
9 REPLIES 9

bizilux
Champ on-the-rise
Champ on-the-rise
few more questions… how would I go about inserting name and surname of person who started the process into that generated PDF document?
would i need some java knowledge and mess about inside code? can you please give me example/solution if its simple.
————-

how would i go about in inserting current date into generated PDF document?  preferably in DD.MM.YYYY format?
I know there are apose docs, but i cant make up anything useful from in there… keep in mind i have really basic coding knowledge Smiley Happy
————-

I have 2 date fields in my form, because employee select start and ending of vacation. how would I calculate how many days of vacation that is, not counting saturdays and sundays and possibly even hollidays… 
yeah im sure i would need to write code here probably for custom stencil right?…  yeah i will just leave it up for secretary to manually put in number of days. That stuff is too complicated to spend that much time on it

jbarrez
Star Contributor
Star Contributor
So to answer your questions:

1. The variable name is an expression. So you can do something like my_name_${expression} or event ${myCustomBean.determineName()} to use a bean to determine the name

2. Yes, that is correct, as people get stored with their id's. You could use a template preprocessor to fetch the user details (using the UserInfoBean), see https://docs.alfresco.com/activiti/docs/dev-guide/1.3.2/#templateVariableProcessor

3. Wrt the process initiator: that is stored in the process instance as the 'initiator' value (note: also the id, so point 2 applies)

4. Current date: also using the preprocessor I would think.

bizilux
Champ on-the-rise
Champ on-the-rise
1. Thats the thing… it doesnt work.  If i try to copy paste "my_name_${expression}"  without quotes into document variable field on generate document tast… it will copy it, but it will end up looking like this: "my_name_expression"

Thanks for other points… I first need to get AD connected to Activiti to put in database of users, and then I will try and solve that template preprocessor to show label instead of id's

jbarrez
Star Contributor
Star Contributor
Hmm you might be on to something. I think the variable name regular expression is a bit too overzealous here.  We'll fix this, this is a bug.

bizilux
Champ on-the-rise
Champ on-the-rise
thats cool, i think its a bug yea…

I managed to get AD and SSO working with alfresco, today im doing alctiviti share connector, to connect them both… and then onwards to victory.

Have a happy holidays.

akashdhruvc
Champ in-the-making
Champ in-the-making
I have a similar requirement as well
I want the generated document to be tagged to a variable so that I can use the variable to attach the generated document to a human task UI Form using Display Text Palette….

Is this possible???

vasile_dirla
Star Contributor
Star Contributor
@akashdhruvc, Some time ago I did a similar scenario just for testing purpose.

there was generated a pdf report and then uploaded the file to an external repository and also added it on a user task form as a downloadable resource.

akashdhruvc
Champ in-the-making
Champ in-the-making
I want the generated doc to be automatically uploaded to an external repository with no manual intervension.

How do i do this…I tried using "Publish to Alfresco" task for Alfresco One ECM but it is expecting a variable which is tagged to a document.

That is why I needed to tag my generated document to a variable…How should i proceed

vasile_dirla
Star Contributor
Star Contributor
Yes the generated PDF is automatically uploaded to the Alfresco/BOX/GoogleDrive repository without human intervention.

2 tasks:
a. "generate document task" having "Document Variable" property set for example with this value "document1"
b. "Publish to Alfresco Task" and here you can choose the variable named "document1" in "Alfresco Content -> Publish content uploaded in a field -> Variable -> choose your variable"

here you will not have any human interaction and the content will be uploaded to Alfresco repo.

If this is not solving your problem, please let us know what's your Activiti version ?