BenefitsEligibilityService Class

Evaluates a constituent’s eligibility for benefits and calculates benefit amounts. This class implements the Callable interface.

Namespace 

PublicSectrSltn

Usage 

BenefitsEligibilityService implements the Callable interface, so you can invoke it generically (for example, from Flow or OmniStudio) without a compile-time reference. It wraps the Integrated Application Connect API.

Evaluate eligible benefits (default action)

Calls ConnectApi.IntegratedApplicationConnect.evaluateBenefits. The response lists each benefit with its benefitId, benefitName, benefitDescription, eligibilityStatus, message, and evaluationOutputs values.

Calculate benefit amounts (action = calculateBenefitAmounts)

Calls ConnectApi.IntegratedApplicationConnect.calculateBenefitAmounts, which returns each benefit with its benefitAmount value.

The call() method always returns null. Read the result from output.get('response').

BenefitsEligibilityService Methods 

Methods for the BenefitsEligibilityService class that evaluate a constituent’s benefit eligibility and calculate benefit amounts.

The following are methods for BenefitsEligibilityService.

  • call(action, args)

    Runs a benefits eligibility operation and writes the result to the output map. Use the action parameter to either evaluate a constituent’s eligible benefits or calculate benefit amounts.

call(action, args) 

Runs a benefits eligibility operation and writes the result to the output map. Use the action parameter to either evaluate a constituent’s eligible benefits or calculate benefit amounts.

Signature 

public Object call(String action, Map<String,Object> args)

Parameters 

action

Type: String

The operation to run. To calculate benefit amounts, set action to calculateBenefitAmounts. For any other value, the method evaluates the constituent's eligible benefits.

args

Type: Map<String,Object>

A map that contains the input, output, and options entries for the operation. The input entry holds the eligibility request data, and the method writes its result to the response key of the output entry.

Return Value 

Type: Object

Always returns null. The operation result is written to the response key of the output map that you pass in args.