<?xml version="1.0" encoding="utf-8"?>
  <finScript version="1.00" exportedUtcDate="2023-03-20T21:38:06.0000000">
    <CreatedUserId>ADMIN</CreatedUserId>
    <CreatedUtcDate>2023-03-17T01:36:03.0200000</CreatedUtcDate>
    <UpdatedUserId>ADMIN</UpdatedUserId>
    <UpdatedUtcDate>2023-03-20T21:37:30.8070000</UpdatedUtcDate>
    <ScriptId>WIBAER</ScriptId>
    <Description>Workflow Item Bank Account Enquiry Review</Description>
    <ScriptType>HtmlWidget</ScriptType>
    <Active>true</Active>
    <AllowUI>false</AllowUI>
    <Bookmarks />
    <Category />
    <Code>' HtmlWidget_WorkflowItemBankAccountEnquiryReview
Option Explicit On
Option Strict On

' #################################################################
' Workflow Item Bank Account Enquiry Review wizard HTML Widget
'
' Version: 1.00 (21/03/2023)
'
' Usage: System-supplied HTML Widget
' #################################################################
' Version        Date  User     Job       Description
' -------  ----------  -------  --------  -------------------------
'    1.00  21/03/2023  ISS      J030719   Created
' #################################################################

' Constants
Private Const FORM_KEY As String = "WorkflowItemBankAccountEnquiryReview"

' Common Parameters
Private mWorkflowId As String
Private mWorkflowItemPk As Integer
Private mReadOnly As Boolean

' Objects
Private mCombinedParameters As ISKeyValueList
Private mParameters As ISKeyValueList
Private mStartupParameters As ISKeyValueList

Public Function Main(eventId As String,
                     parametersJson As String,
                     startUpParametersJson As String,
                     hostingContext As isefinHtmlWidgetHostingContext,
                     requestInfo As finScriptRequestInfo,
                     ByRef returnValue As String) As Boolean

  ' Assume Success
  Main = True

  ' Get Parameters
  mParameters = finBL.CreateKeyValueList()
  mParameters.FromSimpleJsonString(parametersJson)
  mStartupParameters = finBL.CreateKeyValueList()
  mStartupParameters.FromSimpleJsonString(startUpParametersJson)

  ' Get Combined Parameters (Startup Parameters updated with event Parameters)
  mCombinedParameters = mStartupParameters.Clone()
  mCombinedParameters.UpdateFromKeyValueList(mParameters, True)

  ' Get Common Parameters
  With mCombinedParameters
    mWorkflowId = .GetString("WorkflowId")
    mWorkflowItemPk = .GetInteger("WorkflowItemPk")
    mReadOnly = .GetBoolean("ReadOnly")
  End With

  ' Handle Events
  Select Case eventId
    Case ""
      ' Main event, i.e., return initial HTML content (excluding html and body tags)
      returnValue = ScriptInfo.TemplateText

    Case "Finish"
      ' Finish wizard
      Main = Finish(parametersJson, requestInfo, returnValue)
      
    Case "GetInitialisationInfo"
      ' Get Initialisation Information required for this wizard
      Main = GetInitialisationInfo(returnValue)

    Case "WizardValidate"
      ' Validate wizard page
      Main = WizardValidate(parametersJson, returnValue)

    Case Else
      finBL.Error.ErrorBeginFormat("Unhandled event '{0}'.", eventId)
      Main = False
  End Select

End Function

''' &lt;summary&gt;
'''  Finish, i.e., Commit changes.
''' &lt;/summary&gt;
''' &lt;param name="parametersJson"&gt;
'''  A JSON formatted WizardFinishParameters object.
''' &lt;/param&gt;
Private Function Finish(parametersJson As String,
                        requestInfo As finScriptRequestInfo,
                        ByRef returnValue As String) As Boolean

  Dim AccountAppApplicant As finAccountAppApplicant
  Dim Client As finClient
  Dim DecisionCardSourceObject As Object
  Dim DecisionOutcome As finDecisionOutcome
  Dim obj As Object
  Dim Success As Boolean
  Dim Warning As String
  Dim WizardFinishParameters As WizardFinishParameters
  Dim Workflow As finWorkflow
  Dim WorkflowExecutor As finWorkflowExecutor
  Dim WorkflowItem As finWorkflowItem

  ' Assume Success
  Success = True

  ' Parse Parameters
  If finBL.Runtime.WebUtilities.DeserialiseJsonStringToObject(parametersJson, GetType(WizardFinishParameters), obj) Then
    WizardFinishParameters = DirectCast(obj, WizardFinishParameters)
  Else
    Success = False
  End If

  ' Create Workflow, Item and Executor objects
  If Success Then
    Success = CreateWorkflow(Workflow, WorkflowItem, WorkflowExecutor)
  End If

  ' Get Decision Card Information for Execute
  If Success Then
    If WorkflowItem.DecisionCardPk &lt;&gt; 0 Then
      Select Case Workflow.WorkflowType.TargetObjectType
        Case isefinWorkflowTargetObjectType.Account, isefinWorkflowTargetObjectType.Client
          If GetClient(Workflow, WorkflowItem, Client, Nothing, Nothing) Then
            DecisionCardSourceObject = Client
          Else 
            Success = False
          End If
        
        Case isefinWorkflowTargetObjectType.AccountApp
          If GetApplicant(Workflow, WorkflowItem, AccountAppApplicant, Nothing, Nothing) Then
            DecisionCardSourceObject = AccountAppApplicant
          Else 
            Success = False
          End If
      End Select
      
      ' Get Decision Outcome
      If Success Then
        Success = GetDecisionOutcome(WorkflowItem, DecisionCardSourceObject, DecisionOutcome)
      End If
    End If    
  End If
  
  ' Execute
  If Success Then
    Select Case Workflow.WorkflowType.Version
      Case isefinWorkflowTypeVersion.Version1
        ' ------------------
        ' Workflow Version 1
        ' ------------------
        Success = finBL.WorkflowFunctions.WorkflowItemSetOutcomeBankAccountEnquiryReview(Workflow, WorkflowItem, WizardFinishParameters.Outcome, DecisionOutcome, DecisionCardSourceObject, WizardFinishParameters.Notes, "")
    
      Case isefinWorkflowTypeVersion.Version2
        ' ------------------
        ' Workflow Version 2
        ' ------------------
        If WorkflowExecutor.ExecuteWorkflowItemSetOutcomeBankAccountEnquiryReview(WorkflowItem.Pk, WizardFinishParameters.Outcome, True, DecisionOutcome, DecisionCardSourceObject, WizardFinishParameters.Notes, True) Then          
          ' Other Warnings
          If WorkflowExecutor.ProcessHaltedForWebServiceInTransaction Then
            Warning = "Workflow processing could not be completed since an attempt was made to perform a Web Service call from within a database transaction."
          End If
        Else 
          Success = False
        End If
    End Select
  End If

  ' Finalise
  If Success Then
    Success = finBL.Runtime.WebUtilities.SerialiseObjectToJsonString(New WizardFinishDetails(Warning), returnValue)
  End If

  Return Success

