Oracle Workflow API Reference Release 2.6.3 Part Number B10286-02 |
Previous | Next | Contents | Index | Glossary |
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)
public static boolean setItemAttrDate
(WFContext wCtx,
String itemType,
String itemKey,
String attributeName,
java.util.Date attributeValue)
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.
In Java, there are two implementations of setItemAttrDate(). One lets you provide the date value as a Java String object, while the other lets you provide the date value as a Java Date object.
Note: 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, name, or attributeName | The internal name of the item type attribute. |
avalue, event, or attributeValue | The value for the item type attribute. |
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.
Previous | Next | Contents | Index | Glossary |