Oracle Migration Tool On Demand Guide > Migrating Workflow Rules and Action Sets >

Workflow Rules


A workflow rule is an instruction to Oracle CRM On Demand to perform one or more actions automatically, each time a specified event occurs. Table 52 describes the Oracle Migration Tool On Demand client commands that are used with workflow rules. The commands are case sensitive. For examples of running these commands, see Migrating Workflow Rules.

Table 52. Oracle Migration Tool On Demand Commands for Workflow Rules
Command
Description

Read WorkflowRuleSet RecordType TriggerEvent [ParentRecordType] [WorkflowName]

This command exports a set of workflow rules or a single workflow rule from an Oracle CRM On Demand server. At a minimum, you must specify a record type and a trigger event, or else specify a workflow rule name together with empty values for the record type, trigger event, and parent record type parameters. An empty value is specified as a set of double quotation marks (""). The parameters are as follows:

  • RecordType is the system name of the record type for the set of workflow rules. If you specify a workflow rule name in the command, then you do not need to specify a record type, but you must include an empty value for the RecordType parameter.
  • TriggerEvent is the code for the trigger event, see Table 53. If you specify a record type, then you must specify a trigger event. If you specify a workflow rule name, then you do not need to specify a trigger event, but you must include an empty value for the TriggerEvent parameter.
  • ParentRecordType is the system name of the parent record type for the workflow rules. This parameter is applicable only if the workflow rule has a parent record and the trigger event is Associate or Dissociate. If you specify a workflow rule name in the command, and if you do not want to specify a parent record type, then you must include an empty value for the ParentRecordType parameter.
  • WorkflowName is the name of the workflow rule. You can read an individual workflow rule by specifying a value for the WorkflowName parameter.

ReadAll WorkflowRuleSet

This command exports all workflow rules from an Oracle CRM On Demand server.

Upsert WorkflowRuleSet WorkflowRulesXML

This command updates or inserts a set of workflow rules on an Oracle CRM On Demand server.

NOTE:  When you use the Upsert command, you must include all of the definition for the workflow rule set in the XML file. Otherwise, some content might be unintentionally removed when you run the Upsert command, because the Upsert command deletes any existing workflow rules for which it does not find a match in the input XML file. For example, if the existing rule sets for a trigger event are not included in the XML file used for the Upsert command, then these rule sets are deleted. For more information about considerations that apply to the Upsert command, see Considerations That Apply to Upsert Operations.

Delete WorkflowRuleSet RecordType TriggerEvent [ParentRecordType]
[WorkflowName]

This command deletes the specified workflow rules from an Oracle CRM On Demand server. At a minimum, you must specify a record type and a trigger event, or else specify a workflow rule name together with empty values for the record type, trigger event, and parent record type parameters. An empty value is specified as a set of double quotation marks (""). The parameters are as follows:

  • RecordType is the system name of the record type for the set of workflow rules. If you specify a workflow rule name in the command, then you do not need to specify a record type, but you must include an empty value for the RecordType parameter.
  • TriggerEvent is the code for the trigger event, see Table 53. If you specify a record type, then you must specify a trigger event. If you specify a workflow rule name in the command, then you do not need to specify a trigger event, but you must include an empty value for the TriggerEvent parameter.
  • ParentRecordType is the system name of the parent record type for the workflow. This parameter is applicable only if the workflow has a parent record and the trigger event is Associate or Dissociate. If you specify a workflow rule name in the command, and if you do not want to specify a parent record type, then you must include an empty value for the ParentRecordType parameter.
  • WorkflowName is the name of the workflow rule. This parameter is optional. You can delete an individual workflow rule by specifying a value for the WorkflowName parameter.

InsertOrUpdate WorkflowRuleSet WorkflowRulesXML

This command updates a workflow rule if there is a matching workflow rule. If there is not a matching workflow rule, then the command inserts a new workflow rule.

NOTE:  Unlike the Upsert command, the InsertOrUpdate command does not delete any existing workflow rule for which it does not find a match in the input XML file.

The output from the extraction is saved to the TriggerEvent.xml file as follows:

  • If the ParentRecordType parameter has an empty value, then the output is saved to the following directory:

    migration tool install/repository/WorkflowRuleSet/RecordType

  • If the ParentRecordType parameter does not have an empty value, then the output is saved to the following directory:

    migration tool install/repository/WorkflowRuleSet/RecordType/ParentRecordType

The directory structure is automatically created. The structure is based on the unique combination of the record type, and parent record type, if applicable, and the trigger event. The exported XML files do not contain any workflow rule set that is based on a different record type or trigger event.

Considerations That Apply to Upsert Operations

When you run the Upsert command for workflow rules, the existing workflow rules are updated, new workflow rules are inserted, and rules that are not in the request are deleted. For the purposes of the Oracle Migration Tool On Demand client, this is known as an Upsert operation.

The following considerations apply to Upsert operations for workflow rules:

  • The workflow rules are ordered as they appear in the input XML file.
  • You cannot upsert two workflow rules with the same order.
  • If the workflow rule name does not match an existing workflow rule name, then a new workflow rule is created.
  • If the workflow rule name matches an existing workflow rule name, then the record type and trigger event cannot be modified.
  • The migration service protects data from becoming corrupted if the workflow rule is edited during loading, or loaded twice simultaneously, or extracted while it is being loaded.
  • The input file must contain only the workflow rules that are based on a unique combination of a record type and trigger event. For example, the input file can contain one or many workflow rules based on the Account record type and the When New Record Saved trigger event. The input file cannot contain another workflow rule with a different record type or trigger event.
  • The user running the Upsert command must have access to the object so that the Upsert command completes successfully.

Table 53 maps the workflow trigger events to the trigger event language independent code (LIC).

Table 53. Workflow Trigger Events
Trigger Event
Trigger Event Language Independent Code

When New Record Saved

WriteRecordNew

When Modified Record Saved

WriteRecordUpdated

Before Modified Record Saved

PreWriteRecord

Before Record Is Deleted

PreDeleteRecord

After Association With Parent

Associate

After Dissociation From Parent

Dissociate

When Record Is Restored

RestoreRecord

When Records Are Merged

MergeRecords

Oracle Migration Tool On Demand Guide, Release 34 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices.