# exec-mig-data

set-strictmode -version 2.0

function defineFlowTask([Flow]$flow,[Task]$task) {
#--- define
  $def = new-module -asCustomObject -scriptBlock {

    function getTaskDesc([Task]$task) {
      return "Generate Data Models";
    }

    function fetchJavaMain([Object]$task,[hashtable]$parms) {
      return 'org.citc.mig.Migrate'
    }

    function fetchJavaClassStr([Object]$task,[hashtable]$parms) {
      $tfs = $task.tfs;
      $cgb = $tfs.globMap.citGlobs;
      return $cgb.getLegacyPath($task,$parms);
      ##return '$env:PSEC_V4_UTILS/srp-util/lib;$env:PSEC_V4_UTILS/srp-util/java-gen-prod/production/srp-util;$env:PSEC_V4_UTILS/citc/java-gen-prod;$env:PSEC_V4_UTILS/citc/lib;$env:PSEC_V4_UTILS/citc/lib-leg;$env:PSEC_V4_UTILS/gael-core/out-lib;$env:PSEC_V4_UTILS/gael-core/lib;$env:PSEC_V4_UTILS/gael-citv3/war/WEB-INF/lib;$env:PSEC_V4_UTILS/gael-core/libaux;'
    }

    # ---------- define task parameters
    function params([Object]$task,[hashtable]$htOpts) {
      $tfs = $task.tfs
      $gfn  = $tfs.globMap.citGlobs.gfn
      $parms = $htOpts.clone();
      $parms.brief     = "$($task.statlocn)"
      $parms.debout    = "d:\1\v3-mig-out"

      $parms.outdir    = "d:/data/citc/fin$($tfs.globMap.citGlobs.year)"
      $parms.inpdir    = "d:/data/citc/besu/prod-fin/citc.people"
      $parms.namespace = "cit";
      $parms.migtask   = "org.citc.mig.MigPeople";

      $parms.url       = $gfn.devpUrl;
      $parms.tok       = $gfn.devpTok;

      $task.defLogWid = 1200
      return  $parms
    }

    # ---------- define task options
    function options {
      param([Object]$task)
      $opts = @();
      $opts += @{type='check';  parm='prod';       label='Prod';        place='Applied to prod server when checked'}
      $opts += @{type='check';  parm='apply'; label='Apply'; place='Apply to server'}
      return  ,$opts
    }
    Export-ModuleMember -Variable * -Function *
  }
  return $def;
}





X
PSEC - Powershell Enhanced Capability
1.2.1
  src: psec-snippets-cloned-parms-example-cloned-parms-example-def.psm1

Copyright © 2018-2021, 2022, Rexcel System Inc.