End Function

''' &lt;summary&gt;
'''  Create Workflow and Workflow Executor.
''' &lt;/summary&gt;
Public Function CreateWorkflow(ByRef workflow As finWorkflow,
                               ByRef workflowItem As finWorkflowItem,
                               ByRef workflowExecutor As finWorkflowExecutor) As Boolean
  
  Dim Success As Boolean
  Dim ItemGroup As finWorkflowItem
  
  ' Assume Success
  Success = True
  
  ' Initialise ByRef Parameters
  workflow = finBL.CreateWorkflow()
  workflowItem = Nothing
  workflowExecutor = finBL.CreateWorkflowExecutor()
  
  ' Load Workflow &amp; Executor
  If workflow.Load(mWorkflowId) Then
    Success = workflowExecutor.WorkflowLoadPk(workflow.Pk)
  Else 
    Success = False
  End If
  
  ' Workflow Item
  If Success Then
    For Each ItemGroup In workflow.ItemGroups
      If ItemGroup.Items.ExistsPk(mWorkflowItemPk) Then
        workflowItem = ItemGroup.Items.ItemByPk(mWorkflowItemPk)
      End If
    Next 
    
    ' Validate
    If workflowItem Is Nothing Then
      Success = False
      finBL.Error.ErrorBegin("Invalid Workflow Item Pk.")
    ElseIf workflowItem.ItemType &lt;&gt; isefinWorkflowItemType.BankAccountEnquiryReview Then
      Success = False
      finBL.Error.ErrorBeginFormat("This HTML Widget cannot be used with Workflow Items of Type '{0}'.", workflowItem.ItemTypeText)
    End If
  End If
  
  Return Success
                                       
End Function

''' &lt;summary&gt;
'''  Get Initialisation Information required for this wizard.
''' &lt;/summary&gt;
Public Function GetInitialisationInfo(ByRef response As String) As Boolean

  Dim AccountAppApplicant As finAccountAppApplicant
  Dim BankAccountEnquiryResponse As ISBankAccountEnquiryResponse
  Dim Client As finClient
  Dim DecisionCardSourceObject As Object
  Dim DecisionOutcome As finDecisionOutcome
  Dim DecisionOutcomeCode As String
  Dim FormInitialisationInfo As FormInitialisationInfo
  Dim Message As String
  Dim OutcomeList As ISCodeDescriptionList
  Dim ServiceLog As ISServiceLog
  Dim ServiceLogs As ISServiceLogs
  Dim Success As Boolean
  Dim Workflow As finWorkflow
  Dim WorkflowItem As finWorkflowItem
  Dim WorkflowItemOutcomeItem As finWorkflowItemOutcomeItem

  ' Assume Success
  Success = True

  ' Initialise
  OutcomeList = finBL.Runtime.CreateCodeDescriptionList()
  
  ' Validate
  Success = finBL.HtmlWidgetUtilities.HasPermissionToViewFormKey(FORM_KEY)
  
  ' Validate Workflow details
  If Success Then
    If Len(mWorkflowId) = 0 Then
      Success = False
      finBL.Error.ErrorBegin("Workflow Id not specified.")
    ElseIf mWorkflowItemPk = 0 Then
      Success = False
      finBL.Error.ErrorBegin("Workflow Item Pk not specified.")  
    ElseIf mWorkflowItemPk &lt; -1 Then
      Success = False
      finBL.Error.ErrorBeginFormat("Invalid Workflow Item Pk {0}.", mWorkflowItemPk)
    End If
  End If  

  ' Create Workflow, Item and Workflow Executor objects
  If Success Then
    Success = CreateWorkflow(Workflow, WorkflowItem, Nothing)
  End If

  ' Further Validation
  If Success Then
    If Not WorkflowItem.CanAction(Message) Then
      Success = False
      finBL.Error.ErrorBegin(Message)
    End If
  End If
  
  ' Get Initialisation Info
  If Success Then
    FormInitialisationInfo = New FormInitialisationInfo()
    With FormInitialisationInfo
      ' Read Only?
      If finBL.Database.IsReadOnly OrElse mReadOnly Then
        .ReadOnly = True
      Else
        .ReadOnly = False
      End If
            
      ' Record
      .BankAccountEnquiryReviewPreventActionIfNotAvailable = WorkflowItem.BankAccountEnquiryReviewPreventActionIfNotAvailable
      
      ' Get Client / Applicant
      Select Case Workflow.WorkflowType.TargetObjectType
        Case isefinWorkflowTargetObjectType.Account, isefinWorkflowTargetObjectType.Client
          ' ================
          ' Account / Client
          ' ================
          If GetClient(Workflow, WorkflowItem, Client, ServiceLogs, BankAccountEnquiryResponse) Then
            DecisionCardSourceObject = Client
            .SourceType = "Client"
            .SourceId = Client.ClientId
            .SourceName = Client.Name
          Else 
            Success = False
          End If
          
        Case isefinWorkflowTargetObjectType.AccountApp
          ' ===================
          ' Account Application
          ' ===================
          If GetApplicant(Workflow, WorkflowItem, AccountAppApplicant, ServiceLogs, BankAccountEnquiryResponse) Then
            DecisionCardSourceObject = AccountAppApplicant
            .SourceType = "Applicant"
            .SourceId = AccountAppApplicant.AccountApp.AccountAppId
            .SourceName = String.Format("{0} ({1})", AccountAppApplicant.AccountApp.Name, AccountAppApplicant.Name)
          Else 
            Success = False
          End If          
      End Select
      
      ' Get Information from Service Log
      If Success Then
        If ServiceLogs IsNot Nothing Then
          ServiceLog = ServiceLogs(0)
        End If
        
        If ServiceLog Is Nothing Then
          .HasReport = False
          .RequestDateWarning = "No request found"
        Else 
          .ServiceLogPk = ServiceLog.Pk
          .HasReport = (BankAccountEnquiryResponse IsNot Nothing)
          .RequestDate = finBL.HtmlWidgetUtilities.GetNullableJsonUtcDateTimeFromDatabaseDateTime(ServiceLog.CreatedDate)
          
          If CInt(DateDiff(DateInterval.Day, ServiceLog.CreatedUtcDate, finBL.TimeZoneFunctions.GetCurrentUtcDateTime())) &gt; 7 Then
            .RequestDateWarning = "Requested more than 7 days ago"
          End If
          
          ' Service Log HTML Summary
          Success = finBL.Utilities.GetServiceLogSummaryPageHtml(ServiceLog, .ServiceSummaryHtml)
          
          ' Decision Card          
          If Success AndAlso WorkflowItem.DecisionCardPk &lt;&gt; 0 Then
            .ShowDecisionCard = True

            If finBL.DecisionCards.ExistsPk(WorkflowItem.DecisionCardPk) Then              
              ' Execute
              If GetDecisionOutcome(WorkflowItem, DecisionCardSourceObject, DecisionOutcome) AndAlso DecisionOutcome IsNot Nothing Then
                .DecisionCardSummaryHtml = DecisionOutcome.ToHtmlString(True)
              Else 
                .DecisionCardSummaryHtml = finBL.GetHtmlErrorMessage(finBL.Error.Message(), finBL.Error.Details)
              End If

              ' Default Outcome
              If DecisionOutcome IsNot Nothing Then
                ' Get Outcome
                Select Case DecisionOutcome.OutcomeStatus
                  Case isefinDecisionOutcomeStatus.Pass : .DecisionCardOutcome = "Pass"
                  Case isefinDecisionOutcomeStatus.Fail : .DecisionCardOutcome = "Fail"
                  Case isefinDecisionOutcomeStatus.Refer : .DecisionCardOutcome = "Refer"
                End Select
                DecisionOutcomeCode = DecisionOutcome.OutcomeCode
                
                ' See if there is an outcome that has the format 'Status.ExitRuleCode' and use this
                If Len(DecisionOutcomeCode) &lt;&gt; 0 Then
                  If WorkflowItem.OutcomeItems.ExistsOutcome(.DecisionCardOutcome &amp; "." &amp; DecisionOutcomeCode) Then
                    .DecisionCardOutcome = .DecisionCardOutcome &amp; "." &amp; DecisionOutcomeCode
                  End If
                End If
                
                ' Validate Default Outcome
                If Not WorkflowItem.OutcomeItems.ExistsOutcome(.DecisionCardOutcome) Then
                  .DecisionCardOutcomeError = String.Format("Decision Card '{0}' generated an outcome of '{1}' which is not valid for this Workflow Item.", WorkflowItem.DecisionCardId, .DecisionCardOutcome)
                End If
              End If
            Else 
              .DecisionCardSummaryHtml =  finBL.GetHtmlErrorMessage(String.Format("Decision Card {0} not found.", WorkflowItem.DecisionCardPk))
            End If
          End If
        End If
      End If
      
      ' Configuration

      ' Lists
      For Each WorkflowItemOutcomeItem In WorkflowItem.OutcomeItems
        OutcomeList.Add(WorkflowItemOutcomeItem.Outcome, WorkflowItemOutcomeItem.OutcomeDescriptionResolved)
      Next 
      .OutcomeList = OutcomeList.ToJsonObject()

      ' Other Configuration
      .PromptOnCommit = finBL.CloudConnectFunctions.CloudConnectSettings.PromptOnCommit
    End With
  End If

  ' Response
  If Success Then
    Success = finBL.Runtime.WebUtilities.SerialiseObjectToJsonString(FormInitialisationInfo, response)
  End If

  Return Success

