cancel
Showing results for 
Search instead for 
Did you mean: 

Async taskdefinitions.

susubhas
Champ in-the-making
Champ in-the-making
Is there a way to find out if a task is async, the usecase is if a process has async task then i should throw error to the user. I checked TaskDefinition class there is no api to check if a task is async…
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
TaskDefinition is only the UserTask-specific bit. Inspect the actual ActivityImpl which is present in the ReadOnlyProcessDefinition (repositoryService):


public interface PvmActivity extends PvmScope {
 
  boolean isAsync();

Alternatively, you could add a BPMNParseListener (in 5.12, this will be a slight different name and approach, but the end-result will be the same) and inspect the XML-element or the intermediate model, so you can throw an exception when the process is deployed (as of 5.11):


/**
* @author Tijs Rademakers
*/
public class Activity extends FlowNode {



  public boolean isAsynchronous() {
    return asynchronous;
  }

In case you're using a version prior to 5.11, you can always inspect the "async" attribute in the XML-element, passed in the BPMNParseListeners…

susubhas
Champ in-the-making
Champ in-the-making
Thank you frederikheremans Smiley Happy