2930: begin
2931: --
2932: IF ( funcmode = 'RUN' ) then
2933: --
2934: l_action := wf_engine.GetItemAttrText(itemtype => itemtype,
2935: itemkey => itemkey,
2936: aname => 'WPM_PLAN_ACTION');
2937: --
2938: IF (l_action IN ('PUBLISH', 'REVERSE_PUBLISH')) THEN
2971: begin
2972: --
2973: IF ( funcmode = 'RUN' ) then
2974: --
2975: l_method := wf_engine.GetItemAttrText(itemtype => itemtype,
2976: itemkey => itemkey,
2977: aname => 'WPM_PLAN_METHOD');
2978: --
2979: IF (l_method IN ('CAS', 'PAR')) THEN
3043: l_plan_action := 'REVERSE_PUBLISH';
3044: END IF;
3045:
3046: -- WF Process
3047: wf_engine.CreateProcess (itemtype => p_item_type,
3048: itemkey => l_item_key,
3049: process => p_wf_process );
3050:
3051: -- Item User Key
3048: itemkey => l_item_key,
3049: process => p_wf_process );
3050:
3051: -- Item User Key
3052: wf_engine.SetItemUserKey (itemtype => p_item_type,
3053: itemkey => l_item_key,
3054: userkey => l_item_user_key);
3055:
3056: -- Effective Date
3053: itemkey => l_item_key,
3054: userkey => l_item_user_key);
3055:
3056: -- Effective Date
3057: wf_engine.SetItemAttrText (itemtype => p_item_type,
3058: itemkey => l_item_key,
3059: aname => 'EFFECTIVE_DATE',
3060: avalue => p_effective_date);
3061: -- Plan Id
3058: itemkey => l_item_key,
3059: aname => 'EFFECTIVE_DATE',
3060: avalue => p_effective_date);
3061: -- Plan Id
3062: wf_engine.SetItemAttrText (itemtype => p_item_type,
3063: itemkey => l_item_key,
3064: aname => 'WPM_PLAN_ID',
3065: avalue => p_plan_rec.plan_id);
3066:
3064: aname => 'WPM_PLAN_ID',
3065: avalue => p_plan_rec.plan_id);
3066:
3067: -- Plan Name
3068: wf_engine.SetItemAttrText (itemtype => p_item_type,
3069: itemkey => l_item_key,
3070: aname => 'WPM_PLAN',
3071: avalue => p_plan_rec.plan_name);
3072:
3070: aname => 'WPM_PLAN',
3071: avalue => p_plan_rec.plan_name);
3072:
3073: -- Plan Action
3074: wf_engine.SetItemAttrText (itemtype => p_item_type,
3075: itemkey => l_item_key,
3076: aname => 'WPM_PLAN_ACTION',
3077: avalue => l_plan_action);
3078: -- Plan Method
3075: itemkey => l_item_key,
3076: aname => 'WPM_PLAN_ACTION',
3077: avalue => l_plan_action);
3078: -- Plan Method
3079: wf_engine.SetItemAttrText (itemtype => p_item_type,
3080: itemkey => l_item_key,
3081: aname => 'WPM_PLAN_METHOD',
3082: avalue => p_plan_rec.method_code);
3083:
3081: aname => 'WPM_PLAN_METHOD',
3082: avalue => p_plan_rec.method_code);
3083:
3084: -- Plan Hierarchy
3085: wf_engine.SetItemAttrText (itemtype => p_item_type,
3086: itemkey => l_item_key,
3087: aname => 'WPM_PLAN_HIERARCHY',
3088: avalue => p_plan_rec.hierarchy_type_code);
3089:
3087: aname => 'WPM_PLAN_HIERARCHY',
3088: avalue => p_plan_rec.hierarchy_type_code);
3089:
3090: -- Plan Supervisor Id
3091: wf_engine.SetItemAttrText (itemtype => p_item_type,
3092: itemkey => l_item_key,
3093: aname => 'WPM_PLAN_SUPERVISOR_ID',
3094: avalue => p_plan_rec.supervisor_id);
3095:
3093: aname => 'WPM_PLAN_SUPERVISOR_ID',
3094: avalue => p_plan_rec.supervisor_id);
3095:
3096: -- Plan Supervisor Assignment Id
3097: wf_engine.SetItemAttrText (itemtype => p_item_type,
3098: itemkey => l_item_key,
3099: aname => 'WPM_PLAN_SUPERVISOR_ASG_ID',
3100: avalue => p_plan_rec.supervisor_assignment_id);
3101:
3099: aname => 'WPM_PLAN_SUPERVISOR_ASG_ID',
3100: avalue => p_plan_rec.supervisor_assignment_id);
3101:
3102: -- Plan Top Organization Id
3103: wf_engine.SetItemAttrText (itemtype => p_item_type,
3104: itemkey => l_item_key,
3105: aname => 'WPM_PLAN_TOP_ORG_ID',
3106: avalue => p_plan_rec.top_organization_id);
3107:
3105: aname => 'WPM_PLAN_TOP_ORG_ID',
3106: avalue => p_plan_rec.top_organization_id);
3107:
3108: -- Plan Top Position Id
3109: wf_engine.SetItemAttrText (itemtype => p_item_type,
3110: itemkey => l_item_key,
3111: aname => 'WPM_PLAN_TOP_POS_ID',
3112: avalue => p_plan_rec.top_position_id);
3113:
3111: aname => 'WPM_PLAN_TOP_POS_ID',
3112: avalue => p_plan_rec.top_position_id);
3113:
3114: -- Objective Setting Start Date
3115: wf_engine.SetItemAttrText (itemtype => p_item_type,
3116: itemkey => l_item_key,
3117: aname => 'OBJ_SET_START',
3118: avalue => p_plan_rec.obj_setting_start_date);
3119:
3117: aname => 'OBJ_SET_START',
3118: avalue => p_plan_rec.obj_setting_start_date);
3119:
3120: -- Objective Setting End Date
3121: wf_engine.SetItemAttrText (itemtype => p_item_type,
3122: itemkey => l_item_key,
3123: aname => 'OBJ_SET_FINISH',
3124: avalue => p_plan_rec.obj_setting_deadline);
3125: -- start changes for Bug#5903006
3122: itemkey => l_item_key,
3123: aname => 'OBJ_SET_FINISH',
3124: avalue => p_plan_rec.obj_setting_deadline);
3125: -- start changes for Bug#5903006
3126: wf_engine.SetItemAttrText (itemtype => p_item_type,
3127: itemkey => l_item_key,
3128: aname => 'HR_WPM_OBJ_SETTING_FLAG',
3129: avalue => p_plan_rec.include_obj_setting_flag);
3130: -- End Changes for bug#5903006
3141: ,p_display_name => l_admin_role_displayname);
3142: --
3143: -- Plan Administrator
3144: --
3145: wf_engine.SetItemAttrText (itemtype => p_item_type,
3146: itemkey => l_item_key,
3147: aname => 'HR_WPM_PLAN_ADMINISTRATOR',
3148: avalue => l_admin_role_name);
3149: --
3156: ,p_orig_system_id => fnd_global.user_id
3157: ,p_name => l_role_name
3158: ,p_display_name => l_role_displayname);
3159: --
3160: wf_engine.SetItemOwner (itemtype => p_item_type,
3161: itemkey => l_item_key,
3162: owner => l_role_name);
3163: --
3164: wf_engine.StartProcess (itemtype => p_item_type,
3160: wf_engine.SetItemOwner (itemtype => p_item_type,
3161: itemkey => l_item_key,
3162: owner => l_role_name);
3163: --
3164: wf_engine.StartProcess (itemtype => p_item_type,
3165: itemkey => l_item_key);
3166: --
3167: --
3168: IF g_dbg THEN op('Leaving:'||l_proc, g_REGULAR_LOG, 80); END IF;
3206: --
3207: IF (funcmode = 'RUN') then
3208:
3209: -- Get the workwlow attribute values
3210: l_plan_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3211: itemkey => itemkey,
3212: aname => 'WPM_PLAN_ID');
3213: l_effective_date := wf_engine.GetItemAttrText(itemtype => itemtype,
3214: itemkey => itemkey,
3209: -- Get the workwlow attribute values
3210: l_plan_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3211: itemkey => itemkey,
3212: aname => 'WPM_PLAN_ID');
3213: l_effective_date := wf_engine.GetItemAttrText(itemtype => itemtype,
3214: itemkey => itemkey,
3215: aname => 'EFFECTIVE_DATE');
3216: --
3217: -- Get plan record
3263: --
3264: IF (funcmode = 'RUN') then
3265:
3266: -- Get the workwlow attribute values
3267: l_plan_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3268: itemkey => itemkey,
3269: aname => 'WPM_PLAN_ID');
3270: -- If plan population is known
3271: IF (g_plan_pop_known_t(l_plan_id)) THEN
3286: ,p_name => l_role_name
3287: ,p_display_name => l_role_displayname);
3288: --
3289: IF (l_role_name IS NOT NULL) THEN
3290: WF_ENGINE.setItemAttrText(itemtype, itemkey,'WPM_PLAN_MEMBER', l_role_name);
3291: resultout := 'COMPLETE:' || 'Y';
3292: return;
3293: END IF;
3294: --
3339: --
3340: IF (funcmode = 'RUN') then
3341:
3342: -- Get the workwlow attribute values
3343: l_plan_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3344: itemkey => itemkey,
3345: aname => 'WPM_PLAN_ID');
3346: --
3347: l_plan_hierarchy := wf_engine.GetItemAttrText(itemtype => itemtype,
3343: l_plan_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3344: itemkey => itemkey,
3345: aname => 'WPM_PLAN_ID');
3346: --
3347: l_plan_hierarchy := wf_engine.GetItemAttrText(itemtype => itemtype,
3348: itemkey => itemkey,
3349: aname => 'WPM_PLAN_HIERARCHY');
3350: IF (l_plan_hierarchy = 'SUP') THEN
3351: --
3348: itemkey => itemkey,
3349: aname => 'WPM_PLAN_HIERARCHY');
3350: IF (l_plan_hierarchy = 'SUP') THEN
3351: --
3352: l_top_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3353: itemkey => itemkey,
3354: aname => 'WPM_PLAN_SUPERVISOR_ID');
3355: ELSIF (l_plan_hierarchy = 'SUP_ASG') THEN
3356: --
3353: itemkey => itemkey,
3354: aname => 'WPM_PLAN_SUPERVISOR_ID');
3355: ELSIF (l_plan_hierarchy = 'SUP_ASG') THEN
3356: --
3357: l_top_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3358: itemkey => itemkey,
3359: aname => 'WPM_PLAN_SUPERVISOR_ASG_ID');
3360: ELSIF (l_plan_hierarchy = 'ORG') THEN
3361: --
3358: itemkey => itemkey,
3359: aname => 'WPM_PLAN_SUPERVISOR_ASG_ID');
3360: ELSIF (l_plan_hierarchy = 'ORG') THEN
3361: --
3362: l_top_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3363: itemkey => itemkey,
3364: aname => 'WPM_PLAN_TOP_ORG_ID');
3365: ELSIF (l_plan_hierarchy = 'POS') THEN
3366: --
3363: itemkey => itemkey,
3364: aname => 'WPM_PLAN_TOP_ORG_ID');
3365: ELSIF (l_plan_hierarchy = 'POS') THEN
3366: --
3367: l_top_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3368: itemkey => itemkey,
3369: aname => 'WPM_PLAN_TOP_POS_ID');
3370: END IF;
3371:
3398: ,p_name => l_role_name
3399: ,p_display_name => l_role_displayname);
3400: --
3401: IF (l_role_name IS NOT NULL) THEN
3402: WF_ENGINE.setItemAttrText(itemtype, itemkey,'WPM_PLAN_MEMBER', l_role_name);
3403: resultout := 'COMPLETE:' || 'Y';
3404: return;
3405: END IF;
3406: --
3454: --
3455: IF (funcmode = 'RUN') then
3456:
3457: -- Get the workwlow attribute values
3458: l_plan_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3459: itemkey => itemkey,
3460: aname => 'WPM_PLAN_ID');
3461: --
3462: l_plan_hierarchy := wf_engine.GetItemAttrText(itemtype => itemtype,
3458: l_plan_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3459: itemkey => itemkey,
3460: aname => 'WPM_PLAN_ID');
3461: --
3462: l_plan_hierarchy := wf_engine.GetItemAttrText(itemtype => itemtype,
3463: itemkey => itemkey,
3464: aname => 'WPM_PLAN_HIERARCHY');
3465: IF (l_plan_hierarchy = 'SUP') THEN
3466: --
3463: itemkey => itemkey,
3464: aname => 'WPM_PLAN_HIERARCHY');
3465: IF (l_plan_hierarchy = 'SUP') THEN
3466: --
3467: l_top_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3468: itemkey => itemkey,
3469: aname => 'WPM_PLAN_SUPERVISOR_ID');
3470: ELSIF (l_plan_hierarchy = 'SUP_ASG') THEN
3471: --
3468: itemkey => itemkey,
3469: aname => 'WPM_PLAN_SUPERVISOR_ID');
3470: ELSIF (l_plan_hierarchy = 'SUP_ASG') THEN
3471: --
3472: l_top_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3473: itemkey => itemkey,
3474: aname => 'WPM_PLAN_SUPERVISOR_ASG_ID');
3475: ELSIF (l_plan_hierarchy = 'ORG') THEN
3476: --
3473: itemkey => itemkey,
3474: aname => 'WPM_PLAN_SUPERVISOR_ASG_ID');
3475: ELSIF (l_plan_hierarchy = 'ORG') THEN
3476: --
3477: l_top_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3478: itemkey => itemkey,
3479: aname => 'WPM_PLAN_TOP_ORG_ID');
3480: ELSIF (l_plan_hierarchy = 'POS') THEN
3481: --
3478: itemkey => itemkey,
3479: aname => 'WPM_PLAN_TOP_ORG_ID');
3480: ELSIF (l_plan_hierarchy = 'POS') THEN
3481: --
3482: l_top_id := wf_engine.GetItemAttrText(itemtype => itemtype,
3483: itemkey => itemkey,
3484: aname => 'WPM_PLAN_TOP_POS_ID');
3485: END IF;
3486:
3513: ,p_name => l_role_name
3514: ,p_display_name => l_role_displayname);
3515: --
3516: IF (l_role_name IS NOT NULL) THEN
3517: WF_ENGINE.setItemAttrText(itemtype, itemkey,'WPM_PLAN_MEMBER', l_role_name);
3518: resultout := 'COMPLETE:' || 'Y';
3519: return;
3520: END IF;
3521: --
4591: l_obj_setting_flag VARCHAR2(30);
4592: --end changes for bug#5903006
4593: --
4594: begin
4595: if (funcmode <> wf_engine.eng_run) then
4596: resultout := wf_engine.eng_null;
4597: return;
4598: end if;
4599: l_role_name :=wf_engine.GetItemAttrText(
4592: --end changes for bug#5903006
4593: --
4594: begin
4595: if (funcmode <> wf_engine.eng_run) then
4596: resultout := wf_engine.eng_null;
4597: return;
4598: end if;
4599: l_role_name :=wf_engine.GetItemAttrText(
4600: itemtype => itemtype,
4595: if (funcmode <> wf_engine.eng_run) then
4596: resultout := wf_engine.eng_null;
4597: return;
4598: end if;
4599: l_role_name :=wf_engine.GetItemAttrText(
4600: itemtype => itemtype,
4601: itemkey => itemkey,
4602: aname => 'WPM_PLAN_MEMBER');
4603: l_msg := upper(Wf_Engine.GetActivityAttrText(itemtype, itemkey,
4599: l_role_name :=wf_engine.GetItemAttrText(
4600: itemtype => itemtype,
4601: itemkey => itemkey,
4602: aname => 'WPM_PLAN_MEMBER');
4603: l_msg := upper(Wf_Engine.GetActivityAttrText(itemtype, itemkey,
4604: actid, 'MESSAGE_NAME'));
4605: -- Start Changes for bug#5903006
4606: l_obj_setting_flag := wf_engine.GetItemAttrText(
4607: itemtype => itemtype,
4602: aname => 'WPM_PLAN_MEMBER');
4603: l_msg := upper(Wf_Engine.GetActivityAttrText(itemtype, itemkey,
4604: actid, 'MESSAGE_NAME'));
4605: -- Start Changes for bug#5903006
4606: l_obj_setting_flag := wf_engine.GetItemAttrText(
4607: itemtype => itemtype,
4608: itemkey => itemkey,
4609: aname => 'HR_WPM_OBJ_SETTING_FLAG');
4610: IF NVL(l_obj_setting_flag,'N') = 'N' THEN
4623: Wf_Core.Token('ACTID', to_char(actid));
4624: Wf_Core.Raise('WFENG_NOTIFICATION_PERFORMER');
4625: end if;
4626: --
4627: Wf_Engine_Util.Notification_Send(itemtype, itemkey, actid,
4628: l_msg, 'HRWPM', l_role_name, expand_role,
4629: resultout);
4630:
4631: exception when others then
4660: l_admin_person_id number;
4661: l_supervisor_id number;
4662: --
4663: begin
4664: if (funcmode <> wf_engine.eng_run) then
4665: resultout := wf_engine.eng_null;
4666: return;
4667: end if;
4668: --
4661: l_supervisor_id number;
4662: --
4663: begin
4664: if (funcmode <> wf_engine.eng_run) then
4665: resultout := wf_engine.eng_null;
4666: return;
4667: end if;
4668: --
4669: -- get plan id
4667: end if;
4668: --
4669: -- get plan id
4670: --
4671: l_plan_id :=wf_engine.GetItemAttrNumber(
4672: itemtype => itemtype,
4673: itemkey => itemkey,
4674: aname => 'WPM_PLAN_ID');
4675: --
4687: ,p_orig_system_id => l_admin_person_id
4688: ,p_name => l_role_name
4689: ,p_display_name => l_role_displayname);
4690: /*
4691: l_role_name :=wf_engine.GetItemAttrText(
4692: itemtype => itemtype,
4693: itemkey => itemkey,
4694: aname => 'WPM_PLAN_MEMBER');
4695: */
4692: itemtype => itemtype,
4693: itemkey => itemkey,
4694: aname => 'WPM_PLAN_MEMBER');
4695: */
4696: l_msg := upper(Wf_Engine.GetActivityAttrText(itemtype, itemkey,
4697: actid, 'MESSAGE_NAME'));
4698:
4699: expand_role := 'N';
4700: if l_role_name is null then
4702: Wf_Core.Token('ACTID', to_char(actid));
4703: Wf_Core.Raise('WFENG_NOTIFICATION_PERFORMER');
4704: end if;
4705: --
4706: Wf_Engine_Util.Notification_Send(itemtype, itemkey, actid,
4707: l_msg, 'HRWPM', l_role_name, expand_role,
4708: resultout);
4709: end if; --l_admin <> l_supervisor_id
4710: exception when others then