Question Corentin Blondeau · Oct 31, 2024

How to call a ClassMethod in Business Process

In a Business Process (Ens.BusinessProcessBPL), how can you correctly call a classMethod?
I know we can call it in a block <code>  :

Or in a <assign>

Are there other ways and/or good practices?
Thanks
Corentin

Product version: Ensemble 2018.1
$ZV: Cache for Windows (x86-64) 2018.1.4 (Build 505_1U) Thu May 28 2020 10:01:40 EDT

Comments

Enrico Parisi · Oct 31, 2024

To call a class method the syntax is:

##class(ClassName).MethodName(params)

0
Corentin Blondeau  Nov 4, 2024 to Enrico Parisi

I aware of that. What I want to is if there is an other way to call a classmethod in a BP

0
Jeffrey Drumm  Nov 4, 2024 to Corentin Blondeau

The conventional method is with an <assign> action. If the classmethod has output or byref variables in its signature, I think a <code> action would be appropriate (I've never tried to set context variables by reference in an <assign>).

This likely goes without saying, but context variables remain available/usable in a code action.

0
Corentin Blondeau  Nov 5, 2024 to Jeffrey Drumm

Thank you
Do you think it can be a good idea to submit a proposition into InterSystems Ideas to have a specific bloc activity to call classMethod?

0
Jeffrey Drumm  Nov 5, 2024 to Corentin Blondeau

I don't personally see the need, and I think InterSystems has better things to spend their time on 😁

0
Flávio Lúcio Naves Júnior  Nov 5, 2024 to Corentin Blondeau

I agree with Jeffrey, it's not something necessary, because <assign> and <code> are calling the methods without issues.

0