Dear community.
Using the Activiti App I wonder how I could access properties of attachments. Attachments seem to be of a complex datatype.
I would like to use a attachments name in a execution listener or task listener - writing it to variable (execution.setVariable ..).
Since I have no access to the Code (using the app only) and since documentation is VERY limited I need you help with this.
Marco
Solved! Go to Solution.
Hi Marco,
I think I figured out the issue. The isVisible is getting overwritten by the visibility condition evaluation. So I decided to control this by adding a visibility condition which returns false. Please find attached a sample app with the updated scripts.
Ciju
Hi Marco,
RelatedContentService relatedContentService & RelatedContentRepository relatedContentRepository beans might be what you are looking for here. Check if this post is of any help - Pass attachments to sub process (call activity)
If you have a valid license, you should be able to request access to the Enterprise Repository Nexus Repository Manager which contains the java docs of all the enterprise libraries.
Hope this helps!
Regards,
Ciju
Hi Ciju.
.. Thanks so far!
As I am from the business side having just the Activiti APP but no access to the underlying Activiti ENGINE my possibilities are limited to what is achievable using the Activiti App.
Therefore I'd appreciate very much an example on how to adress an attachement using the Activiti App. I suppose it's not that difficult once I know how to address complex data types (like attachement).
Best regards
Marco
Understand. Can you please describe your use case of using a TaskListener /Execution Listener?
Hi Ciju.
.. you're right: I should explain the use case.
The process got a couple of user steps in a row (sequentially), each on assigned to a different assignee (group). Each assignee might attach files and see all files that have been attached in the steps before but must not delete attachments that have been added in a previous step.
Therefore I can't just use one "Attach File" form field since it allows deleting files. So I provide a separate "Attach File" form field for each step plus as many "Display value" form fields as steps have been before. The downside of this is that the "Display value" form field would always being displayed even if no attachment had been added in a previous step. In this case [empty] would be displayed. To hide "empty attachments" I'd like to check each "Display value" of the steps before. That is why I need to know how to adress an attachment/file object in the Execution/Task Listener.
This use case might sound not that thrilling but knowing how to adress the attachment properties would open possibilities for a couple of other use cases.
Best regards
Marco
Looks like it's more a UI side control that you need. You can achieve this using some java script.
Please find attached a sample app and see if this is what you are looking at. If yes, please look at the java script logic in the task form.
Hello Ciju.
Your Javascript-based solution seems to address the use case perfectly. But I suppose
viewfield.isVisible=false;
doesn't have the effect we expected.
.. see screenshot
Best Regards
Marco
Hello Marco,
Not sure what is happening here, it is working for me. Did you make any modifications to the app which I uploaded? Please attach your app so that I can check the java scripts and forms.
Ciju
Hi Cijua.
.. no, I did not modify your app .. just adding two missing semicolons
Marco
Hi Marco,
I think I figured out the issue. The isVisible is getting overwritten by the visibility condition evaluation. So I decided to control this by adding a visibility condition which returns false. Please find attached a sample app with the updated scripts.
Ciju
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.