Beruflich Dokumente
Kultur Dokumente
Before you modify the definitions of any Workflow objects, you should
ensure that your changes will not adversely affect any active work
items that are based on those definitions. Changes to Oracle Workflow
objects have different effects on active work items depending on
whether or not the objects support versioning.
For a Workflow object, versioning means that either the object itself or
the object that owns it supports multiple occurrences of the same object
in the database, distinguished only by a version number, begin date,
and end date. For example, the following two versions of a VOTE
activity could exist simultaneously in the WF_ACTIVITIES table:
Name
Version
Begin Date
End Date
Message
Lookup Type
Vote
01JAN1998
31DEC1998
Vote Message
Yes/No
Vote
01JAN1999
New Vote
Message
Approval
Table 1 1 (Page 1 of 1)
When you modify a Workflow object that supports versioning, both the
original version and the new version exist in the database. Any active
work items that reference that object will continue to completion still
using the same version that was in effect when the work items were
initiated. Only new work items initiated after the change will use the
new version.
In the above example, work items that are initiated between January 1,
1998 and December 31, 1998 will send the message Vote Message with
result options of Yes or No, whether the work items are completed
before January 1, 1999 or not. Only work items that are initiated on or
after January 1, 1999 will send the message New Vote Message with
result options of Approve or Reject.
Note: All process definition information is versioned.
When you modify a Workflow object that does not support versioning,
however, the previous definition of the object is updated and only the
modified definition exists in the database. Any active work items that
reference that object will use the modified object after the change.
If the modified object is no longer compatible with the rest of the
workflow definition used by the work item, errors may arise. To avoid
such errors, you must take all references to the object into consideration
when planning your changes to ensure that the changes do not cause
any incompatibility.
Note: If your situation allows, you can avoid the risk of
backward incompatibility by aborting and restarting all active
work items after you make your changes. This method forces
the restarted work items to use the modified definitions of all
Workflow objects, including those that support versioning as
well as those that do not.
include the new item attribute unless you specifically create the
attribute for them by calling the AddItemAttr() or AddItemAttributeArray
APIs. If you also add references to the new item attribute in the existing
PL/SQL code within the workflow process, those references may cause
errors in active work items that do not include the attribute.
For example, if you change the PL/SQL API for a function activity by
calling a Workflow Engine API to communicate with a new item
attribute, the function activity will fail for active work items that do not
have the new item attribute defined.
You should plan carefully when making any modifications to the
existing PL/SQL code within a workflow process to ensure that you do
not add references to a new item attribute without also creating the
item attribute for active work items that require it. See: PL/SQL Code:
page 6.
Note: You can, however, add references to new item attributes
in the API that starts a workflow process, without making
special provisions for active work items. For example, you can
call the SetItemAttribute or SetItemAttributeArray APIs to
populate the new item attributes at the start of the process.
Active work items will not be affected by such changes, since
these work items have already passed through this code.
Messages
When the Workflow Engine requests the Notification System to send a
message, the Notification System creates a notification attribute in the
notification tables for every message attribute. The notification
attribute rows contain the variable data that will be tokenreplaced into
the message body, including the subject line and body text, at runtime.
The message body, however, is not copied into the notification tables.
Instead, the message body is referenced by the various Notification
System APIs at runtime, when the notification is displayed to the user.
As a result, any modifications to a message body will affect
notifications in active work items that were sent before the change, as
well as notifications that are sent after the change.
You can make certain types of modifications to a message body without
risking incompatibility errors. These modifications include:
Adding static text
Editing static text
Removing static text
Removing message attribute tokens
For example, if you plan to add a lookup code to the group of values
that an API can return, you should first ensure that the function activity
node has an outgoing transition, such as Default, that the Workflow
Engine can follow when the API returns that value. Otherwise, the
process will enter an ERROR state when that value is returned. If
there is no appropriate outgoing transition, you must implement the
change in a new API and update the process to model branching logic
for the additional return value.
Also, if you change the existing PL/SQL API for a function activity by
calling a Workflow Engine API to communicate with a new item
attribute, you should ensure that you also create the new item attribute
for active work items. Otherwise, the function activity will fail for
active work items which do not have the new item attribute defined.
Calls to any of the following APIs with newly created item attributes as
parameters may cause the function activity to fail if active work items
do not have the item attributes defined:
wf_engine.SetItemAttrText
wf_engine.SetItemAttrNumber
wf_engine.SetItemAttrDate
wf_engine.SetItemAttrEvent
wf_engine.SetItemAttrTextArray
wf_engine.SetItemAttrNumberArray
wf_engine.SetItemAttrDateArray
wf_engine.GetItemAttrText
wf_engine.GetItemAttrNumber
wf_engine.GetItemAttrDate
wf_engine.GetItemAttrEvent
To create copies of a new item attribute for active work items, call
AddItemAttr() or one of the AddItemAttributeArray APIs. You can place
this call either in a custom upgrade script or in an exception handler.
Upgrade script Before you modify your API, write and execute
a custom upgrade script that creates and populates the new item
attribute for any active work items that reference that API. The
following example shows one way to structure an upgrade
script.
procedure <procedure_name>(
itemtype
in varchar2,
itemkey
in varchar2,
actid
in number,
funcmode
in varchar2,
result
in out varchar2)
is
begin
Your
result := ;
return;
exception
when others then
The line below records this function call in the error system
in the case of an exception.
wf_core.context(<package_name>, <procedure_name>,
itemtype, itemkey, to_char(actid), funcmode);
raise;
end <procedure_name>;
See Also
Item Attributes: page 3
10