# How to call a domain logic function inside pre-condition?
PREREQUISITE
Define a reference variable to the domain logic inside the command-set.
command-set Lottery { domain-logic-ref lotteryDomainLogicRef:Lottery ... }Call the respective domain function using the reference variable inside the pre condition
command-set Lottery { domain-logic-ref lotteryDomainLogicRef:Lottery command create{ input(lotteryName:String,amount:Int) pre{ condition NewLotteryName => !(lotteryDomainLogicRef.lotteryNameExists(input.lotteryName)) failing "Lottery Name Already Exists !" ... } ... } }