End Function

''' &lt;summary&gt;
'''  Get Applicant.
''' &lt;/summary&gt;
Private Function GetApplicant(workflow As finWorkflow, 
                              workflowItem As finWorkflowItem,
                              ByRef applicant As finAccountAppApplicant,
                              ByRef serviceLogs As ISServiceLogs,
                              ByRef response As ISBankAccountEnquiryResponse) As Boolean                              

  Dim Success As Boolean

  ' Initialise ByRef Parameters
  applicant = Nothing
  serviceLogs = Nothing
  response = Nothing

  ' Assume Success
  Success = True

  ' Get Applicant
  Select Case workflowItem.SourceObjectType
    Case isefinWorkflowItemSourceObjectType.None
      ' Main Applicant
      Applicant = workflow.AccountApp.GetMainApplicant()

    Case isefinWorkflowItemSourceObjectType.AccountAppApplicant
      ' Specified Applicant            
      If workflow.AccountApp.Applicants.ExistsPk(workflowItem.SourceObjectPk) Then
        Applicant = workflow.AccountApp.Applicants.ItemByPk(workflowItem.SourceObjectPk)
      End If
  End Select

  ' Get Service Log and Response
  ' NOTE: We always want to get the latest, regardless of whether it is either 'Complete' or still 'In Progress'
  If Applicant IsNot Nothing Then
    Success = finBL.AccountAppFunctions.GetLatestBankAccountEnquiry(Applicant.AccountApp.Pk, Applicant.Pk, response, ServiceLogs, "", True, False, True)
  Else
    Success = False
    finBL.Error.ErrorBegin("Applicant could not be found.")    
  End If  
  
  Return Success
  
End Function

''' &lt;summary&gt;
'''  Get Client
''' &lt;/summary&gt;
Private Function GetClient(workflow As finWorkflow,
                           workflowItem As finWorkflowItem,
                           ByRef client As finClient,
                           ByRef serviceLogs As ISServiceLogs,
                           ByRef response As ISBankAccountEnquiryResponse) As Boolean
  
  Dim Success As Boolean
  
  ' Initialise ByRef Parameters
  client = Nothing
  serviceLogs = Nothing
  response = Nothing
  
  ' Assume Success
  Success = True
    
  ' Get Client
  Select Case workflow.WorkflowType.TargetObjectType
    Case isefinWorkflowTargetObjectType.Account, isefinWorkflowTargetObjectType.Client
      If workflow.WorkflowType.TargetObjectType = isefinWorkflowTargetObjectType.Account Then
        ' Account Workflow
        Select Case workflowItem.SourceObjectType
          Case isefinWorkflowItemSourceObjectType.None
            ' Main Client
            client = workflow.Account.Clients(0).Client

          Case isefinWorkflowItemSourceObjectType.Client
            ' Specified Client
            If workflow.Account.Clients.ItemByClientId(workflowItem.SourceObjectId) IsNot Nothing Then
              client = workflow.Account.Clients.ItemByClientId(workflowItem.SourceObjectId).Client
            End If
        End Select
      Else
        ' Client Workflow
        client = workflow.Client
      End If
  End Select
  
  ' Get Service Log and Response
  ' NOTE: We always want to get the latest, regardless of whether it is either 'Complete' or still 'In Progress'
  If client IsNot Nothing Then
    Success = client.GetLatestBankAccountEnquiry(serviceLogs, "", 0, response, True)
  Else 
    Success = False
    finBL.Error.ErrorBegin("Client could not be found.")   
  End If
  
  Return Success
  
