Integrating Workflow with Oracle Portal

Using the Content Management Event Framework 16-33 Figure 16–8 Status of Approvals and Notifications for a Page Group

5. To enable approvals and notifications, select the Enable Approvals and

Notifications check box Figure 16–9 . Figure 16–9 Enabling or Disabling Approvals and Notifications for a Page Group

6. Click OK to save your changes.

7. Click Close to return to the page.

16.8.3.2 Grant Users the Manage Items With Approval Privileges

The next step is to grant Manage Items With Approval privileges to all users who need approval for their items. For the purposes of this example, lets specify that all users require approval for their items. To specify that all users require approval for their items, perform the following steps:

1. Go to any page in the page group and switch to Edit mode.

2. In the toolbar at the top of the page, click the Properties link next to Page Group.

3. Click the Approval tab to bring it forward.

4. Select the Require Approval for All Users check box

Figure 16–10 . Note: You can skip this step if your external workflow process does not require the approval or rejection of portal items. Note: Make sure you click the link next to Page Group and not the one next to Page Figure 16–2 . 16-34 Oracle Fusion Middleware Developers Guide for Oracle Portal Figure 16–10 Specifying That All Users Require Approval for Their Items

5. Click OK.

16.8.3.3 Run Scripts Required for the CMEF Workflow Integration Example

Before you proceed to the next step, there are several tasks that you need to perform. These steps are as follows:

1. Log in to the SYS schema and run the following command:

GRANT EXECUTE ON owf_mgr.wf_engine to cmefsamples;

2. Log in to the portal schema and run provsyns.sql. When prompted for the

schemaprovider name enter owf_mgr.

3. Log in to the CMEFSAMPLES schema and run the following:

drop sequence WF_SEQ create sequence WF_SEQ increment by 1 start with 1 maxvalue 1000000000 minvalue 1 cache 20 grant select on wf_seq to owf_mgr; This creates the sequence required by workflow, and allows the OWF_MGR workflow schema SELECT privileges on the sequence.

4. Create the synonym WF_ENGINE to the workflow schema:

create synonym wf_engine for owf_mgr.wf_engine;

16.8.3.4 Create Subscriber and Check Procedures

You need to create a subscriber that listens to the WWSBR_EVENT_Q queue, waiting until a user adds an item that requires approval. The subscriber calls the WF_ CHECKURL workflow process to perform the item validation and to send the e-mail notification. Example 16–17 shows the WORKFLOW_APPROVAL subscriber code. Example 16–17 The WORKFLOW_APPROVAL Subscriber create or replace procedure workflow_approval is MIME_TYPE_TEXT constant varchar230 := textplain; agent_list dbms_aq.aq_agent_list_t; wait_time integer := 30; begin_time pls_integer; end_time pls_integer; agent_w_message aq_agent; dequeue_options dbms_aq.dequeue_options_t; message_properties dbms_aq.message_properties_t;