Share via


ReleaseUpdateDB60_Basic.updateWorkflowConfiguration Upgrade Script

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Class

ReleaseUpdateDB60_Basic

Method

updateWorkflowConfiguration

Description

Upgrades the Microsoft Dynamics AX 2009 workflow configurations into Microsoft Dynamics AX 2012 workflow models. Moves packed structures into new tables, resolves duplicate sequence numbers and configuration IDs by using ID mapping table, generates links between workflow elements, and upgrade sub-workflows by introducing conditional gateways and parallel branch containers.

Affected Modules and Tables

Affected Modules

Basic

CRM

Expense management

General ledger

Affected Tables

WorkflowConfigurationTable

WorkflowConfigurationTableNotes

WorkflowTable

WorkflowVersionTable

WorkflowVersionTableNotes

WorkflowVersionNotificationTable

WorkflowElementTable

WorkflowElementNotificationTable

WorkflowStepTable

WorkflowElementLinkTable

WorkflowElementOutcomeTable

WorkflowSubWorkflowTable

WorkflowSubWorkflow

WorkflowMessageText

WorkflowIdRelationshipMapping

WorkflowAssignmentTable

WorkflowTimeSpanTable

WorkflowEscalationPathTable

WorkflowEscalationTable

WorkflowMaxRuntimeTable

WorkflowActionTable

ExpressionTable

SysWorkflowTable

WorkflowWorkItemDelegationParameters

WorkflowTrackingStatusTable

WorkflowTrackingTable

WorkflowWorkItemTable

TrvPolicyTable

SmmProcessStage

LedgerJournalName

Remarks

The WorkflowConfigurationTable table is re-factored into the WorkflowTable and WorkflowVersionTable tables. All duplicate sequence numbers in the WorkflowConfigurationTable table are resolved in the new WorkflowTable by setting the WorkflowTable.SequenceNumber value equal to the WorkflowConfigurationTable.RecID value. All duplicate configuration IDs in the WorkflowConfigurationTable table are resolved in the WorkflowVersionTable table by setting a new GUID. New GUIDs are also generated for all elements, such as the WorkflowElementTable table, and steps, such as the WorkflowStepTable table, for all configurations that have duplicate IDs. Fields in any other table that references the configuration IDs, sequence numbers, or expressions are also updated with the new IDs. The old and new values are maintained in a mapping table to be used by the runtime to complete in-flight workflow instances. The upgrade also removes any packed structures that are present in any of the workflow tables and writes them into new tables. Some of the de-normalized data was also normalized into new tables. Links relationships are created between every element in a configuration. Sub-workflows are upgraded by introducing conditional gateways that represent the guard conditions for the container or line and parallel branch container elements if the sub-workflows are to be executed in parallel.

Data Migration Section

From Table: WorkflowConfigurationTable

To Table: WorkflowTable

TemplateName

TemplateName

Name

Name

Module

Module

SequenceNumber

SequenceNumber

Type

Type

DefaultConfiguration

DefaultConfiguration

CategoryName

CategoryName

DocumentTableName

DocumentTableName

From Table: WorkflowConfigurationTable

To Table: WorkflowVersionTable

ConfigurationID

ConfigurationID

Enabled

Enabled

Owner

Owner

ActivationConditionType

ActivationConditionType

ActivationConditionID

ActivationConditionID

VersionIDMajor

VersionIDMajor

VersionIDMinor

VersionIDMinor

VersionIDBuild

VersionIDBuild

VersionIDRevision

VersionIDRevision

From Table: WorkflowConfigurationTable

To Table: WorkflowVersionNotificationTable

NotificationList

Enabled

NotificationList

Action

From Table: WorkflowConfigurationTable

To Table: WorkflowAssignmentTable

NotificationList

AssignmentType

NotificationList

ActorValue

NotificationList

UserValue

NotificationList

ParticipantProviderName

NotificationList

ParticipantTokenName

NotificationList

HierarchyProviderName

NotificationList

HierarchyTokenName

NotificationList

HierarchyFilterType

NotificationList

HierarchyFilterId

NotificationList

HierarchyStopId

From Table: WorkflowConfigurationTableNotes

To Table: WorkflowVersionTableNotes

ConfigurationID

ConfigurationID

Notes

Notes

From Table: WorkflowElementTable

To Table: WorkflowActionTable

ElementOutcomes

Name

ElementOutcomes

Enabled

From Table: WorkflowElementTable

To Table: WorkflowElementNotificationTable

NotificationList

Action

NotificationList

Enabled

From Table: WorkflowElementTable

To Table: WorkflowAssignmentTable

NotificationList

AssignmentType

NotificationList

ActorValue

NotificationList

UserValue

NotificationList

ParticipantProviderName

NotificationList

ParticipantTokenName

NotificationList

HierarchyProviderName

NotificationList

HierarchyTokenName

NotificationList

HierarchyFilterType

NotificationList

HierarchyFilterId

NotificationList

HierarchyStopId

From Table: WorkflowElementTable

