Skip to content

Keyword

invokeReactor

Back to Index
      
invokeReactor( reactorId: text method: text argument: value ): value | Error

The invokeReactor function allows Reactors to call methods from other (or current) Reactors and receive the result.

Availability

Discount Rule Reactor

Return Value

The return value from the call is the value returned from the given reactor.

Recursions and Loops

By having a reactor call itself it’s possible to introduce recursion, and more specifically infinite recursion. To prevent this and ensure stable operations, there’s a max call depth that will trigger an error. The limit for cloud instances are 10 calls, while enterprise instances may configure this.

Error Handling

Error may be returned if the specified reactorId or method doesn’t exist, or the given argument is invalid.

Examples

from invokeReactor(
'myReactor',
'myMethod',
nothing
) match
Error |> 'An error occurred'
(result: value) |> result
Back to Index