End Function

''' &lt;summary&gt;
'''  Retrieves a Decision Outcome if a Decision Card is applicable for this Workflow Item.
''' &lt;/summary&gt;
Private Function GetDecisionOutcome(workflowItem As finWorkflowItem,
                                    sourceObject As Object,
                                    ByRef decisionOutcome As finDecisionOutcome) As Boolean
  
  Dim DecisionCardRO As finDecisionCardRO
  Dim Success As Boolean
  
  ' Assume Success
  Success = True
  
  ' Initialise ByRef Parameters
  decisionOutcome = Nothing
  
  ' Get Outcome
  If workflowItem.DecisionCardPk &lt;&gt; 0 AndAlso finBL.DecisionCards.ExistsPk(workflowItem.DecisionCardPk) Then
    DecisionCardRO = finBL.DecisionCards.ItemByPk(workflowItem.DecisionCardPk)
    
    ' Execute
    Success = DecisionCardRO.Execute(sourceObject, decisionOutcome)
  End If
  
  Return Success
  
End Function

''' &lt;summary&gt;
'''  Validate a Wizard page.
''' &lt;/summary&gt;
''' &lt;param name="parametersJson"&gt;
'''  A JSON formatted object containing information required to validate a Wizard page.
''' &lt;/param&gt;
''' &lt;param name="returnValue"&gt;
'''  A JSON object; "true" if validation passed, otherwise, information as to why validation failed.
''' &lt;/param&gt;
Private Function WizardValidate(parametersJson As String,
                                ByRef returnValue As String) As Boolean

  Dim ConfirmList As List(Of String)
  Dim Data As Object
  Dim FailedControlId As String
  Dim FailedMessage As String
  Dim PageId As String
  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Get Parameters
  ' NOTE: Use the module mCombinedParameters since this contains Startup and event Parameters in a single Key/Value List
  With mCombinedParameters
    PageId = .GetString("PageId")
  End With

  ' Validate Page
  Select Case PageId
    Case "General"
      ' General
      If WizardValidate_General(parametersJson, ConfirmList) Then
        Data = ConfirmList
      Else
        Success = False
      End If
  End Select

  ' Finalise
  If Success Then
    Success = finBL.Runtime.WebUtilities.SerialiseObjectToJsonString(New WizardValidateResponse(Data, FailedMessage, FailedControlId), returnValue)
  End If

  Return Success

End Function

Private Function WizardValidate_General(parametersJson As String,
                                        ByRef confirmList As List(Of String)) As Boolean

  Dim Success As Boolean

  ' Assume Success
  Success = True

  ' Initialise ByRef
  confirmList = New List(Of String)()

  Return Success

End Function

''' &lt;summary&gt;
'''  Wizard Initialisation Information.
''' &lt;/summary&gt;
Public Class FormInitialisationInfo

  ' Record
  Public BankAccountEnquiryReviewPreventActionIfNotAvailable As Boolean
  Public DecisionCardOutcome As String
  Public DecisionCardOutcomeError As String
  Public DecisionCardSummaryHtml As String
  Public HasReport As Boolean
  Public IsNew As Boolean
  Public RequestDate As Date?
  Public RequestDateWarning As String
  Public ServiceSummaryHtml As String
  Public ShowDecisionCard As Boolean
  Public SourceId As String
  Public SourceName As String
  Public SourceType As String
  Public Timestamp As Integer
  Public ServiceLogPk As Integer
  
  ' Lists
  Public OutcomeList As List(Of ISCodeDescriptionList.ISJsonCodeDescriptionListItem)

  ' Configuration
  Public PromptOnCommit As Boolean
  Public [ReadOnly] As Boolean

End Class

''' &lt;summary&gt;
'''  Validation details.
''' &lt;/summary&gt;
Public Class WizardValidateResponse

  Public Data As Object
  Public FailedControlId As String
  Public FailedMessage As String

  Public Sub New(data As Object,
                 failedMessage As String,
                 failedControlId As String)

    Me.Data = data
    Me.FailedMessage = failedMessage
    Me.FailedControlId = failedControlId

  End Sub

End Class

''' &lt;summary&gt;
'''  Finish Parameters.
''' &lt;/summary&gt;
Public Class WizardFinishParameters

  Public Outcome As String
  Public Notes As String

End Class

''' &lt;summary&gt;
'''  Finish details.
''' &lt;/summary&gt;
Public Class WizardFinishDetails

  Public Warning As String
  
  Public Sub New(warning As String)
    
    Me.Warning = warning
    
  End Sub
  
End Class</Code>
    <Language>VisualBasic</Language>
    <Notes>System defined HTML Widget.

