# Why Service Task do not support Category?

**URL:** <https://forum.flowable.org/t/why-service-task-do-not-support-category/5963>\
**Category:** Flowable Application\
**Created:** [May 5, 2020, 12:14pm UTC](https://forum.flowable.org/t/why-service-task-do-not-support-category/5963 "2020-05-05T12:14:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maheshus007](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@maheshus007](https://forum.flowable.org/u/maheshus007)\
**Post date:** [May 5, 2020, 12:14pm UTC](https://forum.flowable.org/t/why-service-task-do-not-support-category/5963/1 "2020-05-05T12:14:35Z")

</div>

Team,

Could you please clarify, Why Service Task do not support Category?

I need to add a category code(like a string) on Service Task, how i can add that?

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [May 6, 2020, 8:10am UTC](https://forum.flowable.org/t/why-service-task-do-not-support-category/5963/2 "2020-05-06T08:10:38Z")

</div>

Hey @maheshus007,

What exactly are you trying to achieve?

Service Task is a normal `Execution` and those do not support categories either. Category is something specific for the User Tasks. That is a meta data for the persisted user tasks in the DB.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![joyal.joy777](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joyal.joy777/32/1791_2.png) [@joyal.joy777](https://forum.flowable.org/u/joyal.joy777)\
**Post date:** [May 6, 2020, 8:58am UTC](https://forum.flowable.org/t/why-service-task-do-not-support-category/5963/3 "2020-05-06T08:58:33Z")

</div>

Hi @filiphr,

So we need to categorize different kind of service tasks that we support. We do have different kind of user tasks which we distinguished via the category attribute(which is more of static information and need to include in the model). we are **looking for a generic attribute which is common to all kind of tasks** in Flowable, which we can use to distinguish our custom tasks in the business logic.

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [May 6, 2020, 9:01am UTC](https://forum.flowable.org/t/why-service-task-do-not-support-category/5963/4 "2020-05-06T09:01:53Z")

</div>

Hey @joyal.joy777,

If you have access to the `FlowElement` then you can put whatever you want in the `extensionElements`. Everything which is in the XML is available during the execution. However, not as metadata on the Execution.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![hbrls](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/hbrls/32/2906_2.png) [@hbrls](https://forum.flowable.org/u/hbrls)\
**Post date:** [August 15, 2022, 12:16pm UTC](https://forum.flowable.org/t/why-service-task-do-not-support-category/5963/5 "2022-08-15T12:16:38Z")

</div>

`TENANT_ID_` is passed through. But not all `executors` use the value.

`CATEGORY_` is not passed. You can set it in `bpmn.xml` by `extensionElements` for **every** activity. Which I think can be set programly traversely when upload the xml.

I use both/mixed of the 2 for `tenant like` infra. So that `server/executor A` will only take jobs of `tenant/category A`, `server/executor B` will only take jobs of `tenant/category B`.
