cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt: Assinchronus methods accept parameters ?

glauco
Active Contributor
0 Kudos
45

Friends,

I've created some return parameters to synchronous methods. After that, I needed to change those methods to not synchronous type. After that some errors apear when I verify the object. the message is that not synchronous methods can't have parameters.

How can I do to return values to that ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Glauco,

Non-sync methods can't return any parameters. Why do you want to return the parameters for non-sync method?

Any way, the only way I see is to publish an event in your non-sync method and pass the relevant parameters to event container. Then use this event in the workflow as a prerequisite for the next step and read the parameters from the event container.

Regards,

Sandeep

glauco
Active Contributor
0 Kudos

It's a good solution, I think.

I'll try to do it.

ps.:I'm using non-sync method because, in the WI, carry the user to an custom transaction and then the user clicks on a button that carry him to MIGO, and the MIGO, on SAVE, is triggering an event created by me in the object, that is used in this WI as an Terminating event. I have to do in this way because the WI don't carry to MIGO directly... and is was a sync method, in this first strp the WI would desapear.

thanks.

ramki_maley
Active Contributor
0 Kudos

Glauco,

I would not recommend it. If you were to trigger the terminating event from your async method, it is possible that MIGO did not complete before your event is triggered. Also if a user were to execute the custom transaction directly (not from SBWP by executing the WI), your event will never be triggered. Instead look for ways to pass the parameters from the MIGO event. Or insert a background step that will fetch the required data after the step that calls MIGO.

Cheers,

Ramki.

Message was edited by: Ramki Maley

glauco
Active Contributor
0 Kudos

Yes, but I'm using the triggering event (an event that is configured as a terminating event in the task) in the SAVE moment of MIGO.