Oracle Workflow Guide
Release 2.6.2

Part Number A95265-03
  Go to previous page Go to next page       Go To Table Of Contents Go To Index Go To Table Of Contents

                     Contents  Index  Glossary Master Index Feedback
 

SetItemAttribute

PL/SQL Syntax

procedure SetItemAttrText

 (itemtype in varchar2,
itemkey in varchar2,
aname in varchar2,
avalue in varchar2);

procedure SetItemAttrNumber
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2,
avalue in number);

procedure SetItemAttrDate
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2,
avalue in date);

procedure SetItemAttrEvent
(itemtype in varchar2,
itemkey in varchar2,
name in varchar2,
event in wf_event_t);

Java Syntax

public static boolean setItemAttrText

 (WFContext wCtx,
String itemType,
String itemKey,
String aName,
String aValue)

public static boolean setItemAttrNumber

 (WFContext wCtx,
String itemType,
String itemKey,
String aName,
BigDecimal aValue)

public static boolean setItemAttrDate

 (WFContext wCtx,
String itemType,
String itemKey,
String aName,
String aValue)

Description

Sets the value of an item type attribute in a process. Use the correct procedure for your attribute type. All attribute types except number, date, and event use SetItemAttrText.

Attention: If you need to set the values of large numbers of item type attributes at once, use the SetItemAttributeArray APIs rather than the SetItemAttribute APIs for improved performance. See: SetItemAttributeArray

Arguments (input)

wCtx Workflow context information. Required for the Java method only. See: Oracle Workflow Context.
itemtype A valid item type.
itemkey A string generated from the application object's primary key. The string uniquely identifies the item within an item type. The item type and key together identify the process. See: CreateProcess.
Note: You can pass #SYNCH as the itemkey to create a forced synchronous process. See: Synchronous, Asynchronous, and Forced Synchronous Processes.
aname or name The internal name of the item type attribute.
avalue or event The value for the item type attribute.
Example 1

The following code excerpt shows an example of how to call setItemAttrText() in a Java program. The example code is from the WFTest.java program.

if (WFEngineAPI.setItemAttrText(ctx, iType, iKey,
"REQUESTOR_USERNAME", owner))
System.out.println("Requestor: "+owner);
else
{
WFEngineAPI.showError(ctx);
}

Example 2

If an event message is stored within an item attribute of type event, you can access the event data CLOB within that event message by creating an item attribute of type URL for the event data. The following sample PL/SQL code shows how to set the value of the URL attribute to reference the event data.

l_eventdataurl := Wfa_html.base_url||'Wf_Event_Html.
EventDataContents?P_EventAttribute=EVENT_MESSAGE'||'&'||
'P_ItemType='||itemtype||'&'||'P_ItemKey='||itemkey||'&'||
'p_mime_type=text/xml';

WF_ENGINE.SetItemAttrText('<item_type>', '<item_key>',
'EVENTDATAURL', l_eventdataurl);

If you have applied a stylesheet to the event data XML document to create HTML, set the p_mime_type parameter in the URL to text/html instead.

If you omit the p_mime_type parameter from the URL, the MIME type defaults to text/xml.

See Also

Event Message Structure  
         Previous  Next          Contents  Index  Glossary


Oracle
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.