The Activiti Explorer application requires you to have a valid session for every sub url of /activiti-explorer . You can just copy the diagram-viewer code to another application without authentication if that's what you are looking for. You also need to include the activiti-diagram-rest module in that case.
Hi Tijs, Thanks a lot for replying. In the end, I added the activiti-diagram-rest into the activiti-rest project. This allowed me to use the functions that I already had in combination with the diagram-viewer that is already implemented in the activiti-explorer. Just in case anyone needs to to this, I will add the step I did. Hope they will be useful.
1) Downloaded the source code for activiti version 5.19. I downloaded this version as this is the one I am currently using. 2) Import the Maven project to Eclipse. I ended up importing the whole project and subprojects. 3) Opened the activiti-rest project as this is were the url and logic needs to be added. 4) Under src/main/java, I created a package called org.activiti.rest.service.api.diagram (I tried to follow the same naming convension as the rest of the code). Include the java files that are in the activiti-diagram-rest project. You have to include the four files. 5) Modify the file RestUrls.java under the package org.activiti.rest.service.api by including the following lines:
<code> // this goes in the variable declaration section public static final String SEGMENT_DEPLOYMENT_ARTIFACT_DIAGRAM = "diagram-layout"; public static final String SEGMENT_DIAGRAM_LAYOUT = "diagram-layout"; public static final String SEGMENT_DIAGRAM_HIGHLIGHTS = "highlights";
/** * URL template for the diagram resource of a single process definition: <i>repository/process-definitions/{0rocessDefinitionId}/diagram-layout</i> */ public static final String[] URL_PROCESS_DEFINITION_DIAGRAM_LAYOUT = {SEGMENT_REPOSITORY_RESOURCES, SEGMENT_PROCESS_DEFINITION_RESOURCE, "{0}", SEGMENT_DEPLOYMENT_ARTIFACT_DIAGRAM};
/** * URL template for the diagram layout for a single process instance: <i>runtime/process-instances/{0rocessInstanceId}/diagram-layout</i> */ public static final String[] URL_PROCESS_INSTANCE_DIAGRAM_LAYOUT = {SEGMENT_RUNTIME_RESOURCES, SEGMENT_PROCESS_INSTANCE_RESOURCE, "{0}", SEGMENT_DIAGRAM_LAYOUT};
/** * URL template for the diagram highlights for a single process instance: <i>runtime/process-instances/{0rocessInstanceId}/highlights</i> */ public static final String[] URL_PROCESS_INSTANCE_DIAGRAM_HIGHLIGHTS = {SEGMENT_RUNTIME_RESOURCES, SEGMENT_PROCESS_INSTANCE_RESOURCE, "{0}", SEGMENT_DIAGRAM_HIGHLIGHTS}; </code>
6) Do a mvn clean install from a command line or directly from Eclispse. 7) Copy the newly created jar to the lib folder under the activiti-rest webapp in your Tomcat, and reboot it.
With it, you will be able to get the diagram layout and highlighted tasks as if you were doing a regular rest call to Activiti's rest API.