public List < String > getRecipients ( String workgroupsAttr , String expressionAttr ) throws DataAccessException , ParseException { List < String > recipients = new ArrayList <> ( ) ; if ( workgroupsAttr != null ) { String workgroups = context . getAttribute ( workgroupsAttr ) ; if ( workgroups != null && ! workgroups . isEmpty ( ) ) { for ( String groupEmail : getGroupEmails ( StringHelper . parseList ( workgroups ) ) ) { if ( ! recipients . contains ( groupEmail ) ) recipients . add ( groupEmail ) ; } } } if ( expressionAttr != null ) { String expression = context . getAttribute ( expressionAttr ) ; if ( expression != null && ! expression . isEmpty ( ) ) { List < String > expressionEmails ; if ( expression . indexOf ( "${" ) >= 0 ) expressionEmails = getRecipientsFromExpression ( expression ) ; else expressionEmails = Arrays . asList ( expression . split ( "," ) ) ; for ( String expressionEmail : expressionEmails ) { if ( ! recipients . contains ( expressionEmail ) ) recipients . add ( expressionEmail ) ; } } } return recipients ; }
Default behavior returns the UNION of addresses specified via the expression attribute along with those specified by the designated workgroups attribute .