cancel
Showing results for 
Search instead for 
Did you mean: 

Executing Asynchronous Processes from exception point

sankardunga
Champ in-the-making
Champ in-the-making
Hello,

I have multiple service tasks in my process. I'm not able to re-execute the job from exception point of particular task.

I'm using ''managementService.executeJob(id)'' for executing the particular job, here it is executing the process from service task1.

How to run the job from the exeception point of a process ?

Thanks in advance…Smiley Happy


26 REPLIES 26

trademak
Star Contributor
Star Contributor
Hi,

If you want to run it from the exception point, is that a service task as well?
Then you could make that service task asynchronous.

Best regards,

sankardunga
Champ in-the-making
Champ in-the-making
Thanks for reply…
Ya, I made it asynchronous, This the format I have written in my process
    "<serviceTask id="id" name="testTask" activiti:async="true" activiti:expression="#{test.processEvent(data)}"></serviceTask>"

It is creating a job entry in the data table whenever exception occurs, and after that I'm trying to re execute this job using
                ''managementService.executeJob(id)''
Its starting the process from service task one instead . Is there any other api or sysntax modification required to start the service from the exception point ?

sankardunga
Champ in-the-making
Champ in-the-making
Here I'm using my own exception handlers, I don't whether it ll be the reason for this problem or not. If that is the reason, please give me a way to handle the exceptions. Please help me in scenario…

jbarrez
Star Contributor
Star Contributor
To run the job automatically, you will need to start the job executor (it's a configuration option). No need to call the managementService then when it's running.

sankardunga
Champ in-the-making
Champ in-the-making
Hi jbarrez,
My question is not about 'How to run jobs'. If it is possible can you please give me the relative answer.

jbarrez
Star Contributor
Star Contributor
> My question is not about 'How to run jobs'. If it is possible can you please give me the relative answer.

Excuse me. I was confused by your hard to follow explanation of your problem.

>Its starting the process from service task one instead . Is there any other api or sysntax modification required to start the service from the exception point ?

Hence my response. If you have an exception in a service task that is asynchronous, it will be in a job with a retries count 0. You will need to execute the job yourself at that point. But then again, I really don't understand the problem you are describing.

sankardunga
Champ in-the-making
Champ in-the-making
Thanks jbarrez.

I understood the asynchronous process flow, its going fine.  And I faced issues because of two process engines running at same time in my system.

And is there any  way to read the runtime variable data and also serialized data from act_ge_bytearray?
I mean like "SELECT * FROM act_ru_variable WHERE PROC_INST_ID_ = ?"


frederikherema1
Star Contributor
Star Contributor
Variables can be read through the API, using runtimeService.getVariables(executionId) or inside a JavaDelegate/listener, use DelegateExecution.getVariables(). The returned map contains all variables, including deserialized POJO's and byte-arrays form ACT_BE_BYTEARRAY.

sankardunga
Champ in-the-making
Champ in-the-making
Thanks man, its very helpful to me.
One more doubt, how can I pass my own exceptions messages to the activiti table. Right now when some exception occurs it is placing activiti exception message in database(ie in ACT_RU_JOB table) instead of user-defined exception message. I mean the following exception is placing when exception occurs in service task,
             "Error while evaluating expression: #{server.processEvent(data)}"
but I want to place my own eception, How can I achieve this ?