Question
· Oct 19, 2019

Best way to programatically call a Business Process from Code

HI

 

We can easily do a <call> from graphic BPL's

 

I was wondering what is the best way we can call another Business Process or Operation via code.

Thanks in advance

Discussion (6)2
Log in or sign up to continue

Hey Marc,

I agree Business Service is  a standard approach and that's what I would have used too when needed. 

And as you pointed it shows a request going from Service and it works if we call it from CSP , ZEN etc

What I am trying to achieve is an exact functionality from custom bpl code as we do from a graphic bpl.  
Lets say for ex
my bpl takes x ,y as request properties
calls an op to sum them and return the result in response
stores the result in z
passes the z to a second op to send to some system.

Now in a graphic bpl this is straight forward 2 step work, I just wanted to know how to do it in custom code.

The exact traces etc as we would see via graphic bpl.  

Neerav, I'll just note that if you use Jenna's suggestion your code doesn't need to be a part of a business service -- it can be any normal ObjectScript code and can be called from anywhere (CSP, scheduled task, etc.). And your code can make as many calls as it needs to and can receive response messages.

It will appear in message traces as if a business service sent requests to the process or operation, but in reality it's just your code sending the requests.

Jenna's approach is a good one, and it's the standard way to achieve what you describe. Having said that, if you can provide more details on your use case and/or why this approach doesn't fit your need we can help you explore alternatives.