cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy static files (.png) with the activiti process

stroobat
Champ in-the-making
Champ in-the-making
Hello,

We wanted to give the users the ability to show a diagram (as a .png file) in the frontend of the flow.
Because the flow changes from time to time I wanted to couple the change in the .png file to the version of the flow.

I added the following in the Spring config (processEngineConfiguration):
I thought that I could deploy and kind of file (resource) together with an Activiti distribution ?


        <property name="deploymentResources">
            <list>
                <value>classpath*:be/xxx/workflow/service/bpm/*.bpmn20.xml</value>
                <value>classpath*:be/xxx/workflow/service/bpm/*.png</value>
            </list>
        </property>

I debugged the Activiti code and I can see that the resources are being read but that only the resources ending with ".bpmn20.xml" are peresisted to the activiti db ??

In the past I also deployed .form files (version 5.2) and that was working …

So my qeustion: Can I deploy other files ? Such as .png files in version 5.3 ? And how do I do it ?

Best regards,

Tom.
1 REPLY 1

stroobat
Champ in-the-making
Champ in-the-making
Kind of strange that I'm replying to my own post … But I was checking the documentation and I found the following …

    Providing a process diagram

    A process diagram image can be added to a deployment. This image will be stored in the Activiti repository and is accessible through the API. Tis image is also used to visualize the process in Activiti Explorer.

    Suppose we have a process on our classpath, org/activiti/expenseProcess.bpmn20.xml that has as process key 'expense'. Following naming conventions for the process diagram image apply (in this specific order):

        *

          If in the deployment an image resource with as name the BPMN 2.0 xml file name concatenated with the process key and an image suffix exists, this image is used. In our example, this would be org/activiti/expenseProcess.expense.png (or .jpg/gif). In case you have multiple images defined in one BPMN 2.0 xml file, this approach makes most sense. Each diagram image will then have the process key in its file name.
        *

          If no such image exists, am image resource in the deployment matching the name of the BPMN 2.0 xml file is searched. In our example this would be org/activiti/expenseProcess.png. Note that this means that every process definition defined in the same BPMN 2.0 file has the same process diagram image. In case there is only one process definition in each BPMN 2.0 xml file, this is of course no problem.
So I will try this out first …

Tom.