java - Camunda Executionlistener implementation with timestamp -


hey guys im new camunda, want measure execution time process start end can't find proper coding example listener. come is

public void notify (delegateexecution execution) throws exception {      // happens when start event executed     long starttime = system.currenttimemillis();      // happens when token has reached end event     long stoptime = system.currenttimemillis();     long elapsedtime = stoptime - starttime;     system.out.println(elapsedtime);     } 

i set class in modeler start , end event hope right.

thanks in advance :)

the engine measure you. can't print duration of process instance listener process, because process instance still running. can check duration in database table act_hi_procinst.

also can use historyservice engine:

public class processinstancehistory {  @inject historyservice historyservice;  public list<historicprocessinstance> historicprocessinstances() {     return historyservice.createhistoricprocessinstancequery().list(); }  public void printdurations() {     (historicprocessinstance historicprocessinstance : historicprocessinstances()) {         system.out.println("elapsedtime :" + historicprocessinstance.getdurationinmillis());     } } } 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -