FetchAndLock an External Task

Hi all,

i’m developing a little BPM that uses an ExternalTask to handle a specific activity.
The activity have to be handled by an external application.

My need is to fetchAndLock a specific task from the external application.
I’have tried to add a variable in the ExternalTask topic without success.

My question is:
it is possible to fetchAndLock a specific externalTask without use of its priority (available only from 7.5) ?

Thanks in advance
Sabatino

Hi,

To answer your question: Yes, just set the usePriority parameter to false when fetching tasks.

Cheers,
Thorben

Hi Thorben,

thanks for your answer and sorry for my late response.
I think that i wasn’t clear enough.

Suppose that we have 3 external tasks non locked, belonging to the topic ‘ExternalTaskToProcess’,

  • external task 1 - id 123
  • external task 2 - id 456
  • external task 3 - id 789

is there a way to fetch and lock only the task 2 (with id 456) and leave unfetched the task 1 and 3 ?

Thanks,
Sabatino

Hi,

No, that is not possible. The fetch and lock API treats all tasks equally that belong to the same topic. As you have noted, you can assign priorities to tasks to control which tasks are fetched next. In addition, the API does not fetch suspended tasks or tasks with zero retries. However, that is all, so there is no general purpose querying possibility for fetch and lock.

Cheers,
Thorben

Hi Thorben,

thanks for your kindly support.

Regards
Sabatino

Hi @all,

for a special Business Process i need also to fetchAndLock an ExternalTask by id.

Is there a reason why this is not possible?

Would it make sense to open a Change Request ?

Regards Patrick

Hi Patrick,

i have the same requirement.
In my scenario, i have to fetch a specific task.

I’ve tried to set the topicName with something like ${mySpecificTopicName}, in order to query the external tasks by it’s dedicated topicName.
As per my understanding, there is no possibility to use an expression in topicName field.
Please someone correct me if I’m wrong.

What do you think about the possibility to set the topicName dynamically instead of get the list of all the external tasks and then fetchAndLock one of them ?

Regards
Sabatino

Hey Sabatino,

i tried the same without success.

Another way i wanted to test was to use the execution listener with a startEvent and then manipulate the topic name.

Regards Patrick

Being able to use expressions for an external task topic would certainly be a good addition. Feel free to create a JIRA feature request. You can also consider submitting a pull request for that to get it done.

Cheers,
Thorben

Should i make a Feature Request ? Or do you like to do that ?

Hi Patrick,

let’s go on with a feature request.

Please submit it in our JIRA and link to this topic.