Used as a finPOWER Connect Cloud compatible method of reviewing Bank Account Enquiries.</Notes>
    <PermissionKeyExecute />
    <RunWithoutPrompts>false</RunWithoutPrompts>
    <TemplateText>&lt;div id="frmMain" class="is-widget-content" style="visibility:hidden"&gt;

  &lt;!-- Form Header --&gt;
  &lt;header&gt;
    &lt;div class="header"&gt;&lt;/div&gt;
    &lt;div class="summary"&gt;&lt;/div&gt;
    &lt;!-- Tabs --&gt;
    &lt;div id="tabWizard" class="is-tabs"&gt;
      &lt;ul&gt;
        &lt;li tabId="General" tooltipText="Review Bank Account Enquiry and action this Workflow Item."&gt;Review Bank Account Enquiry Workflow Item&lt;/li&gt;
        &lt;li tabId="Notes" tooltipText="Enter any notes you wish to record."&gt;Notes&lt;/li&gt;
      &lt;ul&gt;
    &lt;/div&gt;
  &lt;/header&gt;

  &lt;!-- Pages --&gt;
  &lt;div class="is-widget-form-body"&gt;
    &lt;!-- General --&gt;
    &lt;div id="pageGeneral" style="display:flex;flex-direction:column;"&gt;
      &lt;div style="display:flex;flex-direction:column;flex-grow:1;"&gt;
        &lt;div&gt;
          &lt;table class="is-form"&gt;
            &lt;colgroup&gt;
              &lt;col style="width:9em" /&gt;
              &lt;col /&gt;
            &lt;/colgroup&gt;
    
            &lt;tr&gt;
              &lt;th colspan="2"&gt;&lt;label id="lblBankAccountEnquiry"&gt;Bank Account Enquiry&lt;/label&gt;&lt;/th&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;th&gt;&lt;label for="cboRecord"&gt;Record Id:&lt;/label&gt;&lt;/th&gt;
              &lt;td&gt;&lt;input id="cboRecord" /&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;th&gt;&lt;label for="dateEnquiry"&gt;Enquiry Date:&lt;/label&gt;&lt;/th&gt;
              &lt;td&gt;
                &lt;input id="dateEnquiry" /&gt;
                &lt;button id="cmdOpenServiceLog" class="is-button small"&gt;Open Service Log&lt;/button&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;th colspan="2"&gt;&lt;div id="divEnquiryDateWarning" class="is-info-text info warning small" style="display:none"&gt;&lt;/div&gt;&lt;/th&gt;
            &lt;/tr&gt;
          &lt;/table&gt;
        &lt;/div&gt;
        &lt;div style="flex-grow:1"&gt;
          &lt;div id="wbSummary" style="height:100%"&gt;&lt;/div&gt;          
        &lt;/div&gt;        
      &lt;/div&gt;
    
      &lt;div id="divDecisionCard" style="display:flex;flex-direction:column;flex-grow:1;padding-top:8px;"&gt;
        &lt;div&gt;
          &lt;table class="is-form"&gt;
            &lt;colgroup&gt;
              &lt;col style="width:9em" /&gt;
              &lt;col /&gt;
            &lt;/colgroup&gt;
    
            &lt;tr&gt;
              &lt;th colspan="2"&gt;&lt;label id="lblDecisionCardOutcome"&gt;Decision Card Outcome&lt;/label&gt;&lt;/th&gt;
            &lt;/tr&gt;
          &lt;/table&gt;
        &lt;/div&gt;
        &lt;div style="flex-grow:1"&gt;
          &lt;div id="wbDecisionCardOutcome" style="height:100%"&gt;&lt;/div&gt;
        &lt;/div&gt;        
      &lt;/div&gt;
    
      &lt;div style="padding-top:8px;"&gt;
        &lt;table class="is-form"&gt;
          &lt;colgroup&gt;
            &lt;col style="width:9em" /&gt;
            &lt;col /&gt;
          &lt;/colgroup&gt;
                          
          &lt;tr&gt;
            &lt;th colspan="2"&gt;&lt;label id="lblOutcome"&gt;Select the Outcome&lt;/label&gt;&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt;&lt;label for="cboOutcome"&gt;Outcome:&lt;/label&gt;&lt;/th&gt;
            &lt;td&gt;&lt;input id="cboOutcome" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th colspan="2"&gt;&lt;div id="divOutcomeWarning" class="is-info-text info warning small" style="display:none"&gt;No Bank Enquiry Report available&lt;/div&gt;&lt;/th&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
      &lt;/div&gt;      
    &lt;/div&gt;
    
    &lt;!-- Notes --&gt;
    &lt;div id="pageNotes" style="display:flex;flex-direction:column;height:100%"&gt;
      &lt;div&gt;
        &lt;table class="is-form"&gt;
          &lt;colgroup&gt;
            &lt;col /&gt;
          &lt;/colgroup&gt;
  
          &lt;tr&gt;
            &lt;th&gt;&lt;label id="lblNotes"&gt;Enter any notes&lt;/label&gt;&lt;/th&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
      &lt;/div&gt;      
      &lt;div style="flex-grow:1"&gt;
        &lt;input id="txtNotes" /&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;

  &lt;!-- Form Footer --&gt;
  &lt;footer&gt;
    &lt;button id="cmdCancel" class="is-button"&gt;Cancel&lt;/button&gt;
    &lt;button id="cmdBack" class="is-button"&gt;&amp;lt; Back&lt;/button&gt;
    &lt;button id="cmdNext" class="is-button"&gt;Next &amp;gt;&lt;/button&gt;
    &lt;button id="cmdFinish" class="is-button ok"&gt;Finish&lt;/button&gt;
  &lt;/footer&gt;

&lt;/div&gt;

&lt;script&gt;
// Properties
var mRecord;

// Controls
var C = {
  //   General
  lblBankAccountEnquiry: null,
  cboRecord: null,
  dateEnquiry: null,
  divEnquiryDateWarning: null,
  wbSummary: null,
  
  divDecisionCard: null,
  lblDecisionCardOutcome: null,
  wbDecisionCardOutcome: null,
  
  lblOutcome: null,
  cboOutcome: null,
  divOutcomeWarning: null,
  
  //   Notes
  lblNotes: null,
  txtNotes: null,
}

// Form
var frmMain;
var tabWizard;

// Wizard Buttons
var cmdCancel;
var cmdBack;
var cmdNext;
var cmdFinish;

var cmdOpenServiceLog;

