Section 16.8.3.2, Grant Users the Manage Items With Approval Privileges

Using the Content Management Event Framework 16-35 message_handle raw16; message portal.wwsbr_event; l_subscriber varchar230 := CMEF_WORKFLOW; l_queue varchar230 := PORTAL.WWSBR_EVENT_Q; l_mode binary_integer := dbms_aq.REMOVE; l_attribute_site_id number := 0; l_event varchar230; l_doc wwdoc_api.document_record; l_desc varchar24000; l_itemkey varchar2100; l_job_nr number; l_itemtype varchar2100 := WF; l_wf_process varchar2100 := WF_CHECKURL; l_is_indirect boolean := TRUE; l_portal_user_name varchar230 := portal; l_portal_password varchar230 := portal password; l_url varchar24000; := ; begin begin_time := dbms_utility.get_time; agent_list1 := aq_agentl_subscriber, l_queue, null; loop -- Wait for messages. dbms_aq.listen agent_list = agent_list, wait = wait_time, agent = agent_w_message ; if agent_w_message.name = l_subscriber then dequeue_options.wait := dbms_aq.NO_WAIT; dequeue_options.consumer_name := l_subscriber; dequeue_options.navigation := dbms_aq.FIRST_MESSAGE; dequeue_options.dequeue_mode := l_mode; dbms_aq.dequeue queue_name = l_queue, dequeue_options = dequeue_options, message_properties = message_properties, payload = message, msgid = message_handle ; -- If the event is an ITEM INSERT event and marked for later publication. if message.action = SUBMIT_ITEM_FOR_APPROVAL and message.object_class = ITEM and message.raw_event = INSERT and message.state = NOT_PUBLISHED then portal.wwctx_api.set_contextl_portal_user_name, l_portal_password; -- Get the URL property for the object. select url into l_url from portal.wwsbr_all_items where id = message.object_id and caid = message.object_site_id; -- Get the nextval of the workflow sequence for the itemkey. select wf_seq.nextval into l_job_nr from dual; l_itemkey := lpadto_charl_job_nr, 5, 0; -- Launch the workflow engine process and pass the paramters for -- the portal item to the workflow process. wf_engine.createprocessl_itemtype, l_itemkey, l_wf_process;