Does REST call task throw BPMNError?

cancel
Showing results for 
Search instead for 
Did you mean: 
esakilpi
Member II

Does REST call task throw BPMNError?

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
cristinamr
Intermediate II

Re: Does REST call task throw BPMNError?

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.

--
Check our products: AQuA : https://aqua.venzia.es | Seidoc : https://seidoc.es
esakilpi
Member II

Re: Does REST call task throw BPMNError?

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
Member II

Re: Does REST call task throw BPMNError?

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
Member II

Re: Does REST call task throw BPMNError?

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

Seems no work has been logged...

abbask01
Senior Member

Re: Does REST call task throw BPMNError?

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
Customer

Re: Does REST call task throw BPMNError?

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

abbask01
Senior Member

Re: Does REST call task throw BPMNError?

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
Member II

Re: Does REST call task throw BPMNError?

Do you have an exaple of how to use EndpointService?

abbask01
Senior Member

Re: Does REST call task throw BPMNError?

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

Regards,
Abbas