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.
joram
June 28, 2020, 9:56am
2
Not sure I’m following yet. How are you creating the body in BPMN? Could you paste your CMMN xml for the http task?
poly
July 18, 2022, 10:07am
3
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
Thanks
joram
July 18, 2022, 10:11am
4
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
poly
July 18, 2022, 12:03pm
5
thanks for your reply,
here is my simple model downloaded from modeler:
<?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>```
poly
July 18, 2022, 12:49pm
6
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):
I’m wondering why these differences between the two.
thanks
joram
July 20, 2022, 8:57am
7
Looking at your CMMN xml, the reason is most likely
<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.
poly
July 20, 2022, 9:17am
8
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
joram
July 20, 2022, 9:57am
9
If you’re working with the REST API, you can deploy the XML using the rest api via
poly
July 21, 2022, 3:01pm
10
with rest api deployment it works well, if any fix will be presented in the modeler how may I get notified about ?
Thanks
joram
July 22, 2022, 4:37pm
11
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)