You can use a custom XML mapping file and themigrate_wf_handlersutility to rename your custom handlers and arguments to make them consistent with the Teamcenter handlers and arguments. The elements of the mapping file are:
Element Attributes Usage
<Mapping> None. The<Mapping>element is the root level
element in the XML file.
<Remove> None. Removes a handler or handler argument depending on where it is placed and its child elements.
If<Remove>is the top level element, it may
only have a<Handler>element as a child.
If<Remove> is the child of a <Handler>
element, it may only have one or more<Argument>elements as children.
If an Argument value is specified, the Argument is removed only if the Argument value in the mapping file is a subset of the actual Argument Value in the system. If an Argument value is not specified, the Argument is removed, ignoring whether it has any value or not.
<Replace> None. Replaces a handler with more than one handler as specified by subsequent<Add>
elements. The<Handler>child element
of the<Replace>names the handler to
be replaced. The arguments that need to be copied over to the new handlers (for example, see arg3 below) should be explicitly identified. If an argument from the old handler is not explicitly defined to be copied over, it is not added to a new handler, unlike the update/rename handler case.
For replacing one handler with another single handler, use the<Update>element. <Update> None. Changes a handler’s name and/or
Element Attributes Usage
<Argument> • name(optional)
The current name of an argument. • value(optional)
The current value of an argument. • newName(optional)
The new name to be given to an argument.
• newValue(optional)
The new value to be given to an argument. • index(optional)
Position of the argument in the handler. Theindex
andnameattributes
are mutually exclusive.
Specifies the current and possibly new names and values for arguments of a handler.
<Handler> • name
The current name of a handler. • newName(optional)
The new name to be given to a handler.
• transformAssignees=to-be-argname
(optional)
Use this attribute when your existing handler has any number of users, groups, roles, address lists, and/or resource pools as arguments where they are not
Specifies the current and possibly new name of a handler.
Element Attributes Usage already specified in the form of a -argname=argvalue pair (such as -participant=Smith).
<Criteria> • match(optional) false—the result
of the criteria should be negated.
true—default
value.
Specifies restrictions on the<Handler>
element in which it is embedded. The action specified by the<Handler>element
is only applied if the criteria evaluate to true.
<Criteria>may have two child elements: <Template name=”template-name”
/>, and <Argument name=”arg-name” value=”arg-value” /> that may be
specified alone or together. The
template-name is compared to the name of template containing the handler. The arg-name and arg-value are compared to the list of handler arguments. If both
<Template>and<Argument>are specified,
a handler must match both of the respective attributes. <Template> • name=template-name Compared to the name of the template containing the handler.
Restricts the<Criteria>element in which
it is embedded to the specified template. If both <Template>and<Argument>are
specified, a handler must match both of the respective attributes.
<Argument> • name=arg-name Compared to the list of handler argument names. • value=arg-value Compared to the list of handler argument values.
Restricts the<Criteria>element in which
it is embedded to the specified argument name and value. If both<Template>and <Argument>are specified, a handler must
match both of the respective attributes.
<Add> None. Adds a handler or handler argument. Unlike the<Remove> element, <Add>is
never a top level element, but is always a child of a<Handler>element.
Element Attributes Usage <Split> • name An argument name. • newName An argument value. • Delimiter (optional)
For splitting two delimited values existing only in the handler name field. For example, values delimited by two colons (::).
Splits any handler argument
old-name=old-value pair into separate arguments name1=old-name and name2=old-value.
A wildcard may be used for the name to match old-name.
For example, <Split name=”*”
newName=”-source,-decision” /> splits
Cond1=Checked and Cond2=true into -source=Cond1, -decision=Checked,
and -source=Cond2, -decision=true. Because handler arguments with the same name are combined into a single argument, this finally results in -source=Cond1,Cond2 and
-decision=Checked,true.
Note For any handler matched and processed by the migrate_wf_handlers utility, arguments having the same name are combined into a single argument with a resulting value composed of a comma-separated list. Here is a full example of a mapping file:
<Mapping> <Remove>
<!-- Remove all instances of Handler --> <Handler name="old-handler-name">
</Handler> </Remove> <Update>
<Handler name="old-handler-name" newName="new-handler-name"> <Remove>
<!-- if value is specified, remove the argument only if arg4 has value val4 -->
<Argument name="arg4" value="val4"/>
<!-- if value is not specified, remove argument irrespective of its value --> <Argument name="arg5" /> </Remove> </Handler> <Replace> <Handler name="old-handler-name"> <Add> <Handler name="new-handler1">
<!-- copy value from arg1 to new-arg1 --> <Argument name="arg1" newName="new-arg1" />
<!-- if arg2 has val2 (substring match) on old handler, add new argument new-arg2, copy over the value and replace the substring to
new-sub-value2 -->
<Argument name="arg2" value="sub-val2-1" newName="new-arg2" newValue="new-sub-val2-1" />
<!-- The same argument can be repeated multiple times for different substring value -->
<Argument name="arg2" value="sub-val2-2" newName="new-arg2" newValue="new-sub-val2-2" />
<!-- if arg3 is defined on old handler, add it to new handler and copy its value from old handler -->
<Argument name="arg3" />
<!-- add new argument with new value -->
<Argument newName="new-arg6" newValue="new-val6"/> </Handler>
<Handler name="new-handler2">
<Argument newName="new-arg5" newValue="new-val5"/> <!-- copy value from arg1 to new-arg1 -->
<Argument name="arg1" newName="new-arg1"/> </Handler>
</Add> </Replace> <Update>
<!-- Rename the old handler, as well as removing, adding and modifying its arguments. -->
<!-- If any handler argument names are not mentioned in remove/modify sections, they are copied over to new handler. -->
<Handler name="old-handler-name" newName="new-handler-name"> <Remove>
<!-- if value is specified, remove the argument only if arg4 has val4 -->
<Argument name="arg4" value="val4"/>
<!-- if value is not specified, remove argument irrespective of its value -->
<Argument name="arg5"/> </Remove>
<Add>
<Argument name="new-arg6" value="new-val6"/>
<!-- if value is not specified or is empty, set the argument value to empty -->
<Argument name="new-arg7" value=""/> </Add>
<Modify>
<Argument name="arg1" value="val1" newName="new-arg1" newValue="new-val1"/>
<!-- if newValue is not specified, copy the old argument value to new argument -->
<Argument name="arg2" value="val2" newName="new-arg2" /> </Modify>
</Handler> </Update> <Remove>
<!-- Remove Handler if the criteria matches (arg1 exists with value val1 and arg2 exists) -->
<Handler name="old-handler-name"> <Criteria>
<Argument name="arg1" value="val1"/> <Argument name="arg2"/>
</Criteria> </Handler> </Remove> <Update>
<!-- Rename Handler if arg3 does not exist on the handler --> <Handler name="old-handler-name" newName="new-handler-name">
<!—- If match set to ’false’, the result of the criteria should be negated. (!) --> <Criteria match="false"> <Argument name="arg3"/> </Criteria> </Handler> </Update> <Update>
<!-- Add one or more handler arguments --> <Handler name="old-handler-name">
<Add>
<Argument name="new-arg1" value="new-val1"/> <Argument name="new-arg2" value="new-val2"/> </Add> </Handler> </Update> <Update> <Handler name="old-handler-name"> <Modify>
<Argument name="arg1" value="val1" newName="new-arg1" newValue="new-val1"/>
<!-- if newValue is not specified, copy over the old argument value to new argument -->
<Argument name="arg2" value="val2" newName="new-arg2"/>
<!-- if newValue is empty, clear the value for new argument. If val3 is a substring of original value, special care should be taken in
removing ’,’ -->
<Argument name="arg3" value="val3" newName="new-arg3" newValue=""/> <!-- if new argument name is not specified, do not rename the argument, but modify the argument value -->
<Argument name="arg8" value="val8" newValue="new-val8" />
<!-- Rename Handler Argument, keeping/copying-over the value --> <Argument name="arg9" newName="new-arg9" />
<!-- Irrespective of the name of the argument, rename it to new-arg1 and copy the argument name as value of the new argument. If the new argument name is already defined/added on the handler, append the value to existing value of that argument with delimiter set in the preference. -->
<Argument name="*" newName="new-arg11" newValue="$ARGNAME"/>
<!-- Replace the argument value by another value which includes the original value. If value is a comma separated list, the new value will be a comma separated list with the static string (user:) added to each value in the list. -->
<Argument name="user" newName="-assignee" newValue="user:$ARGVALUE"/> <!-- index attribute will mention the arguments sequence in the handler. name and index are mutually exclusive. -->
<Argument index="1" newName="year" newValue="$ARGNAME"/> <Argument index="2" newName="week" newValue="$ARGNAME"/> </Modify>
</Update> <Update>
<!-- Rename Handler example. Rename "old-handler-name" handler to "new-handler-name" for all instances of "old-handler-name" handler -->
<Handler name="old-handler-name" newName="new-handler-name"> </Update>
</Mapping>