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)

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 in the same work item at once, use the WF_ENGINE.SetItemAttributeArray APIs rather than the WF_ENGINE.SetItemAttribute APIs for improved performance. See: SetItemAttributeArray.

If you need to set the values of item type attributes in several work items at once, use the WF_ENGINE_BULK.SetItemAttrText, WF_ENGINE_BULK.SetItemAttrNumber, and WF_ENGINE_BULK.SetItemAttrDate APIs rather than the WF_ENGINE.SetItemAttribute APIs. See: WF_ENGINE_BULK.SetItemAttrText, WF_ENGINE_BULK.SetItemAttrNumber, and WF_ENGINE_BULK.SetItemAttrDate.

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.
aname, name, or attributeName The internal name of the item type attribute.
avalue, event, or attributeValue The value for the item type attribute.

Sample Code

Example

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);
}

Related Topics