forA with a list and additional parameter
- Ashok_RajOP 1
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 choicei tried
forA listContracts function1 party function1 : ContractTemplate -> Party->TriggerA () () function1 contracts party = doIf there is no option, is there a way to pull the current party thats running the trigger with a function
- cocreature 1
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)