3244: end if;
3245:
3246:
3247:
3248: corrId := wf_event.getValueForParameter('Q_CORRELATION_ID',
3249: p_parameter_list);
3250: -- Obtain the values for the configurable items
3251: nodename := WF_MAILER_PARAMETER.GetValueForCorr (pNid => nid,
3252: pCorrId => corrId,
4142: else
4143:
4144: -- 4628088 Send the RESET_NLS flag if one is defined
4145: -- at the message level.
4146: corrId := wf_event.getValueForParameter('Q_CORRELATION_ID',
4147: p_parameter_list);
4148: resetNls := WF_MAILER_PARAMETER.GetValueForCorr (pNid => p_event_key,
4149: pCorrId => corrId,
4150: pName => 'RESET_NLS',
4239: end;
4240:
4241: -- Bug 10243065. Check if this is a reassigned notification that does
4242: -- not need to be sent
4243: if wf_event.getValueForParameter('IS_DUPLICATE', p_parameter_list) = 'TRUE' then
4244: GenerateEmptyDoc(nid, 0, p_doc, 'Reassigned, not sent to oringinal recipient', TRUE);
4245: return;
4246: end if;
4247:
4400: end if;
4401:
4402: recipient_role := p_recipient_role;
4403:
4404: corrId := wf_event.getValueForParameter('Q_CORRELATION_ID',
4405: p_parameter_list);
4406: messageIdx := 0;
4407: pos := p_pos;
4408: occurance := 1;
4853: 'BEGIN');
4854: end if;
4855:
4856: if p_parameter_list is not null then
4857: recipient_role := wf_event.getValueForParameter('ROLE_NAME',
4858: p_parameter_list);
4859: end if;
4860:
4861: if recipient_role is null then
4923: p_parameter_list in wf_parameter_list_t)
4924: return clob
4925: is
4926: l_doc CLOB;
4927: l_evt wf_event_t;
4928: l_parameters wf_parameter_list_t;
4929: l_erragt wf_agent_t;
4930:
4931: begin
5340: -- p_event
5341: -- RETURN
5342: -- varchar2 of the status
5343: function SendNotification (p_subscription_guid in raw,
5344: p_event in out NOCOPY WF_EVENT_T) return varchar2
5345: is
5346: l_eventName varchar2(80);
5347: l_eventkey varchar(80);
5348: l_nid number;
5362: wf_core.Context('WF_XML','SendNotification',p_event.getEventName(),
5363: p_subscription_guid);
5364: -- Save error message and set status to INVALID so mailer will
5365: -- bounce an "invalid reply" message to sender.
5366: wf_event.SetErrorInfo(p_event, 'ERROR');
5367: return 'ERROR';
5368: end sendNotification;
5369:
5370:
5370:
5371: -- handleRecevieEvent
5372: --
5373: function handleReceiveEvent(p_subscription_guid in raw,
5374: p_event in out NOCOPY WF_EVENT_T) return varchar2
5375: is
5376: l_eventName varchar2(80);
5377: l_eventkey varchar(80);
5378: l_paramlist wf_parameter_list_t;
5627: wf_core.Context('WF_XML','handleReceiveEvent',p_event.getEventName(),
5628: p_subscription_guid);
5629: -- Save error message and set status to INVALID so mailer will
5630: -- bounce an "invalid reply" message to sender.
5631: wf_event.SetErrorInfo(p_event, 'ERROR');
5632: return 'ERROR';
5633:
5634: end handleReceiveEvent;
5635:
5638: -- Handle the notification receive events
5639: -- This will handle the processing of the inbound responses
5640: -- IN
5641: -- p_subscription_guid - The RAW GUID of the event subscription
5642: -- p_event - The WF_EVENT_T containing the event information
5643: -- RETURN
5644: -- varchar2 of the status
5645: function receive (p_subscription_guid in raw,
5646: p_event in out NOCOPY WF_EVENT_T) return varchar2
5642: -- p_event - The WF_EVENT_T containing the event information
5643: -- RETURN
5644: -- varchar2 of the status
5645: function receive (p_subscription_guid in raw,
5646: p_event in out NOCOPY WF_EVENT_T) return varchar2
5647: is
5648: l_eventName varchar2(80);
5649: result varchar2(30);
5650: erragt wf_agent_t;
5661:
5662: result := handleReceiveEvent(p_subscription_guid, p_event);
5663:
5664: elsif l_eventName = WF_NTF_RECEIVE_ERROR then
5665: errMsg := wf_event.getValueForParameter('ERROR_MESSAGE',
5666: l_paramList);
5667: errStack := wf_event.getValueForParameter('ERROR_STACK',
5668: l_paramList);
5669: p_event.setErrorSubscription(p_subscription_guid);
5663:
5664: elsif l_eventName = WF_NTF_RECEIVE_ERROR then
5665: errMsg := wf_event.getValueForParameter('ERROR_MESSAGE',
5666: l_paramList);
5667: errStack := wf_event.getValueForParameter('ERROR_STACK',
5668: l_paramList);
5669: p_event.setErrorSubscription(p_subscription_guid);
5670: p_event.setErrorMessage(substrb(errMsg,1,4000));
5671: p_event.setErrorStack(substrb(errStack,1,4000));
5671: p_event.setErrorStack(substrb(errStack,1,4000));
5672: p_event.addParameterToList('ERROR_NAME', 'WF_NTF_RECEIVE_ERROR');
5673: p_event.addParameterToList('ERROR_TYPE', 'ERROR');
5674:
5675: erragt := wf_agent_t('WF_ERROR', wf_event.local_system_name);
5676:
5677: --
5678: -- sjm - lets just call the API directly
5679: --
5695: wf_core.Context('WF_XML','Receive',p_event.getEventName(),
5696: p_subscription_guid);
5697: -- Save error message and set status to INVALID so mailer will
5698: -- bounce an "invalid reply" message to sender.
5699: wf_event.SetErrorInfo(p_event, 'ERROR');
5700: return 'ERROR';
5701: end receive;
5702:
5703: -- SummaryRule
5705: -- and call the approapriate summary generate function for
5706: -- either the role or the member of the role.
5707: -- IN
5708: -- p_subscription_guid The RAW GUID for the subscription
5709: -- p_event The WF_EVENT_T containing the event details
5710: -- OUT
5711: -- VARCHAR2 - The status
5712: function SummaryRule (p_subscription_guid in raw,
5713: p_event in out NOCOPY WF_EVENT_T) return varchar2
5709: -- p_event The WF_EVENT_T containing the event details
5710: -- OUT
5711: -- VARCHAR2 - The status
5712: function SummaryRule (p_subscription_guid in raw,
5713: p_event in out NOCOPY WF_EVENT_T) return varchar2
5714: is
5715: l_eventName varchar2(80);
5716: l_eventkey varchar(80);
5717: l_paramlist wf_parameter_list_t;
5764:
5765: for rec_summary_role in c_get_summary_roles loop
5766:
5767: l_event_paramlist := wf_parameter_list_t();
5768: wf_event.addParameterToList('ROLE_NAME',
5769: rec_summary_role.RECIPIENT,
5770: l_event_paramlist);
5771: -- Set AQs correlation id to item type i.e. 'WFMAIL'
5772: wf_event.addParameterToList('Q_CORRELATION_ID', 'WFMAIL:SUM',
5768: wf_event.addParameterToList('ROLE_NAME',
5769: rec_summary_role.RECIPIENT,
5770: l_event_paramlist);
5771: -- Set AQs correlation id to item type i.e. 'WFMAIL'
5772: wf_event.addParameterToList('Q_CORRELATION_ID', 'WFMAIL:SUM',
5773: l_event_paramlist);
5774: wf_event.addParameterToList('NOTIFICATION_ID', '0',
5775: l_event_paramlist);
5776:
5770: l_event_paramlist);
5771: -- Set AQs correlation id to item type i.e. 'WFMAIL'
5772: wf_event.addParameterToList('Q_CORRELATION_ID', 'WFMAIL:SUM',
5773: l_event_paramlist);
5774: wf_event.addParameterToList('NOTIFICATION_ID', '0',
5775: l_event_paramlist);
5776:
5777: wf_event.raise(WF_NTF_SEND_SUMMARY,
5778: rec_summary_role.RECIPIENT||':'||sysdate,
5773: l_event_paramlist);
5774: wf_event.addParameterToList('NOTIFICATION_ID', '0',
5775: l_event_paramlist);
5776:
5777: wf_event.raise(WF_NTF_SEND_SUMMARY,
5778: rec_summary_role.RECIPIENT||':'||sysdate,
5779: null, l_event_paramlist);
5780: -- adds the users to the table l_sum_users
5781: l_sum_users(rec_summary_role.RECIPIENT) := true;
5794: -- Checks that the summary event is already raised for the user in
5795: -- cursor 'c_get_summary_roles'. If not, then only raise the event here
5796: if(not l_sum_users.exists(rec_role_user.user_name)) then
5797: l_event_paramlist := wf_parameter_list_t();
5798: wf_event.addParameterToList('ROLE_NAME',
5799: rec_role_user.user_name,
5800: l_event_paramlist);
5801: -- Set AQs correlation id to item type i.e. 'WFMAIL'
5802: wf_event.addParameterToList('Q_CORRELATION_ID', 'WFMAIL:SUM',
5798: wf_event.addParameterToList('ROLE_NAME',
5799: rec_role_user.user_name,
5800: l_event_paramlist);
5801: -- Set AQs correlation id to item type i.e. 'WFMAIL'
5802: wf_event.addParameterToList('Q_CORRELATION_ID', 'WFMAIL:SUM',
5803: l_event_paramlist);
5804: wf_event.addParameterToList('NOTIFICATION_ID', '0',
5805: l_event_paramlist);
5806: wf_event.raise(WF_NTF_SEND_SUMMARY,
5800: l_event_paramlist);
5801: -- Set AQs correlation id to item type i.e. 'WFMAIL'
5802: wf_event.addParameterToList('Q_CORRELATION_ID', 'WFMAIL:SUM',
5803: l_event_paramlist);
5804: wf_event.addParameterToList('NOTIFICATION_ID', '0',
5805: l_event_paramlist);
5806: wf_event.raise(WF_NTF_SEND_SUMMARY,
5807: rec_role_user.user_name||':'||sysdate,
5808: null, l_event_paramlist);
5802: wf_event.addParameterToList('Q_CORRELATION_ID', 'WFMAIL:SUM',
5803: l_event_paramlist);
5804: wf_event.addParameterToList('NOTIFICATION_ID', '0',
5805: l_event_paramlist);
5806: wf_event.raise(WF_NTF_SEND_SUMMARY,
5807: rec_role_user.user_name||':'||sysdate,
5808: null, l_event_paramlist);
5809: end if;
5810:
5817:
5818: when others then
5819: wf_core.Context('WF_XML','SummaryRule',p_event.getEventName(),
5820: p_subscription_guid);
5821: wf_event.SetErrorInfo(p_event, 'ERROR');
5822: return 'ERROR';
5823: end SummaryRule;
5824:
5825: -- Parse the XML message and seperate out the main elements
5988:
5989: end getMessageDetails;
5990:
5991: FUNCTION error_rule(p_subscription_guid in raw,
5992: p_event in out nocopy wf_event_t) return varchar2
5993: is
5994: nid number;
5995: param_list wf_parameter_list_t;
5996: cb varchar2(240);
6018: l_dummy varchar2(1);
6019:
6020: begin
6021: param_list := p_event.Parameter_List;
6022: nid := to_number(wf_event.getValueForParameter('NOTIFICATION_ID',
6023: param_list));
6024: error_msg := p_event.getErrorMessage;
6025: error_stack := p_event.getErrorStack;
6026: begin
6243: -- p_event Event Message
6244: -- OUT
6245: -- Status as ERROR, SUCCESS, WARNING
6246: function Send_Rule(p_subscription_guid in raw,
6247: p_event in out nocopy wf_event_t)
6248: return varchar2
6249: is
6250: l_eventdata CLOB := p_event.event_data;
6251: l_fulldocloc number;