# Custom header values for service task - complex BPMN2 extensions

**URL:** <https://forum.flowable.org/t/custom-header-values-for-service-task-complex-bpmn2-extensions/7247>\
**Category:** Uncategorized\
**Created:** [December 23, 2020, 9:02am UTC](https://forum.flowable.org/t/custom-header-values-for-service-task-complex-bpmn2-extensions/7247 "2020-12-23T09:02:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tina.bandalo](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@tina.bandalo](https://forum.flowable.org/u/tina.bandalo)\
**Post date:** [December 23, 2020, 9:02am UTC](https://forum.flowable.org/t/custom-header-values-for-service-task-complex-bpmn2-extensions/7247/1 "2020-12-23T09:02:10Z")

</div>

Hi,

all our extension fields for standard Flowable FlowNode are primitive expression values, which extend the FlowNodes via BPMN2 extension Elements. Upon runtime, when the corresponding behaviors/delegates get called, the relevant values get injected as org.flowable.common.engine.api.delegate.Expression where required.

Is it possible to specify complex extension elements like a list with name/value pairs? If not is there another way?

Regards,

Tina

---

<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:** [December 23, 2020, 11:08am UTC](https://forum.flowable.org/t/custom-header-values-for-service-task-complex-bpmn2-extensions/7247/2 "2020-12-23T11:08:57Z")

</div>

Hey @tina.bandalo,

The extension elements are extremely flexible and you can provide nested structures as you want.

As an example have a look at

> <https://github.com/flowable/flowable-engine/blob/9a102f654d8280e93b871d3e21400645707741fc/modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/multiinstance/MultiInstanceVariableAggregationTest.testParallelMultiInstanceUserTask.bpmn20.xml#L17-L21>

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![Rouvenday](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@Rouvenday](https://forum.flowable.org/u/Rouvenday)\
**Post date:** [December 28, 2020, 8:39am UTC](https://forum.flowable.org/t/custom-header-values-for-service-task-complex-bpmn2-extensions/7247/3 "2020-12-28T08:39:31Z")

</div>

Hi @filiphr,

thanks a lot for the answer. I want to follow-up on Tinas question.

How exactly would I store a list of key-value pairs in the extension then?

Let´s assume I have the following ordered key-value list:

```
1 = January
2 = February
3 = March

```

How would I store these pairs as part of the extension elements?

Thanks,  
Rouven

---

<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:** [January 4, 2021, 8:23am UTC](https://forum.flowable.org/t/custom-header-values-for-service-task-complex-bpmn2-extensions/7247/4 "2021-01-04T08:23:17Z")

</div>

Hey @Rouvenday,

The way you want to store this is entirely up to you.

There are multiple ways to store it e.g.

```auto
<flowable:monthPair key="1" value="January" />
<flowable:monthPair key="2" value="February" />
<flowable:monthPair key="3" value="March" />

```

or

```auto
<flowable:months>
    <month key="1" value="January" />
    <month key="2" value="February" />
    <month key="3" value="March" />
</flowable:months>

```

When you have a control over the creation of the `BpmnModel` it is entirely up to you to decide how you want to store it.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![Rouvenday](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@Rouvenday](https://forum.flowable.org/u/Rouvenday)\
**Post date:** [January 5, 2021, 10:10am UTC](https://forum.flowable.org/t/custom-header-values-for-service-task-complex-bpmn2-extensions/7247/5 "2021-01-05T10:10:09Z")

</div>

Hi @filiphr,

Thanks a lot.

Is it also possible to inject complex structures into the field of the delegated class?

Something similar to this (pseudo xml):

```
<flowable:field name="months">
    <flowable:field name="1" expression="${firstMonth}" />
    <flowable:field name="2" expression="${secondMonth}" />
    <flowable:field name="3" expression="${thirdMonth}" />
</flowable:field>

```

Best Regards,  
Rouven
