cancel
Showing results for 
Search instead for 
Did you mean: 

Data object reference

msr
Champ in-the-making
Champ in-the-making
Hello everybody,

I'm new with activiti and i'm currently working on the usability and integration of documents in a process. It is for research, because i'm studying business information technology.
I want to check the integration and usage of documents within the process execution.

–> Is there a way to attach documents to a data object?

The Engine is running on a windows server, the processes (.bpmn) and the documents are stored on this server at a specific place. Just a reference on the documents would be good.

Any experiences or advise.
Thanks for your reply.
Msr
11 REPLIES 11

trademak
Star Contributor
Star Contributor
It's possible to add an attachment to a process instance or task in Activiti. The document is then stored in the attachment table in Activiti. Is that what you are looking for?

Best regards,

msr
Champ in-the-making
Champ in-the-making
Hello,

thanks for your reply.
This is exactly what I want.

Is there a documentation or tutorial how to attach a document to a .bpmn-File and make it available in the execution?
In which way do i have to edit the .bpmn-file an enrich it with references or the documents-path?
Or how the documents get into the engine?

Its probably easy, but I do not have any approach.

Thanks for reply.
Best regards.


yvoswillens
Champ in-the-making
Champ in-the-making
Hi

please have a look at the Activiti user guide. Paragraf 15.7.27 and further for example describe the REST API for creating and fetching attachments.

http://www.activiti.org/userguide/#_tasks_2

Regards,

Yvo

msr
Champ in-the-making
Champ in-the-making
Hi Yvo,

Thanks for your answer.
But I guess its not that what I need/want…

My concrete Situation is:

- the bpmn file is generated by another tool (not activiti modeler or designer)
- the process is exported as bpmn file within a zip (or a folder - this does not really matter)
- in this zip, there are some documents for the process execution. They should be available in the process and included in the deployment
- this zip is actual deployed manually on a server, where the engine is running.

1. how does the integration looks like in the .bpmn-file?
2. Is it possible to link an attachment in the .bpmn-file?

My Imagination is to create the zip-file (including .bpmn and documents), deploy the zip-file to the engine and the documents are available within the process as attachments..

or

The .bpmn-file and the documents are stored in a folder, the .bpmn is deployed and the affected task references to the documents-path.

Please say it if its not possible like this.

Thanks a lot.

Best Regards,
Msr


tstephen
Champ on-the-rise
Champ on-the-rise
Hi Msr,

It looks like you may have some confusion of process definitions and process instances. A BPMN file when deployed is a process definition from which zero or more instances may be started. When deploying the BPMN file it is also possible to deploy other files within a .bar (a regular zip file) but these will then be associated to _every_ instance of the process started. This may be what you want in which case you should look at the RepositoryService to access the additional documents http://activiti.org/javadocs/org/activiti/engine/RepositoryService.html#getResourceAsStream(java.lang.String, java.lang.String).

However it sounds more like you want the documents to be available to the user completing tasks defined in the BPMN file. In this case you should not deploy the documents along with the BPMN file but instead add them as attachments as described above by Yvo. First, deploy the BPMN (only) and then start a process instance and finally add attachments.

Hope this helps,
Tim

msr
Champ in-the-making
Champ in-the-making
Hi Tim,

Thanks for your answer.

The first case you have described is what i want. The Documents should be available at the process start and already associated to the corresponding task.
Can you give me an example how this works?

Thanks.

jbarrez
Star Contributor
Star Contributor
In that case, you would need to set those documents (or references) as variables always when the process instance starts. This is done using the startProcessInstanceByXX methods, that take in a Map of Objects with a string as key

msr
Champ in-the-making
Champ in-the-making
Hello,

now I'm more confused.
Sorry I'm a beginner with activiti, so I not very familiar with all that.
Lets start from the beginning and with my understanding.

I can deploy a bar-container including a processdefinition (.bpmn) and additional files (such as documents).
Once I have deployed the process i can start an instance (in activiti-explorer). When I start an instance of a process there are no documents under related content.

Other Way: I have deployed a bar file to ../activiti-rest/service/repository/deployments/7507/
With the result:
{"id":"7507","name":"MyProcess.bar","deploymentTime":"2015-02-10T10:39:54.112-03:00","category":null,"url":"http://xx.xx.xx.xx:8080/activiti-rest/service/repository/deployments/7507','tenantId":""}

Under  ../activiti-rest/service/repository/deployments/7507/resources/ I excepted the included Document (resource). But there is nothing. Using Tomcat.


I tried to illustrate my problem (see here: https://www.dropbox.com/s/x6sbb8xu7f3ykm6/activiti_doc-under-related-content.PNG?dl=0 ).

Thanks for your help. I'm very glad about that and please execuse my inexperience.

jbarrez
Star Contributor
Star Contributor
> Once I have deployed the process i can start an instance (in activiti-explorer). When I start an instance of a process there are no documents under related content.

No. How would that magically need to work? It's not because it's part of the deployment that it's part of the instances. That' a whole other level of concepts.

Resources that are part of the deployment can be fetched through the API. It would have helped if you started your question with the fact you're using Explorer, cause my answers were in context of the Engine (thats the forum you posted it in).