302: i pls_integer;
303: p1 pls_integer;
304: p2 pls_integer;
305: not_empty boolean := true;
306: role_info_tbl wf_directory.wf_local_roles_tbl_type;
307:
308: l_delim varchar2(1);
309: cells tdType;
310: result varchar2(32000);
369: else
370: l_text := to_char(l_numberv, l_format);
371: end if;
372: elsif (l_type = 'ROLE') then
373: Wf_Directory.GetRoleInfo2(l_textv,role_info_tbl);
374: l_text := role_info_tbl(1).display_name;
375: elsif (l_type = 'LOOKUP') then
376: begin
377: select MEANING
569: l_owner varchar2(320);
570: l_begin_date date;
571: i pls_integer;
572: j pls_integer;
573: role_info_tbl wf_directory.wf_local_roles_tbl_type;
574:
575: l_table_direction varchar2(1);
576: l_delim varchar2(1) := ':';
577: cells tdType;
630: i := 0;
631: for histr in hist0c(l_itype, l_ikey, l_actid) loop
632: cells(j) := to_char(histr.notification_id);
633: j := j+1;
634: wf_directory.GetRoleInfo2(histr.assigned_user, role_info_tbl);
635: if (disptype = wf_notification.doc_html) then
636: cells(j) := 'S:'||Wf_Notification.SubstituteSpecialChars(role_info_tbl(1).display_name);
637: else
638: cells(j) := role_info_tbl(1).display_name;
686:
687: for histr in histc(l_itype, l_ikey, l_actid) loop
688: cells(j) := to_char(histr.notification_id);
689: j := j+1;
690: wf_directory.GetRoleInfo2(histr.assigned_user, role_info_tbl);
691: if (disptype = wf_notification.doc_html) then
692: cells(j) := 'S:'||Wf_Notification.SubstituteSpecialChars(role_info_tbl(1).display_name);
693: else
694: cells(j) := role_info_tbl(1).display_name;
752: exception
753: when OTHERS then
754: raise;
755: end;
756: wf_directory.GetRoleInfo2(l_owner_role, role_info_tbl);
757: if (disptype = wf_notification.doc_html) then
758: cells(j) := 'S:'||Wf_Notification.SubstituteSpecialChars(role_info_tbl(1).display_name);
759: else
760: cells(j) := role_info_tbl(1).display_name;
954: found := false;
955: user_name := l_email;
956: disp_name := l_email;
957:
958: Wf_Directory.GetInfoFromMail(mailid => l_email,
959: role => l_role,
960: display_name => l_dname,
961: description => l_desc,
962: notification_preference => l_npref,
1106: is
1107: atype varchar2(8);
1108: format varchar2(240);
1109: rname varchar2(320);
1110: role_info_tbl wf_directory.wf_local_roles_tbl_type;
1111: l_parameterlist wf_parameter_list_t := wf_parameter_list_t();
1112: l_language varchar2(30);
1113: l_recipient_role varchar2(320);
1114:
1174: if (avalue is null) then
1175: -- Null values are ok
1176: rname := '';
1177: else
1178: Wf_Directory.GetRoleInfo2(avalue, role_info_tbl);
1179: rname := role_info_tbl(1).name;
1180:
1181: -- If not internal name, check for display_name
1182: if (rname is null) then
1233: into l_recipient_role
1234: from WF_NOTIFICATIONS WN
1235: where WN.NOTIFICATION_ID = nid ;
1236:
1237: Wf_Directory.GetRoleInfo2(l_recipient_role, role_info_tbl);
1238: l_language := role_info_tbl(1).language;
1239:
1240: select code into l_language from wf_languages where nls_language = l_language;
1241:
1585: end if;
1586: elsif (not_attr_row.type = 'ROLE') then
1587: -- ROLE type, get display_name of role
1588: begin
1589: -- NOTE: cannot use wf_directory.getroleinfo2 because of the
1590: -- pragma WNPS.
1591: -- Decode into orig_system if necessary for indexes
1592: colon := instr(not_attr_row.text_value, ':');
1593: if (colon = 0) then
1801: and WMA.NAME = WNA.NAME
1802: -- order by length(WNA.NAME) desc;
1803: order by decode(wma.type,'URL',length(WNA.NAME),length(WNA.NAME)+1000) desc;
1804:
1805: role_info_tbl wf_directory.wf_local_roles_tbl_type;
1806:
1807: error_name varchar2(30);
1808: error_stack varchar2(32000);
1809: l_dummy boolean;
1988: value := GetAttrDoc(nid, not_attr_row.name, disptype);
1989: end if;
1990: elsif (not_attr_row.type = 'ROLE') then
1991: -- ROLE type, get display_name of role
1992: Wf_Directory.GetRoleInfo2(not_attr_row.text_value,role_info_tbl);
1993: -- Use code directly if role not found.
1994: value := nvl(role_info_tbl(1).display_name,not_attr_row.text_value);
1995:
1996: -- Retrieve role information
3025:
3026: begin
3027:
3028: -- ROLE type, get display_name of role
3029: wf_directory.getroleinfo (GetMailPreference.role, l_dname,
3030: l_email, mailpref,
3031: l_language, l_territory);
3032:
3033: --
3180: end;
3181: -- Bug 7358225: If the recipient role of the routing rule is inactive then update the user_comment
3182: -- for the notification and return without executing the routing rule
3183: if LENGTH(rulerec.action_argument) > 0 then
3184: if Not Wf_Directory.UserActive(rulerec.action_argument) then
3185: raise inactive_role;
3186: end if;
3187: end if;
3188: newcomment := rulerec.rule_comment;
3265: Wf_Core.Clear;
3266: if (newcomment is not null) then
3267: newcomment := newcomment||wf_core.newline;
3268: end if;
3269: Wf_Core.Token('TO_ROLE', WF_Directory.GetRoleDisplayName(recip));
3270: newcomment := substrb(newcomment||
3271: Wf_Core.Translate('AUTOROUTE_FAIL')||
3272: wf_core.newline||errmsg,
3273: 1, 4000);
3599: l_itemtype varchar2(8);
3600: col1 pls_integer;
3601: col2 pls_integer;
3602: l_language varchar2(30);
3603: role_info_tbl wf_directory.wf_local_roles_tbl_type;
3604:
3605: cursor message_attrs_cursor(msg_type varchar2, msg_name varchar2) is
3606: select NAME, TYPE, SUBTYPE, VALUE_TYPE,
3607: TEXT_DEFAULT, NUMBER_DEFAULT, DATE_DEFAULT
3859:
3860: wf_event.addParameterToList('Q_CORRELATION_ID', sendsingle.msg_type||':'||
3861: sendsingle.msg_name, l_parameterlist);
3862:
3863: Wf_Directory.GetRoleInfo2(sendsingle.role, role_info_tbl);
3864: l_language := role_info_tbl(1).language;
3865:
3866: select code into l_language from wf_languages where nls_language = l_language;
3867:
3961: wf_core.token('NAME', msg_name);
3962: wf_core.raise('WFNTF_MESSAGE');
3963: end;
3964:
3965: Wf_Directory.GetRoleOrigSysInfo(role,rorig_system,rorig_system_id);
3966:
3967: -- if ORIG_SYSTEM is null, there is no data found for this role
3968: if (rorig_system is null) then
3969: wf_core.token('ROLE', role);
4000: AND wc.action_type = 'RESPOND';
4001:
4002: UPDATE wf_comments
4003: SET to_role = role,
4004: to_user = nvl(Wf_Directory.GetRoleDisplayname(role), role)
4005: WHERE notification_id = prev_nid
4006: AND to_role = 'WF_SYSTEM'
4007: AND action_type = 'RESPOND';
4008: end if;
4082:
4083: -- Get the orig system ids for the role.
4084: -- Do this instead of using role_name directly so that indexes on
4085: -- the original tables are used when selecting through the view.
4086: Wf_Directory.GetRoleOrigSysInfo(role,rorig_system,rorig_system_id);
4087:
4088: -- if ORIG_SYSTEM is null, there is no data found for this role
4089: if (rorig_system is null) then
4090: wf_core.token('ROLE', role);
4094: -- Loop through users of role, sending notification to each one.
4095: gid := '';
4096: for user in role_users_curs loop
4097: -- Send Notification to only active users - Bug 7413050
4098: if Wf_Directory.UserActive(user.user_name) then
4099: -- Call SendSingle to complete notification,
4100: nid := SendSingle(user.user_name, msg_type, msg_name, due_date, callback,
4101: context, send_comment, priority, gid);
4102:
4173: l_dummy varchar2(1);
4174:
4175: l_language varchar2(30);
4176: l_recipient_role varchar2(320);
4177: role_info_tbl wf_directory.wf_local_roles_tbl_type;
4178:
4179: -- Bug 3827935
4180: l_charcheck boolean;
4181:
4401: into l_recipient_role
4402: from WF_NOTIFICATIONS WN
4403: where WN.NOTIFICATION_ID = nid;
4404:
4405: Wf_Directory.GetRoleInfo2(l_recipient_role, role_info_tbl);
4406: l_language := role_info_tbl(1).language;
4407:
4408: select code into l_language from wf_languages where nls_language = l_language;
4409:
6248: l_from_user varchar2(360);
6249: l_to_user varchar2(360);
6250: l_subject varchar2(2000);
6251: l_language varchar2(64);
6252: role_info_tbl wf_directory.wf_local_roles_tbl_type;
6253: l_territory varchar2(64);
6254: l_nls_date_format varchar2(64);
6255: l_nls_date_language varchar2(64);
6256: l_nls_calendar varchar2(64);
6269: l_orig_nlsCalendar varchar2(64);
6270: l_logSTMT boolean;
6271: l_logPRCD boolean;
6272: l_sessionUser varchar2(320);
6273: l_sessionUserInfo wf_directory.wf_local_roles_tbl_type;
6274: l_canDefer boolean;
6275: l_module varchar2(100):=g_plsqlName|| 'Denormalize_Notification()';
6276:
6277: begin
6299: , 'l_sessionUser=>'||l_sessionUser||'<');
6300: end if;
6301:
6302: if (l_sessionUser is not null) then
6303: Wf_Directory.GetRoleInfo2(l_sessionUser, l_sessionUserInfo);
6304: l_orig_nlsCalendar := l_sessionUserInfo(1).nls_calendar;
6305: if ( l_logSTMT ) then
6306: wf_log_pkg.String(wf_log_pkg.LEVEL_STATEMENT, l_module
6307: , 'l_sessionUser calendar=>'||l_orig_nlsCalendar||'<');
6315: -- if username is supplied, use the language setting of such user
6316: -- default to Recipient's setting if no valid language is found.
6317: begin
6318: if (username is not null) then
6319: Wf_Directory.GetRoleInfo2(username, role_info_tbl);
6320: l_language := role_info_tbl(1).language;
6321:
6322: -- <7514495> full NLS support
6323: l_territory := role_info_tbl(1).territory;
6376: wf_log_pkg.String(wf_log_pkg.LEVEL_STATEMENT, l_module
6377: , 'Getting '||l_user||'''s (recipient) preferences');
6378: end if;
6379:
6380: Wf_Directory.GetRoleInfo2(l_user, role_info_tbl);
6381: -- in most cases, l_language should be null and we use the language setting
6382: -- of the recipient role.
6383: if (l_language is null) then
6384: l_language := role_info_tbl(1).language;
6482: end if;
6483:
6484: -- We need to make l_from_user consistant with l_from_role.
6485: if (l_from_role is not NULL) then
6486: l_from_user := Wf_Directory.GetRoleDisplayName(l_from_role);
6487: l_from_user := substrb(l_from_user, 1,320);
6488: end if;
6489:
6490:
6726: l_newRole varchar2(2000);
6727: l_sysComment varchar2(320);
6728:
6729: l_language varchar2(30);
6730: role_info_tbl wf_directory.wf_local_roles_tbl_type;
6731:
6732: -- bug 7130745
6733: l_event_name varchar2(240);
6734:
6760: g_context_proxy := null;
6761: g_context_user := myusername;
6762: end if;
6763:
6764: mydispname := Wf_Directory.GetRoleDisplayName(myusername);
6765: g_context_user_comment := updateinfo.comment;
6766:
6767: --Bug 3065814
6768: --Get the callback function
6812: wf_core.token('USER',l_recip_role);
6813: wf_core.raise('WFNTF_INVALID_MOREINFO_REQUEST');
6814: else
6815: -- Routing rule defined
6816: wf_core.token('ROLE', WF_Directory.GetRoleDisplayName(l_newRole));
6817: l_sysComment := wf_core.translate('WFNTF_AUTO_RESPONSE_TO_ROLE');
6818:
6819: if myusername is not null then
6820: wf_notification.SetComments(nid, username, myusername, 'ANSWER', action_source, l_sysComment);
6960: -- already been answered. In both cases, MORE_INFO_ROLE is set to null.
6961: -- Also acquire a row lock, so that we do not let multiple people to
6962: -- answer at the same time.
6963: begin
6964: select MORE_INFO_ROLE,Wf_Directory.GetRoleDisplayName(MORE_INFO_ROLE), RECIPIENT_ROLE,FROM_ROLE
6965: into l_from_role, replyby, recipient_role,l_question_role
6966: from WF_NOTIFICATIONS
6967: where NOTIFICATION_ID = nid
6968: and MORE_INFO_ROLE is not null
6981: -- ### try again in a brief moment.
6982: end;
6983:
6984: if (myusername is not null and l_from_role <> myusername) then
6985: if (not Wf_Directory.IsPerformer(myusername, l_from_role)) then
6986: wf_core.token('ROLE',myusername);
6987: wf_core.raise('WFNTF_NOT_PARTICIPANTS');
6988: end if;
6989: l_from_role := myusername;
7071: wf_event.addParameterToList('Q_CORRELATION_ID', l_messageType||':'||
7072: l_messageName, l_parameterlist);
7073:
7074:
7075: Wf_Directory.GetRoleInfo2(l_recip_role, role_info_tbl);
7076: l_language := role_info_tbl(1).language;
7077:
7078: select code into l_language from wf_languages where nls_language = l_language;
7079:
7240: l_messageType varchar2(8);
7241: l_messageName varchar2(30);
7242: l_groupId number;
7243: l_parameterlist wf_parameter_list_t := wf_parameter_list_t();
7244: role_info_tbl wf_directory.wf_local_roles_tbl_type;
7245: l_username varchar2(320);
7246: l_stat varchar2(8);
7247:
7248: --Bug 3065814
7320: -- question mode
7321: if (username is not null) then
7322:
7323: -- Check if the question is asked to a valid role
7324: -- i. The role should be valid within WF Directory Service.
7325: -- ii. We might also want to check if the user is a participant of the ntf??
7326:
7327: wf_directory.GetRoleInfo2(username, role_info_tbl);
7328: l_username := role_info_tbl(1).name;
7323: -- Check if the question is asked to a valid role
7324: -- i. The role should be valid within WF Directory Service.
7325: -- ii. We might also want to check if the user is a participant of the ntf??
7326:
7327: wf_directory.GetRoleInfo2(username, role_info_tbl);
7328: l_username := role_info_tbl(1).name;
7329:
7330: -- Check if it is a Display Name
7331: if (l_username is NULL) then
7449: -- already been answered. In both cases, MORE_INFO_ROLE is set to null.
7450: -- Also acquire a row lock, so that we do not let multiple people to
7451: -- answer at the same time.
7452: begin
7453: select MORE_INFO_ROLE, Wf_Directory.GetRoleDisplayName(MORE_INFO_ROLE),
7454: MESSAGE_TYPE, MESSAGE_NAME, GROUP_ID , from_role
7455: into l_from_role, replyby, l_messageType, l_messageName, l_groupId, l_question_role
7456: from WF_NOTIFICATIONS
7457: where NOTIFICATION_ID = nid
7550: wf_event.AddParameterToList('GROUP_ID', nvl(l_groupId, nid), l_parameterlist);
7551: wf_event.addParameterToList('Q_CORRELATION_ID', l_messageType||':'||
7552: l_messageName, l_parameterlist);
7553:
7554: Wf_Directory.GetRoleInfo2(l_recip_role, role_info_tbl);
7555: l_language := role_info_tbl(1).language;
7556:
7557: select code into l_language from wf_languages where nls_language = l_language;
7558:
7618: l_question_role varchar2(320);
7619: l_dummy varchar2(1);
7620: l_orig_recip_role varchar2(320);
7621: l_language varchar2(30);
7622: role_info_tbl wf_directory.wf_local_roles_tbl_type;
7623:
7624: begin
7625: wf_log_pkg.string(WF_LOG_PKG.LEVEL_UNEXPECTED, 'WF_NOTIFICATION.UpdateInfoGuest',
7626: 'NID: '||to_char(nid));
7630: -- Also acquire a row lock, so that we do not let multiple people to
7631: -- answer at the same time.
7632: begin
7633: select ORIGINAL_RECIPIENT, RECIPIENT_ROLE, MORE_INFO_ROLE,
7634: Wf_Directory.GetRoleDisplayName(MORE_INFO_ROLE),
7635: MESSAGE_TYPE, MESSAGE_NAME, GROUP_ID , from_role, callback, context
7636: into l_orig_recip_role, l_recipient_role, l_from_role,
7637: replyby, l_messageType, l_messageName, l_groupId, l_question_role, cb, context
7638: from WF_NOTIFICATIONS
7709: wf_event.AddParameterToList('GROUP_ID', nvl(l_groupId, nid), l_parameterlist);
7710: wf_event.addParameterToList('Q_CORRELATION_ID', l_messageType||':'||
7711: l_messageName, l_parameterlist);
7712:
7713: Wf_Directory.GetRoleInfo2(l_recipient_role, role_info_tbl);
7714: l_language := role_info_tbl(1).language;
7715:
7716: select code into l_language from wf_languages where nls_language = l_language;
7717:
7883: (select
7884: 99999999 H_SEQUENCE,
7885: IAS.NOTIFICATION_ID H_NOTIFICATION_ID,
7886: IAS.ASSIGNED_USER H_FROM_ROLE,
7887: wf_directory.getRoleDisplayName(IAS.ASSIGNED_USER) H_FROM_USER,
7888: 'WF_SYSTEM' H_TO_ROLE,
7889: l_wf_system H_TO_USER,
7890: A.RESULT_TYPE H_ACTION_TYPE,
7891: IAS.ACTIVITY_RESULT_CODE H_ACTION,
7911: select
7912: 99999999 H_SEQUENCE,
7913: IAS.NOTIFICATION_ID H_NOTIFICATION_ID,
7914: IAS.ASSIGNED_USER H_FROM_ROLE,
7915: wf_directory.getRoleDisplayName(IAS.ASSIGNED_USER) H_FROM_USER,
7916: 'WF_SYSTEM' H_TO_ROLE,
7917: l_wf_system H_TO_USER,
7918: A.RESULT_TYPE H_ACTION_TYPE,
7919: IAS.ACTIVITY_RESULT_CODE H_ACTION,
9135: -- Sometimes p_from_role is email address when answering for more info request
9136: if (l_from_role = 'WF_SYSTEM') then
9137: l_from_user := Wf_Core.Translate(l_from_role);
9138: else
9139: l_from_user := nvl(Wf_Directory.GetRoleDisplayName(l_from_role), l_from_role);
9140: end if;
9141: if (p_to_role = 'WF_SYSTEM') then
9142: l_to_user := Wf_Core.Translate(p_to_role);
9143: else
9140: end if;
9141: if (p_to_role = 'WF_SYSTEM') then
9142: l_to_user := Wf_Core.Translate(p_to_role);
9143: else
9144: l_to_user := nvl(Wf_Directory.GetRoleDisplayname(p_to_role), p_to_role);
9145: end if;
9146: l_action := p_action;
9147:
9148: if (l_action in ('DELEGATE','TRANSFER')) then
9228: l_territory varchar2(30);
9229: l_orig_system varchar2(30);
9230: l_orig_system_id number;
9231: l_installed varchar2(1);
9232: role_info_tbl wf_directory.wf_local_roles_tbl_type;
9233:
9234: begin
9235:
9236: begin
9245: end;
9246:
9247: -- Get recipient information using Dir Service API. Select from WF_ROLES
9248: -- may not give the right information
9249: Wf_Directory.GetRoleInfoMail(l_recipient_role, l_display_name, l_email_address,
9250: l_notification_pref, l_language, l_territory,
9251: l_orig_system, l_orig_system_id, l_installed);
9252:
9253: -- Check if the notification is eligible to be e-mailed. We throw specific error
9278: Wf_Event.AddParameterToList('GROUP_ID', l_group_id, l_paramlist);
9279: Wf_Event.AddParameterToList('Q_CORRELATION_ID', l_message_type||':'||
9280: l_message_name, l_paramlist);
9281:
9282: Wf_Directory.GetRoleInfo2(l_recipient_role, role_info_tbl);
9283: l_language := role_info_tbl(1).language;
9284:
9285: select code into l_language from wf_languages where nls_language = l_language;
9286: