# Cmmn Http Task Requestbody Construct Json Issue

**URL:** <https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277>\
**Category:** Flowable Designer\
**Created:** [June 26, 2020, 10:05am UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277 "2020-06-26T10:05:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pachu-git](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@Pachu-git](https://forum.flowable.org/u/Pachu-git)\
**Post date:** [June 26, 2020, 10:05am UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/1 "2020-06-26T10:05:32Z")

</div>

Hi Team,

I am new to Flowable. Using version 6.5.0

Currently, I am testing Httptask in both process and case model.

Like for example:

bodyExpression=“123”

\<flowable:field name=“requestBody”\>  
flowable:expression\</flowable:expression\>  
\</flowable:field\>

In process(bpnm):

I can see the value “123” on the backend (spring boot);

In case model (cmmn)

Found ${bodyExpression}

exception:  
Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unrecognized token ‘': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token '’: was expecting (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’)

I couldn’t find a way to create dynamic json to put as request body in case model.

Any input on this will be appreciated.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [June 28, 2020, 9:56am UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/2 "2020-06-28T09:56:43Z")

</div>

Not sure I’m following yet. How are you creating the body in BPMN? Could you paste your CMMN xml for the http task?

---

<div class="post-metadata">

**Author:** ![poly](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@poly](https://forum.flowable.org/u/poly)\
**Post date:** [July 18, 2022, 10:07am UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/3 "2022-07-18T10:07:08Z")

</div>

I’m having the same problem and still looking for a workaround, did you resolve it ?  
CMMN Http Task request body is sent as string format always not executed as expression unlike the bpmn.  
I posted this in the forum with no answers  
[9521](https://forum.flowable.org/t/send-case-instance-id-in-http-task-request-body/9521)  
Thanks

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [July 18, 2022, 10:11am UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/4 "2022-07-18T10:11:05Z")

</div>

Can you share your model? Looking at the runtime code, it’s resolved as an expression, so not sure why it’s not working: [flowable-engine/BaseHttpActivityDelegate.java at main · flowable/flowable-engine · GitHub](https://github.com/flowable/flowable-engine/blob/main/modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java#L98)

---

<div class="post-metadata">

**Author:** ![poly](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@poly](https://forum.flowable.org/u/poly)\
**Post date:** [July 18, 2022, 12:03pm UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/5 "2022-07-18T12:03:30Z")

</div>

thanks for your reply,  
here is my simple model downloaded from modeler:

````auto
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/cmmn" xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" targetNamespace="http://www.flowable.org/casedef" exporter="Flowable Open Source Modeler" exporterVersion="6.7.2">
  <case id="besoinItCmmnModel_" name="Http - CMMN - 1 Gestion du besoin " flowable:initiatorVariableName="initiator">
    <documentation>Première étape du processus </documentation>
    <casePlanModel id="casePlanModel" name="Gestion du besoin" flowable:formFieldValidation="true">
      <planItem id="planItem3" name="Monitoring du besoin" definitionRef="monitoring">
        <itemControl>
          <requiredRule></requiredRule>
        </itemControl>
      </planItem>
      <stage id="monitoring" name="Monitoring du besoin" autoComplete="true">
        <planItem id="planItem1" name="Introduire le besoin" definitionRef="introduireBesoin">
          <itemControl>
            <requiredRule></requiredRule>
          </itemControl>
        </planItem>
        <planItem id="planItem2" name="Notification Mail" definitionRef="httpEmailNotification">
          <itemControl>
            <requiredRule></requiredRule>
          </itemControl>
          <entryCriterion id="sid-626FA8D9-FE83-4277-A6E3-EC17B6FD24F7" sentryRef="sentry1"></entryCriterion>
        </planItem>
        <sentry id="sentry1">
          <planItemOnPart id="sentryOnPart1" sourceRef="planItem1">
            <standardEvent>complete</standardEvent>
          </planItemOnPart>
        </sentry>
        <humanTask id="introduireBesoin" name="Introduire le besoin" flowable:candidateGroups="supAdmFct" flowable:formFieldValidation="true">
          <extensionElements>
            <modeler:group-info-name-supAdmFct xmlns:modeler="http://flowable.org/modeler"><![CDATA[Support admin fonctionnel]]></modeler:group-info-name-supAdmFct>
            <modeler:flowable-idm-candidate-group xmlns:modeler="http://flowable.org/modeler"><![CDATA[true]]></modeler:flowable-idm-candidate-group>
            <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
          </extensionElements>
        </humanTask>
        <task id="httpEmailNotification" name="Notification Mail" isBlocking="false" flowable:type="http" flowable:parallelInSameTransaction="true">
          <extensionElements>
            <flowable:field name="requestMethod">
              <flowable:string><![CDATA[POST]]></flowable:string>
            </flowable:field>
            <flowable:field name="requestUrl">
              <flowable:string><![CDATA[http://localhost:8081/emap-api/v1/sendEmail]]></flowable:string>
            </flowable:field>
            <flowable:field name="requestBody">
              <flowable:string><![CDATA[${caseInstance.caseDefinitionId}]]></flowable:string>
            </flowable:field>
            <flowable:field name="requestTimeout">
              <flowable:string><![CDATA[60000]]></flowable:string>
            </flowable:field>
          </extensionElements>
        </task>
      </stage>
    </casePlanModel>
  </case>
  <cmmndi:CMMNDI>
    <cmmndi:CMMNDiagram id="CMMNDiagram_besoinItCmmnModel_">
      <cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
        <dc:Bounds height="472.6938730780944" width="779.578125" x="41.1522649357064" y="57.74384416625003"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem3" cmmnElementRef="planItem3">
        <dc:Bounds height="276.0" width="683.0" x="74.0" y="105.0"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
        <dc:Bounds height="80.0" width="100.0" x="207.0" y="135.0"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
        <dc:Bounds height="80.0" width="100.0" x="210.0" y="285.0"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_sid-626FA8D9-FE83-4277-A6E3-EC17B6FD24F7" cmmnElementRef="sid-626FA8D9-FE83-4277-A6E3-EC17B6FD24F7">
        <dc:Bounds height="22.0" width="14.0" x="250.0" y="273.0"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNEdge id="CMMNEdge_sid-DAD3287A-985D-4F1A-952B-64E63428C52B" cmmnElementRef="planItem1" targetCMMNElementRef="sid-626FA8D9-FE83-4277-A6E3-EC17B6FD24F7">
        <di:extension>
          <flowable:docker type="source" x="50.0" y="40.0"></flowable:docker>
          <flowable:docker type="target" x="7.0" y="0.0"></flowable:docker>
        </di:extension>
        <di:waypoint x="257.0" y="214.95000000000002"></di:waypoint>
        <di:waypoint x="257.0" y="273.0"></di:waypoint>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNEdge>
    </cmmndi:CMMNDiagram>
  </cmmndi:CMMNDI>
</definitions>```
````

---

<div class="post-metadata">

**Author:** ![poly](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@poly](https://forum.flowable.org/u/poly)\
**Post date:** [July 18, 2022, 12:49pm UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/6 "2022-07-18T12:49:10Z")

</div>

Just a small notice also when we see the request method in bpmn modeler (dropdown choices) and in cmmn we can notice how less dynamic is the value to enter (string):

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/b/b9cedca41213d5914c9503ecbb7bd56cfd58e3b3.png)

I’m wondering why these differences between the two.  
thanks

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [July 20, 2022, 8:57am UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/7 "2022-07-20T08:57:12Z")

</div>

Looking at your CMMN xml, the reason is most likely

```auto
 <flowable:field name="requestBody">
              <flowable:string><![CDATA[${caseInstance.caseDefinitionId}]]></flowable:string>
            </flowable:field>

```

Which is a String and not an expression. You modeled this with the Flowable Modeler? If so, that’s a bug in the Modeler, it (probably) should be expression instead of string.

---

<div class="post-metadata">

**Author:** ![poly](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@poly](https://forum.flowable.org/u/poly)\
**Post date:** [July 20, 2022, 9:17am UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/8 "2022-07-20T09:17:01Z")

</div>

exactely it’s from modeler and it’s downloaded that way, even if I change the xml manually to workaround it to expression and upload it again in modeler it’s again string if I try to get it back.  
and it’s the same thing for requestHeader, requestUrl so if it’s a modeler bug would be perfect if it gets fixed all together 🙂  
Otherwise is there any other mean to upload my cmmn xml without modeler ? (we work with RestApi) thanks in advance

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [July 20, 2022, 9:57am UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/9 "2022-07-20T09:57:58Z")

</div>

> [@poly](#):
>
> Otherwise is there any other mean to upload my cmmn xml without modeler ? (we work with RestApi)

If you’re working with the REST API, you can deploy the XML using the rest api via

> **[REST API · Flowable Open Source Documentation](https://www.flowable.com/open-source/docs/cmmn/ch08-REST#create-a-new-deployment)**
>
> \## General Flowable REST principles

---

<div class="post-metadata">

**Author:** ![poly](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@poly](https://forum.flowable.org/u/poly)\
**Post date:** [July 21, 2022, 3:01pm UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/10 "2022-07-21T15:01:20Z")

</div>

with rest api deployment it works well, if any fix will be presented in the modeler how may I get notified about ?  
Thanks

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [July 22, 2022, 4:37pm UTC](https://forum.flowable.org/t/cmmn-http-task-requestbody-construct-json-issue/6277/11 "2022-07-22T16:37:48Z")

</div>

By checking the flowable blog / github repo for releases, there’s no automated way here.

(Putting my enterprise hat on: this is one of the benefits of becoming an enterprise customer, logged bugs will be tracked and you’ll get notified)
