Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

How to know if a task is running using JAVA API

Avatar

Level 3

I'm using this quickstart to create a process that returns all the current running tasks. If you look at the code, if the current task status == 100 then it is a completed task. What is the constant for a running task?

I've looked here     but it doesn't list a constant the equates to still running. Is this the correct way to go about this or should I be trying something different?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

This link should take you to the TaskStatusTypes javadocs.

http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/javadoc/com/adobe/idp/taskmanager/dsc/clie...

There are 4 status' for active tasks, CREATED (1) and CREATED_SAVED (2) for active tasks that start processes, where the process instance isn't created until this task is completed, and ASSIGNED (3) and ASSIGNED_SAVED (4) for active tasks associated with a process instance.  The _SAVED status means that an incremental save of the data was done such as Save To Drafts from Workspace.

Non-active tasks are COMPLETED (100), DEADLINED (101) and TERMINATED (102), note that all are >= to the COMPLETED status, so conversely, any status < COMPLETED is active. 

View solution in original post

1 Reply

Avatar

Correct answer by
Former Community Member

This link should take you to the TaskStatusTypes javadocs.

http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/javadoc/com/adobe/idp/taskmanager/dsc/clie...

There are 4 status' for active tasks, CREATED (1) and CREATED_SAVED (2) for active tasks that start processes, where the process instance isn't created until this task is completed, and ASSIGNED (3) and ASSIGNED_SAVED (4) for active tasks associated with a process instance.  The _SAVED status means that an incremental save of the data was done such as Save To Drafts from Workspace.

Non-active tasks are COMPLETED (100), DEADLINED (101) and TERMINATED (102), note that all are >= to the COMPLETED status, so conversely, any status < COMPLETED is active. 

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----