// ==========
// Initialise
// ==========
$(function () {
  // Mobile optimisations
  var currencyWidth = "20em";
  $(window).resize(Form_Resize);

  // --------
  // Controls
  // --------
  //   General
  C.lblBankAccountEnquiry = widget.UI.Label("lblBankAccountEnquiry", {});
  C.cboRecord = widget.UI.DBCombo("cboRecord", {
    readOnly: true,
    showDropdown: false,
  });
  C.dateEnquiry = widget.UI.DateBox("dateEnquiry", {
    readOnly: true,
  });
  C.divEnquiryDateWarning = $("#divEnquiryDateWarning");
  C.wbSummary = widget.UI.PreviewPane("wbSummary", {});
  
  C.divDecisionCard = $("#divDecisionCard");
  C.lblDecisionCardOutcome = widget.UI.Label("lblDecisionCardOutcome", {});
  C.wbDecisionCardOutcome = widget.UI.PreviewPane("wbDecisionCardOutcome", {});
  
  C.lblOutcome = widget.UI.Label("lblOutcome", {});
  C.cboOutcome = widget.UI.DBCombo("cboOutcome", {
    allowBlank: false,
  });
  C.divOutcomeWarning = $("#divOutcomeWarning");

  //   Notes
  C.lblNotes = widget.UI.Label("lblNotes", {});
  C.txtNotes = widget.UI.TextBox("txtNotes", {
    maxLength: 32767,
    multiLine: true,
    rows: 10,    
  });
  C.txtNotes.Element().parent().css("height", "100%");

  // Create Widget form
  // NOTE: Hide by default for a cleaner startup
  frmMain = new widget.UI.Form("frmMain", { captionWidth: "9em", textboxWidth: "20em", visible: false });

  // Create Tabs
  tabWizard = new widget.UI.Tabs("tabWizard", { style: "wizard" });

  // Notification Handler
  widget.ActionNotificationHandle(Widget_NotificationHandler)

  // Handle Wizard Buttons
  cmdCancel = $("#cmdCancel");
  cmdBack = $("#cmdBack");
  cmdNext = $("#cmdNext");
  cmdFinish = $("#cmdFinish");
  cmdCancel.click(tabWizard_Cancel);
  cmdBack.click(function() { tabWizard_Move(-1); });
  cmdNext.click(function() { tabWizard_Move(1); });
  cmdFinish.click(function() { Form_ExecuteAction("Finish"); });

  cmdOpenServiceLog = $("#cmdOpenServiceLog");
  cmdOpenServiceLog.click(function() { Form_ExecuteAction("OpenServiceLog"); });

  // Reset
  Form_Reset();
});

// ==========
// Reset Form
// ==========
function Form_Reset() {
  // Defaults

  // Set Tab
  tabWizard.SelectedTabId("General");

  // Resize
  Form_Resize();

  // Load Record (i.e., initialise wizard)
  Record_Load();
}

// ===========
// Load Record
// ===========
function Record_Load() {
  // Initialise
  mRecord = null;

  // Hide content
  frmMain.Visible(false);

  // Block UI
  widget.UI.Block("Initialising, please wait...");

  // Load Initialisation details
  widget.GetString("GetInitialisationInfo", {},
    // Success
    function (data) {
      mRecord = JSON.parse(data);
      Fields_Load();
    },

    // Fail
    function (message) {
      // Unblock
      widget.UI.Unblock();
    
      // Close Widget if an initialisation error occurs
      widget.UI.MsgBoxAlert("fail: " + message, {}, tabWizard_Cancel);
    }
  );
}

// ===========
// Load Fields
// ===========
function Fields_Load() {
  if (mRecord) {
    //   General
    C.cboRecord.RefreshUnbound(mRecord.SourceId, mRecord.SourceName);
    C.dateEnquiry.Value(mRecord.RequestDate);
    
    if (mRecord.ServiceSummaryHtml) {
      C.wbSummary.SetContent(mRecord.ServiceSummaryHtml, true);
    }    
    
    if (mRecord.ShowDecisionCard) {
      C.wbDecisionCardOutcome.SetContent(mRecord.DecisionCardSummaryHtml, true);
    }
    
    C.cboOutcome.Text(mRecord.DecisionCardOutcome);
  }

  // Unblock UI
  widget.UI.Unblock();

  // Update fields
  Fields_Update();

  // Refresh Tab
  tabWizard_Refresh();
}

// ===========
// Save Fields
// ===========
function Fields_Save() {
  // Not used by this wizard since there is no concept of updating an object behind the wizard
}

// =============
// Update Fields
// =============
function Fields_Update() {
  // Lists
  if (mRecord) {
    C.cboOutcome.RefreshFromCollection(mRecord.OutcomeList, "Code", "Description");
  }

  // Controls
  if (mRecord) {
    //   General
    C.cboRecord.Caption(mRecord.SourceType + ":");
    
    // Request Date Warning
    if (mRecord.RequestDateWarning) {
      C.divEnquiryDateWarning.html(mRecord.RequestDateWarning);
      C.divEnquiryDateWarning.show();
    }
    else {
      C.divEnquiryDateWarning.hide();
    }
    
    // Option to open Service Log
    if (mRecord.ServiceLogPk &amp;&amp; mRecord.ServiceLogPk != 0) {
      cmdOpenServiceLog.show();
    }
    else {
      cmdOpenServiceLog.hide();
    }
    
    // Show Decision Card
    if (mRecord.ShowDecisionCard) {
      C.divDecisionCard.show();
    }
    else {
      C.divDecisionCard.hide();
    }
    
    // Outcome
    if (mRecord.BankAccountEnquiryReviewPreventActionIfNotAvailable) {
      if (mRecord.HasReport) { 
        C.cboOutcome.ReadOnly(false);
        C.divOutcomeWarning.hide();
      }
      else {
        C.cboOutcome.ReadOnly(true);
        C.divOutcomeWarning.show();
      }
    } 
  }

  // Check for Advanced options
  if (mRecord) {
  }

  // Update Buttons
  tabWizard_UpdateButtons();

  // Read-Only?
  if (mRecord &amp;&amp; mRecord.ReadOnly) frmMain.FormReadOnly(C, true);

  // Show content
  frmMain.Visible(mRecord != null);

  // Show History
  if (mRecord) {
  }

  // Resize Tab
  tabWizard_Resize();
}

// ===========
// Resize Form
// ===========
function Form_Resize() {
  // General

  // Tab
  tabWizard_Resize();
}

// ==============
// Wizard Buttons
// ==============
function tabWizard_Cancel() {
  if (widget.CanClose()) {
    widget.Close();
  }
  else {
    widget.Reset();
  }
}

