Hi, does anybody can help me with the getBusinessRuntime() function? It returns null because of the running state of the Task and I do not know how I can get the business runtime from the last running case or from a certain case with the state done.

asked 24.06.2016 at 13:25

Gabriele's gravatar image

Gabriele
61668
accept rate: 66%


Use the classes TaskQuery or CaseQuery to query for tasks and cases that have already been done. And then call the method getBusinessRuntime() on the returning results.

Example:

import ch.ivyteam.ivy.workflow.CaseState;
import ch.ivyteam.ivy.workflow.query.CaseQuery;
import ch.ivyteam.ivy.workflow.ICase;

ICase caze = CaseQuery.create().where().name().isEqual("MyCase").and().state().isEqual(CaseState.DONE).executor().firstResult() as ICase;
caze.getBusinessRuntime();
link

answered 24.06.2016 at 14:45

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k172654
accept rate: 74%

Hi Reto, First of all thank's for your help. You probably don't use the 6.1 Designer Version. Your query doesn't work because of the executor(). It tooks me a lot of time to find a way to get the runtime of the last running case. See below.

import ch.ivyteam.ivy.workflow.CaseState;
import ch.ivyteam.ivy.workflow.query.CaseQuery;
import ch.ivyteam.ivy.workflow.ICase;

CaseQuery caze = CaseQuery.create().where().name().isEqual("Laufzeit").and().state().isEqual(CaseState.DONE);
Number count = ivy.wf.getCaseQueryExecutor().getCount(caze);
ivy.log.info("count "+count); //Zähler prüfen
if (count != 0){
    Recordset erg = ivy.wf.getCaseQueryExecutor().getRecordset(caze.groupBy().businessRuntime());
    ivy.log.info("letzteRuntime "+erg.getField(count-1,0));
}
link

answered 28.06.2016 at 11:00

Gabriele's gravatar image

Gabriele
61668
accept rate: 66%

edited 28.06.2016 at 13:59

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
8.0k11650

I agree, the query from reto only works with 6.2 which will be released this week.

(28.06.2016 at 14:00) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5

Asked: 24.06.2016 at 13:25

Seen: 577 times

Last updated: 28.06.2016 at 14:00