Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/forA with a list and additional parameterForum ↗

forA with a list and additional parameter

App Development2 posts181 views2 likesLast activity Jun 2022
AS
Ashok_RajOP
Jun 2022

In trigger, I am using forA to run a function over a list. Addiitional i want to pass the party which is running the trigger as a parameter to the same function. How do i do that.

here is the flow

list <- Query and filter contracts
apply function Func1 on the each contract on the list
Inside Func1, I am exercising a choice, where i need to specify who is the party that's exercising the choice

i tried

forA listContracts function1 party

function1 : ContractTemplate -> Party->TriggerA () ()
function1 contracts party = do

If there is no option, is there a way to pull the current party thats running the trigger with a function

CO
cocreature
Jun 2022

You can do something like this

rule party = do
  …
  forA … (\c -> function1 c party)

It’s common to swap the arguments to such functions if you often use them this way, then you can do something like this:

function1 : Party -> ContractTemplate -> TriggerA () ()
function1 = …

rule party = do
  …
  forA … (function1 party)
← Back to Discussions