To Table: WorkflowMaxRuntimeTable

UseMaxRuntime

Enabled

MaxRuntimeTime

Time

MaxRuntimeTimezone

Timezone

MaxRuntimeOutcome

Outcome

From Table: WorkflowElementTable

To Table: WorkflowTimespanTable

MaxRuntime

DateType

MaxRuntime

HourValue

MaxRuntime

HourCalendar

MaxRuntime

DailyValue

MaxRuntime

DailyCalendar

MaxRuntime

MonthlyDayOfWeek

MaxRuntime

MonthlyWeekInMonth

MaxRuntime

WeeklyDayOfWeek

MaxRuntime

WeeklyValue

MaxRuntime

YearlyDayOfWeek

MaxRuntime

YearlyMonthInYear

MaxRuntime

YearlyWeekInMonth

From Table: WorkflowStepTable

To Table: WorkflowAssignmentTable

AssignTo

AssignmentType

AssignTo

ActorValue

AssignTo

UserValue

AssignTo

ParticipantProviderName

AssignTo

ParticipantTokenName

AssignTo

HierarchyProviderName

AssignTo

HierarchyTokenName

AssignTo

HierarchyFilterType

AssignTo

HierarchyFilterId

AssignTo

HierarchyStopId

EscalationPath

AssignmentType

EscalationPath

ActorValue

EscalationPath

UserValue

EscalationPath

ParticipantProviderName

EscalationPath

ParticipantTokenName

EscalationPath

HierarchyProviderName

EscalationPath

HierarchyTokenName

EscalationPath

HierarchyFilterType

EscalationPath

HierarchyFilterId

EscalationPath

HierarchyStopId

From Table: WorkflowStepTable

To Table: WorkflowTimespanTable

Duration

DateType

Duration

HourValue

Duration

HourCalendar

Duration

DailyValue

Duration

DailyCalendar

Duration

MonthlyDayOfWeek

Duration

MonthlyWeekInMonth

Duration

WeeklyDayOfWeek

Duration

WeeklyValue

Duration

YearlyDayOfWeek

Duration

YearlyMonthInYear

Duration

YearlyWeekInMonth

EscalationPath

DateType

EscalationPath

HourValue

EscalationPath

HourCalendar

EscalationPath

DailyValue

EscalationPath

DailyCalendar

EscalationPath

MonthlyDayOfWeek

EscalationPath

MonthlyWeekInMonth

EscalationPath

WeeklyDayOfWeek

EscalationPath

WeeklyValue

EscalationPath

YearlyDayOfWeek

EscalationPath

YearlyMonthInYear

EscalationPath

YearlyWeekInMonth

From Table: WorkflowStepTable

To Table: WorkflowEscalationTable

EscalationAction

Action

EscalationPathAction

PathAction

EscalationType

EscalationType

From Table: WorkflowStepTable

To Table: WorkflowEscalationPathTable

EscalationPath

Level

From Table: WorkflowSubWorkflowTable

To Table: WorkflowSubWorkflow

Name

Name

DocumentKeyField

DocumentKeyField

DocumentKeyTable

DocumentKeyTable

WaitForComplete

WaitForComplete

From Table: WorkflowElementTable

To Table: WorkflowElementTable

Name

Name

ConfigurationID

ConfigurationID

ExecuteSubWorkflowID

ConditionalID

From Table: WorkflowSubWorkflowTable

To Table: WorkflowElementTable

ExecuteWorkflowID

ConditionalID

New Tables or Fields

Table

Field

Extended Data Type

-or- Base Enum

WorkflowTable

WorkflowVersionTable

WorkflowVersionTableNotes

WorkflowVersionNotificationTable

WorkflowAssignmentTable

WorkflowActionTable

WorkflowMaxRuntimeTable

WorkflowTimespanTable

WorkflowEscalationTable

WorkflowEscalationPathTable

WorkflowElementLinkTable

WorkflowElementOutcomeTable

WorkflowElementNotificationTable

WorkflowSubWorkflow

WorkflowParallelBranchTable

WorkflowIDRelationshipMapping

WorkflowElementTable

ConditionalID

WorkflowElementTable

ParallelBranchTable

Deleted Tables or Fields

Table

Field

WorkflowConfigurationTable

*

WorkflowConfigurationTableNotes

*

WorkflowElementTable

UseMaxRuntime

WorkflowElementTable

ElementOutcomes

WorkflowElementTable

NotificationList

WorkflowElementTable

MaxRuntime

WorkflowElementTable

MaxRuntimeOutcome

WorkflowElementTable

MaxRuntimeTime

WorkflowElementTable

MaxRuntimeTimezone

WorkflowElementTable

DataAreaID

WorkflowStepTable

AssignTo

WorkflowStepTable

EscalationType

WorkflowStepTable

EscalationAction

WorkflowStepTable

EscalationPathAction

WorkflowStepTable

EscalationPath

WorkflowStepTable

Duration

WorkflowStepTable

DataAreaID

WorkflowSubWorkflowTable

DataAreaID