Sie sind auf Seite 1von 7

Workflow Builder Practice

1. Create a simple Notification


Open the WFSTD.wft file and enter ITEM_TYPE and Internal Process name.
First create a process

Drag START and END functions from the WFSTD standard.


Now create a simple message

Enter the Internal Name and Display Name

In the body of the message, a custom message is added and the attribute is attached and is called
Message Attribute using &ATTRIBUTE_NAME. To use the attributes, we need to define the process
attributes and drag them on the messages, so that those attributes can be used by the messages.

You can leave the result tab blank.

Now create a simple notification,

Give the Internal Name and Display Name. Enter the Result Type as None. This is very important
because, this is a simple notification with no actions like Approve/Reject or Yes/No. So the result type
should be set to NONE.
In the Message field attach the newly created message. This way, we attach our custom message to our
notification.
Now for each notification, we need a person to send that notification to. That person is called
performer. This performer should be defined in oracle WF_USER_ROLES. Here we attach a custom role
and set it as performer.

Now to launch the process


SET serveroutput on;
DECLARE
BEGIN
--WF_ENGINE.Threshold := -1; (Enable, if you want to defer the wf)
wf_engine.createprocess ('XXWFMSG', 'XX103', 'SEND_SIMPLE_NTFN');
-- START the workflow process
wf_engine.startprocess ('XXWFMSG', 'XX103');
COMMIT;
END;

2. Send a notification to a role based on a parameter:

Define a parameter to pass for the role

Now create a simple notification which accepts a parameter for the performer.

Set the Result Type -> None and Message - > Attach the message defined earlier

In the Node tab, at the Perfomer set


Type - > Item Attribute
Value -> Attribute Name for role

To invoke the process


SET serveroutput on;
DECLARE
itemtype
itemkey

wf_item_activity_statuses.item_type%type := null;
wf_item_activity_statuses.item_key%type := null;

BEGIN
itemtype := 'XXWFMSG';
itemkey := 'XX_'||ap_suppliers_int_s.nextval;
--WF_ENGINE.Threshold := -1;
wf_engine.createprocess (itemtype, itemkey, 'SEND_SIMPLE_NTFN');
wf_engine.setitemattrtext ( itemtype,
itemkey ,
'ROLE_NAME_ATTRIBUTE', --Item Attribute Name
'DUMMY_TEST_WF_ROLE' --WF Role Name
);
-- START the workflow process
wf_engine.startprocess (itemtype, itemkey);
COMMIT;
END;

Das könnte Ihnen auch gefallen