Flowable6.2.1 http task with error and how to auto retry?

<serviceTask id="sid-40A9652C-7B7F-43A0-A9A5-AA6B8551CEF7" name="syn hr system" flowable:async="true" flowable:exclusive="false" flowable:type="http">
  <extensionElements>
    <flowable:field name="requestMethod">
      <flowable:string><![CDATA[POST]]></flowable:string>
    </flowable:field>
    <flowable:field name="requestUrl">
      <flowable:string><![CDATA[http://localhost:8312/vos_api/sync_workflow_data?app=vos&secret=aa3807c708efd3305ef2325948dfe82a]]></flowable:string>
    </flowable:field>
    <flowable:field name="requestHeaders">
      <flowable:string><![CDATA[content-type:application/json]]></flowable:string>
    </flowable:field>
    <flowable:field name="requestBody">
      <flowable:expression><![CDATA[${changeTasks}]]></flowable:expression>
    </flowable:field>
    <flowable:field name="failStatusCodes">
      <flowable:string><![CDATA[4XX,5XX]]></flowable:string>
    </flowable:field>
    <flowable:field name="saveResponseParameters">
      <flowable:string><![CDATA[hrTask]]></flowable:string>
    </flowable:field>
    <flowable:failedJobRetryTimeCycle>R3/PT5S</flowable:failedJobRetryTimeCycle>
  </extensionElements>
</serviceTask>

Above is my bpmn config, my problem is when call http://localhost:8312/vos_api/sync_workflow_data?app=vos&secret=aa3807c708efd3305ef2325948dfe82a and return http 500, flowable not retry call this api again, is there any problem and how to modify it?

Thanks!

Hi,

i think service task retry works only when an error occured while service task(HTTP task is special implementation of service task) code execution but since error occured in the API you called, so for service task, everything went fine (it got a response from API) i.e. no error in execution of service task code so i didnt retry. I think you have to write the logic to retry yourself.

Thank You,
Arpit Agrawal

I see, may be I should change a way to implement it. Thank you!

Hi,

Look at the failStatusCode property of HTTP Task. Here you can provide status code for which you want to fail this service task and flowable will throw Flowable Exception which will cause automatic retry of task. Refer to configuration properties here : https://www.flowable.org/docs/userguide/index.html#bpmnHttpTask

Thanks,

Hi Arpit,

can you please provide us the sample code to execute HTTP task.

Regards,
Hari

Hi Hari,

You dont need to write any code if you just want to use HTTP Task. All you need to do is add the HTTP task in your workflow and configure it ( see configuration options here : https://www.flowable.org/docs/userguide/index.html#bpmnHttpTask ) according to your use case from modeler only. No need to write any additional code.

Thank You,
Arpit Agrawal

Thanks for replying Arpit,
But i want the java code to execute Http task.

@hari.shan89 I’ve already answered your question in another thread. If you still have problems please create a new thread (question) and give us more details so we can help you out

I guess in the problem statement above , (the question itself), he provided the failStatusCode as 5XX and the http task is returning 500 , but still retry is not happening .