function tabWizard_UpdateButtons() {
  // Back and Next Buttons?
  if (tabWizard.TabCount() == 1) {
    cmdBack.hide();
    cmdNext.hide();
  }
  else {
    var tabIndex = tabWizard.SelectedTabIndex();
    cmdBack.prop("disabled", tabIndex &lt;= 0);
    cmdNext.prop("disabled", tabIndex &gt;= tabWizard.TabCount() - 1);
  }

  // Cancel/ Finish Button
  if (mRecord &amp;&amp; mRecord.ReadOnly) {
    cmdCancel.hide();
    cmdFinish.text("Close");
  }
  else {
    if (mRecord.BankAccountEnquiryReviewPreventActionIfNotAvailable) {
      cmdFinish.prop("disabled", !mRecord.HasReport);
      if (!mRecord.HasReport) cmdNext.prop("disabled", true);
    }
    else {
      cmdFinish.prop("disabled", false);
    }    
  }
}

// ==========
// Resize Tab
// ==========
function tabWizard_Resize() {
  switch (tabWizard.SelectedTabId()) {
    case "Notes":
      C.txtNotes.WidthResizeFromParent();
      break;
      
    default:
      break;
  }
}

// ===========
// Wizard Move
// ===========
function tabWizard_Move(direction) {
  var Ok;

  // Validate
  if (direction &gt; 0) {
    tabWizard_Validate(function () { tabWizard_MovePost(direction); });
  }
  else {
    // Can always move backwards
    tabWizard_MovePost(direction);
  }
}

function tabWizard_MovePost(direction) {
  var Ok = true;

  // Find Next Tab to Move To
  if (Ok) {
    var found = false;
    var newTab = tabWizard.SelectedTabIndex();

    do {
      newTab += direction;

      switch (tabWizard.GetTabIdByIndex(newTab)) {
        default:
          found = true;
          break;
      }

      // Found?
      if (found) {
        break;
      }
      else if (newTab == tabWizard.TabCount() - 1) {
        // Just in case!
        widget.UI.MsgBoxAlert("tabWizard_MovePost: Tab not handled!");
        break;
      }
    }
    while (true);

    // Refresh the New Tab
    tabWizard_Refresh(newTab);
  }
}

// ===========
// Refresh Tab
// ===========
function tabWizard_Refresh(newTab) {
  // Moving forward onto tab, so Load information
  if (newTab &gt;= tabWizard.SelectedTabIndex()) {
    switch (tabWizard.GetTabIdByIndex(newTab)) {
      default:
        break;
    }
  }

  // Make Tab it
  tabWizard.SelectedTabIndex(newTab);

  // Special
  switch(tabWizard.SelectedTabId()) {
  }

  // Tweak fields

  // Update Heading
  tabWizard_Refresh_UpdateHeading();

  // Back, Next command buttons valid?
  tabWizard_UpdateButtons();

  // Resize Wizard
  tabWizard_Resize();

  // Focus
  switch (tabWizard.SelectedTabId()) {
    default:
      tabWizard.FocusFirst();
      break;
  }
}

function tabWizard_Refresh_UpdateHeading() {
  switch (tabWizard.SelectedTabId()) {
    default:
      frmMain.RefreshHeading(tabWizard.TabCaption(tabWizard.SelectedTabId()), tabWizard.TabTooltipText(tabWizard.SelectedTabId()));
      break;
  }
}

// ===============
// Validate Wizard
// ===============
function tabWizard_Validate(validCallback) {
  // Read-Only
  if (mRecord.ReadOnly) {
    // No validation because form is Read Only
    validCallback();
    return;
  }

  // Validate
  var Ok = tabWizard.Validate(true);

  // Other client-side validation
  if (Ok) {
    switch (tabWizard.SelectedTabId()) {
      case "General":
        // Server side validation required
        break;

      default:
        // No validation
        validCallback();
        return;
    }
  }

  // Server-side validation
  if (Ok) {
    var params;

    switch (tabWizard.SelectedTabId()) {
      case "General":
        params = CreateFinishParameters();
        break;
    }

    if (params) {
      // Disable Form
      frmMain.FormDisable("Validating");

      // Extend parameters
      params.pageId = tabWizard.SelectedTabId();

      // Call WizardValidate method in Script
      widget.GetString("WizardValidate",
                       params,
                       function (data) { tabWizard_ValidatePost(validCallback, data); },
                       tabWizard_ValidateFail);
    }
    else {
      // No server-side validation
      validCallback();
    }
  }
}

function tabWizard_ValidatePost(validCallback, data) {
  // Enable form
  frmMain.FormEnable();

  // Parse Data
  var o = {};
  if (data) o = JSON.parse(data);

  if (o.FailedMessage) {
    // -----------------
    // Validation failed
    // -----------------
    var o = JSON.parse(data);
    widget.UI.MsgBoxAlert(o.FailedMessage);
    if (o.FailedControlId) $("#" + o.FailedControlId).focus();
  }
  else {
    // ---------------------
    // Validation successful
    // ---------------------
    // Validation could pass back additional information, e.g., to use in tabWizard_Refresh
    switch (tabWizard.SelectedTabId()) {
      case "General":
        // General
        if (o.Data &amp;&amp; o.Data.length != 0) {
          // Confirm warnings
          widget.UI.MsgBoxConfirmList("To continue, please approve the following:",
                                      o.Data,
                                      {
                                        heading: "Additional Confirmation",
                                        icon: "Warning",
                                      },
                                      function () { validCallback(); },
                                      null);

          // Allow callbacks to continue
          return;
        };

        break;
    }

    // Callback
    validCallback();
  }
}

function tabWizard_ValidateFail(errorMessage)
{
  widget.UI.MsgBoxAlert(errorMessage);

  // Enable form
  frmMain.FormEnable();
}

// =================
// Execute an Action
// =================
function Form_ExecuteAction(actionId) {
  switch (actionId.toUpperCase()) {
    case "FINISH":
      // Finish
      if (mRecord.ReadOnly) {
        tabWizard_Cancel();
      }
      else {
        Form_ExecuteAction_Finish();
      }
      break;

    case "OPENSERVICELOG":
      Form_ExecuteAction_OpenServiceLog();
      break;

    default:
      window.alert(mViewName + ".Form_ExecuteAction: Unhandled action '" + actionId + "'");
      break;
  }
}

