Create Class API for OLM

By | January 7, 2015

This article of Oracle HRMS Overview is related to creation of Class API in OLM (Oracle Learning Management.) In previous article, I showed how to use Courses Creation API.

Create Class
Update Class
Delete Class

Create Class API – ota_event_api.create_class

Notes for Using this API

Your Course and Offering should be valid for the dates for which you are creating the class

DECLARE

l_effective_date DATE := SYSDATE;
l_event_id NUMBER;
l_activity_version_id NUMBE := 0;
l_business_group_id NUMBE := 83;
l_object_version_number NUMBER ;
l_title VARCHAR2 (2000);
l_offering_id NUMBER;
l_timezone_code VARCHAR2 (500);
v_location_id NUMBER;
v_organization_id NUMBER;
v_person_id NUMBER;
v_message VARCHAR2 (4000);
v_duration_uom VARCHAR2 (5);
v_Title VARCHAR2 (100);

BEGIN

v_Title := ‘Class 1’;

— SELECT *
— FROM ota_offerings_tl otl, ota_offerings ofr
— WHERE otl.offering_id = ofr.offering_id
— AND UPPER (otl.NAME) = ‘LIE SECOND OFFERING’

l_offering_id:= 11002;
— SELECT activity_version_id
— FROM ota_activity_versions
— WHERE UPPER (version_name) = ‘LEADERSHIP INTERPERSONAL EFFICIENCY’;

l_activity_version_id := 10085;
— SELECT timezone_code
— FROM fnd_timezones_tl
— WHERE UPPER (NAME) = ‘DUBAI’ AND LANGUAGE = ‘US’;

l_timezone_code := ‘Asia/Dubai’;

OTA_EVENT_API.CREATE_CLASS

(

p_effective_date => sysdate,
p_parent_offering_id => l_offering_id,
p_event_id => l_event_id,
p_activity_version_id => l_activity_version_id,
p_business_group_id => l_business_group_id,
p_organization_id => l_business_group_id,
p_event_type => ‘SCHEDULED’,
p_object_version_number => l_object_version_number,
p_title => ‘LIE Class 14’,
p_course_start_date => trunc(sysdate),
p_course_end_date => trunc(sysdate+1),
p_enrolment_start_date => trunc(sysdate),
p_duration => 2,
p_duration_units => ‘D’,
p_timezone => l_timezone_code,
p_validate => FALSE,
p_event_availability => ‘ALL’,
p_book_independent_flag => ‘N’,
p_public_event_flag => ‘Y’,
p_secure_event_flag => ‘N’,
p_event_status => ‘N’,
p_price_basis => ‘N’ — No Charge

);

dbms_output.put_line(‘Class’ || ‘Created l_event_id’||l_event_id);

EXCEPTION WHEN OTHERS THEN

dbms_output.put_line(‘Exception ‘||SQLERRM);

END;

Back to top

Update Class API – ota_event_api.update_class

DECLARE

l_event_id number;
l_object_version_number number;

BEGIN

select event_id,object_version_number
into l_event_id,l_object_version_number
from ota_events
where title like ‘LIE Class 14’;

OTA_EVENT_API.UPDATE_CLASS

(

p_validate => FALSE
,p_event_id => l_event_id
,p_effective_date=>sysdate
,p_object_version_number => l_object_version_number
,p_title =>‘LIE Class 15’

) ;

dbms_output.put_line(‘Class Updated Successfully’);

EXCEPTION WHEN OTHERS THEN

dbms_output.put_line(‘Exception ‘||SQLERRM);

END;

Back to top

Delete Class API – ota_event_api.delete_class

DECLARE

l_event_id number;
l_object_version_number number;

BEGIN

select event_id,object_version_number
into l_event_id,l_object_version_number
from ota_events
where title like ‘Class 1’;

OTA_EVENT_API.DELETE_CLASS

(

p_validate => FALSE
,p_event_id => l_event_id
,p_object_version_number => l_object_version_number

) ;

dbms_output.put_line(‘Class Deleted Successfully’);

EXCEPTION WHEN OTHERS THEN

dbms_output.put_line(‘Exception ‘||SQLERRM);

END;

Back to top

Other Related Posts