cancel
Showing results for 
Search instead for 
Did you mean: 

How to view deployed bussiness process?

holysoul
Champ in-the-making
Champ in-the-making
Hi all.

I found that after I deployed and ran a process from Eclipse, I went to Activiti-Explorer –> Processes–> My instance then I was unable to view any process diagram.
I can only view process diagram if I start process using Activiti-Explorer.

So how can I do to view process diagram which is started from other sources than Activiti-Explorer?

Thank you.
8 REPLIES 8

trademak
Star Contributor
Star Contributor
When you deployed the process you can view the process image in the "Processes - Deployed process definitions" section.

Best regards,

holysoul
Champ in-the-making
Champ in-the-making
I can't see it. I deployed and ran process from eclipse, my flow also has the user task. When I opened activiti-explorer, I could see the task assigned for me, I still did not complete it yet. However, in the "process-deployed process definitions" image, I saw that the process is completed 100%.
As I said above, If I go to "process-deployed process definitions" then press "start process", I can view the process completion in "my instance". What happens if I start process from Eclipse?

jbarrez
Star Contributor
Star Contributor
How do you deploy from Eclipse? Do you upload an image with it? Does the process contain the correct diagram interchange information?

holysoul
Champ in-the-making
Champ in-the-making
Hi jbarrez.
Here is what I've done.
Firstly, I just create example.bpmn20.xml, it only consists of 1 userTask.
Scecondly, I deploy that diagram running from Eclipse IDE. Like that
<code>
  ProcessEngine processEngine;
  processEngine = ProcessEngines.getDefaultProcessEngine();
  processEngine.getRepositoryService().createDeployment()
    .addClasspathResource("example.bpmn20.xml").deploy();
</code>
Everything is OK. Now I can see it in "Processes–> deployed process definitions", I also can see its image. Then I start process, jump to "my instance", the process is stuck at userTask. It's really good, so I delete the instance.
Thirdly, I use these code to start process from Eclipse IDE
<code>
  Map<String, Object> variableMap = new HashMap<String, Object>();
  String procesInstanceID = processEngine.getRuntimeService()
    .startProcessInstanceByKey("bccs-im-order", variableMap)
    .getProcessInstanceId();
</code>
Jumping to Activiti-Explorer, I can see the userTask which is assigned for me, so the process is run well. But when I open "my instance", I can not see the image like before, no clue to track the process.

I wonder if my code is not enough to fill information. So please help me. Thank you very much!

jbarrez
Star Contributor
Star Contributor
Could you put the example.bpmn20.xml somewhere so we can check it?

Just to make sure the '"bccs-im-order" is the id in this xml file?

holysoul
Champ in-the-making
Champ in-the-making
Hi.
I intent to upload my project into github, but it's not allowed by our company's policy.
So I quickly write again the small example with 3 file text:
-Run.text is java class
-activiti-example-user-task is the model to deploy
Sorry for this inconvenience.

frederikherema1
Star Contributor
Star Contributor
The "my instances" page is using the folowing query to populate the view:


List<HistoricProcessInstance> processInstances = historyService
      .createHistoricProcessInstanceQuery()
      .startedBy(ExplorerApp.get().getLoggedInUser().getId())
      .unfinished()
      .list();

So it's actually showing all process-instances started by the user that is logged in. When you start a process from the API, you should make sure you set the current logged in user. If not, the "started by" will be left empty.

You can do this, by using this kind of construct:


import org.activiti.engine.impl.identity.Authentication;



try {
Authentication.setAuthenticatedUserId("kermit");

runtimeService.start….

} finally {
// After API call is complete, always clear the authenticated user, in case this thread will be reused
// for other calls, eg. when API-call is done from a tomcat-thread-pool thread
Authentication.setAuthenticatedUserId(null);
}

holysoul
Champ in-the-making
Champ in-the-making
Yes, that's it. Thank frederikheremans.