// =============
// Finish Action
// =============
function Form_ExecuteAction_Finish() {
  // Validate
  tabWizard_Validate(function () {
    if (mRecord.PromptOnCommit) {
      // Confirm
      var heading = "Complete Workflow Item?";
      if (C.cboOutcome.Text() == C.cboOutcome.GetDescription()) {
        var message = "Complete this Workflow Item and set the outcome to " + C.cboOutcome.Text() + "?";
      }
      else {
        var message = "Complete this Workflow Item and set the outcome to " + C.cboOutcome.Text() + ", '" + C.cboOutcome.GetDescription() + "'?";
      }
      
      widget.UI.MsgBoxConfirm(message,
                              {heading: heading},
                              Form_ExecuteAction_FinishPost,
                              null);
    }
    else {
      // Commit without prompting
      Form_ExecuteAction_FinishPost();
    }
  });
}

function Form_ExecuteAction_FinishPost(moveAction) {
  // Disable Form
  widget.UI.Block("Committing, please wait...");

  // Create Parameters
  var params = CreateFinishParameters();

  // Move?
  if (moveAction) {
    params.MoveAction = moveAction;
  }

  // Finish
  widget.GetString("Finish", params,
    function (data) {
      data = JSON.parse(data);

      // Finalise
      if (data.Warning) {
        widget.UI.MsgBoxAlert(data.Warning, {}, function() { Form_ExecuteAction_FinishPost_Finalise(data); });
      }
      else {
        Form_ExecuteAction_FinishPost_Finalise(data);
      }
    },

    function (data) {
      // Show Error
      widget.UI.MsgBoxAlert(data);

      // Enable Form
      widget.UI.Unblock();
    }
  );
}

function Form_ExecuteAction_FinishPost_Finalise(data) {
  // Close Form
  widget.Close();

  // Refresh Parent (to show updated details)
  widget.RefreshParent();
}

// =======================
// Open Service Log Action
// =======================
function Form_ExecuteAction_OpenServiceLog() {
  if (mRecord.ServiceLogPk &amp;&amp; mRecord.ServiceLogPk != 0) {
    widget.ExecuteApplicationShortcutUrl("app://FormShow?form=ServiceLog&amp;id=" + mRecord.ServiceLogPk);
  }
  else {
    widget.UI.MsgBoxAlert("No Service Log to open.");
  }
}

function CreateFinishParameters() {
  // Create Parameters
  var params = {
    outcome: C.cboOutcome.Text(),
    notes: C.txtNotes.Text()
  };

  return params;
}

// ====================
// Notification Handler
// ====================
function Widget_NotificationHandler(actionId, data) {
  switch(actionId) {
    case "BankAccountEnquiry.Refresh":
      // Reload page
      Form_Reset();
   }
}
&lt;/script&gt;</TemplateText>
    <TemplateTextBookmarks />
    <TimeoutSeconds>60</TimeoutSeconds>
    <UniqueId>rdURc6ILpEWxqb84SPEVhQ</UniqueId>
    <AllowRefresh>true</AllowRefresh>
    <Caption />
    <HtmlWidgetMaxHeight>1200</HtmlWidgetMaxHeight>
    <HtmlWidgetMaxWidth>800</HtmlWidgetMaxWidth>
    <HtmlWidgetNeverApplyStyling>false</HtmlWidgetNeverApplyStyling>
    <HtmlWidgetResourceChartsApex>false</HtmlWidgetResourceChartsApex>
    <HtmlWidgetResourceCssSummaryPage2>false</HtmlWidgetResourceCssSummaryPage2>
    <HtmlWidgetResourceCssWidget>true</HtmlWidgetResourceCssWidget>
    <HtmlWidgetResourceJQuery>true</HtmlWidgetResourceJQuery>
    <HtmlWidgetResourceJQueryVersion />
    <HtmlWidgetSpecialEventGetFolderCount>false</HtmlWidgetSpecialEventGetFolderCount>
    <Icon />
    <RestrictedOriginsListEnabled>false</RestrictedOriginsListEnabled>
    <RunAsAdministrator>false</RunAsAdministrator>
    <WebServiceName />
    <WebServiceAllowAnonymous>false</WebServiceAllowAnonymous>
    <WebServiceSendDebugInformation>false</WebServiceSendDebugInformation>
    <ShowInMenu>None</ShowInMenu>
    <ParametersType>Custom</ParametersType>
    <Parameters>
      <ISParameterDefs version="1.00">
        <Parameters>
          <Parameter name="" type="SectionStart">
            <BlankTip />
            <Caption>Form options.</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText>If you do not specify a Default Transaction Type, the Transaction Type selection will be shown regardless of the settings specified below.</TooltipText>
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="ReadOnly" type="Boolean">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value>False</Value>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="" type="SectionStart">
            <BlankTip />
            <Caption>TESTING</Caption>
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText>These are the Parameters required by this HTML Widget to function correctly.
They are listed here for testing purposes only.</TooltipText>
            <SectionColumns>1</SectionColumns>
            <Visible>true</Visible>
          </Parameter>
          <Parameter name="WorkflowId" type="List">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <List>RANGE.Workflows</List>
            <LimitToList>false</LimitToList>
            <MaxLength>0</MaxLength>
            <Rows>1</Rows>
          </Parameter>
          <Parameter name="WorkflowItemPk" type="Number">
            <BlankTip />
            <Caption />
            <StandaloneOnly>false</StandaloneOnly>
            <TooltipText />
            <DefaultValueExpression />
            <Enabled>true</Enabled>
            <HideDescription>false</HideDescription>
            <IndentLevel>0</IndentLevel>
            <Mandatory>false</Mandatory>
            <NonPersistable>false</NonPersistable>
            <ReadOnly>false</ReadOnly>
            <ReadOnly2>false</ReadOnly2>
            <Value />
            <Visible>true</Visible>
            <DecimalPlaces>0</DecimalPlaces>
            <GroupDigits>false</GroupDigits>
            <MaxValue />
            <MinValue />
            <NumberSpecialType>None</NumberSpecialType>
            <SpinChange>1</SpinChange>
          </Parameter>
        </Parameters>
      </ISParameterDefs>
    </Parameters>
  </finScript>