SetItemAttributeArray

PL/SQL Syntax

procedure SetItemAttrTextArray
  (itemtype in varchar2,
   itemkey in varchar2,
   aname in Wf_Engine.NameTabTyp,
   avalue in Wf_Engine.TextTabTyp);

procedure SetItemAttrNumberArray
  (itemtype in varchar2,
   itemkey in varchar2,
   aname in Wf_Engine.NameTabTyp,
   avalue in Wf_Engine.NumTabTyp);

procedure SetItemAttrDateArray
  (itemtype in varchar2,
   itemkey in varchar2,
   aname in Wf_Engine.NameTabTyp,
   avalue in Wf_Engine.DateTabTyp);

Description

Sets the values of an array of item type attributes in a process. Use the SetItemAttributeArray APIs rather than the SetItemAttribute APIs for improved performance when you need to set the values of large numbers of item type attributes at once.

Use the correct procedure for your attribute type. All attribute types except number, date, and event use SetItemAttrTextArray.

Note: 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.SetItemAttributeArray APIs. See: WF_ENGINE_BULK.SetItemAttrText, WF_ENGINE_BULK.SetItemAttrNumber, and WF_ENGINE_BULK.SetItemAttrDate.

Arguments (input)

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 An array of the internal names of the item type attributes.
avalue An array of the values for the item type attributes.

Sample Code

Example

The following example shows how using the SetItemAttributeArray APIs rather than the SetItemAttribute APIs can help reduce the number of calls to the database.

Using SetItemAttrText():

SetItemAttrText('ITYPE', 'IKEY', 'VAR1', 'value1');
SetItemAttrText('ITYPE', 'IKEY', 'VAR2', 'value2');
SetItemAttrText('ITYPE', 'IKEY', 'VAR3', 'value3');

// Multiple calls to update the database.
 

Using SetItemAttrTextArray():

declare
  varname   Wf_Engine.NameTabTyp;
  varval    Wf_Engine.TextTabTyp;
begin
  varname(1) := 'VAR1';
  varval(1)  := 'value1';
  varname(2) := 'VAR2';
  varval(2)  := 'value2';
  varname(3) := 'VAR3';
  varval(3)  := 'value3';
Wf_Engine.SetItemAttrTextArray('ITYPE', 'IKEY', varname, varval);
exception
  when OTHERS then
    // handle your errors here
    raise;
end;

// Only one call to update the database.