Forum OpenACS Q&A: Response to pgplsql and output parameters

Collapse
Posted by Dan Wickstrom on
A good way to fix this would be to just move the notification call inside the callback. This would alleviate the need to pass the callback parameters back out of the callback function. Currently the workflow_case__notify_assignee is the only one that makes use of the notify_assignee__callback. The structure is as follows:
        -- FIXME: last three args are also out varibles.

        if notify_assignee__callback != '''' and notify_assignee__callback is not null then
            v_str :=  ''select '' || notify_assignee__callback || ''('' || 
                      notify_assignee__task_id || '','' ||
                      coalesce(quote_literal(notify_assignee__custom_arg),''null'') || 
                      '','' ||
                      notify_assignee__user_id || '','' ||
                      v_party_from || '','' ||
                      quote_literal(v_subject) || '','' ||
                      quote_literal(v_body) || '')'';

            execute v_str;
        end if;
            
        v_request_id := acs_mail_nt__post_request (       
            v_party_from,                 -- party_from
            notify_assignee__user_id,     -- party_to
            ''f'',                        -- expand_group
            v_subject,                    -- subject
            v_body,                       -- message
            0                             -- max_retries
        );


If nobody has an objections, I can move remove the acs_mail_nt__post_request call and leave a comment here that we should include the call in any callback functions that we write. I also could modify the sample code so that it incorporates these changes.