cancel
Showing results for 
Search instead for 
Did you mean: 

Does REST call task throw BPMNError?

esakilpi
Champ in-the-making
Champ in-the-making

If REST call task receives http status 400, for example, does it throw a BPMNError so that a boundary error event can catch it? It does not seem to happen. 

9 REPLIES 9

cristinamr
World-Class Innovator
World-Class Innovator

Hi!

I am not so sure about your question but for example, If I take a look into this ActivitiWorkflowEngine java file I can see the errors are controlled like this:

 private static final String ERR_DEPLOY_WORKFLOW = "activiti.engine.deploy.workflow.error";

So, i can make the trace to this activiti-engine-messages properties file where is defined the translation of this error:

activiti.engine.deploy.workflow.error=Failed to deploy workflow definition.

Is this helping you? If not, could you please give us more details about exactly what do you need to know?

Cheers,

Cris.

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc

esakilpi
Champ in-the-making
Champ in-the-making

Actually not. ERR_DEPLOY_WORKFLOW seems to be just a constant holding an error message for a failed deployment.

I mean that, in runtime, if a REST call task submits a request and reveices any other http status than OK it just hangs forever (if you don't attach a timer boundary event). Instead, it should throw a BPMNError so that the process could catch it and do something.  My question is why it does not do it?

esakilpi
Champ in-the-making
Champ in-the-making

And exceptions like this are just logged and the execution hangs:

org.activiti.engine.ActivitiException: error while converting: 897 to long
	at com.activiti.runtime.activiti.BaseRestCallDelegate.getFormattedLongValue(BaseRestCallDelegate.java:760)
	at com.activiti.runtime.activiti.BaseRestCallDelegate.createJSONRequestObject(BaseRestCallDelegate.java:307)

It would be nice to know why numbers cannot be converted to long...

esakilpi
Champ in-the-making
Champ in-the-making

https://alfresco.atlassian.net/browse/MNT-18756

Seems no work has been logged...

abbask01
Star Collaborator
Star Collaborator

No, it does not. create your custom service (fo a service task) that does the rest call and throws appropriate errors as you may need.

Regards,
Abbas

wojtekb
Champ in-the-making
Champ in-the-making

Hi, do you have any example of custom service task that does rest call? 

abbask01
Star Collaborator
Star Collaborator

you can use rest template to call rest apis from code. if you have stored your URLS in admin endpoint, use APS' endpointService to access them

Regards,
Abbas

esakilpi
Champ in-the-making
Champ in-the-making

Do you have an exaple of how to use EndpointService?

abbask01
Star Collaborator
Star Collaborator

AFAIK EndpointService belongs to enterprise apis (of APS). contact alfresco for APS javadocs to kown usage and other details,

Regards,
Abbas