Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Job dependencies are designed along a Directed acyclic graph (DAG). This includes a few rules for input to the Excel® spreadsheet:
    • One or more initial jobs are required as the graph's root. Initial jobs must not be specified as successors in the SuccessorID column.
    • One final job has to be specified that does not indicate successor jobs in the SuccessorID column.
  • In a simplified way this works with two columns:
    • The NodeID column specifies the unique identifier of the given job.
    • The SuccessorID column specifies one or more NodeIDs of successor jobs that are separated by a space.
      • If more than one NodeID is specified then this will fork processing of successor jobs to be performed in parallel.
      • Forking can include any number of branches in 
  • x

Run the PowerShell Cmdlet

...

Code Block
languagepowershell
titleExample for use of PowerShell cmdlet for Windows
linenumberstrue
./New-JS7WorkflowFromExcel.ps1 -ExcelPath "C:\js7\excel\input\jobs.xlsx" -OutputDirectory "C:\js7\excel\output\jobs"

...

Code Block
languagepowershell
titleExample for use of PowerShell cmdlet for Linux
linenumberstrue
./New-JS7WorkflowFromExcel.ps1 `
    -ExcelPath /home/sos/excel/input/jobs.xlsx `
    -WorksheetName Workflow01 `
    -WorksheetColumns @{ 'nodeid' = 'NodeID'; 'successorid' = 'SuccessorID'; 'instruction' = 'Instruction'; 'name' = 'Name'; 'description' = 'Description'; 'agent' = 'Agent'; 'subagentCluster' = 'Subagent Cluster'; 'script' = 'Script'; 'errorHandling' = 'Error Handling'; 'failOnStderr' = 'Fail on stderr' } `
    -OutputDirectory /home/sos/excel/output/jobs `
    -WorkflowName EOD-Workflow `
    -Title "EOD Processing" `
    -AgentName primaryAgent


Explanation:

  • The -WorksheetName parameter is used to limit creation of workflows to the given worksheet within the Excel® spreadsheet file.
  • The call to the PowerShell cmdlet specifies the -WorksheetColumns parameter that holds a hashtable for the mapping of internal names and column names in the given spreadsheet file. This allows to use different column names in a spreadsheet file that will be mapped to internal names. Any additional columns in a spreadsheet are ignored.
  • The -WorkflowName parameter specifies the name of the workflow. If this parameter is omitted then the workflow name will be used from the name of the worksheet.
  • The -Title parameter specifies the title that will be assigned the workflow.
  • The -AgentName parameter specifies the name of the Agent that will be assigned to jobs for which the Excel® spreadsheet file does not specify a value in the related column.

Create Workflows from a number of Excel® Spreadsheet Files

...

Code Block
languagepowershell
titleExample for use of PowerShell cmdlet for Linux
linenumberstrue
Get-ChildItem *.xlsx | Foreach-Object { ./New-JS7WorkflowFromExcel.ps1 `
    -ExcelPath $_.FullName `
    -Title $_.BaseName `
    -OutputDirectory /home/sos/excel/output/jobs }
}


Explanation:

  • The Get-ChildItem Cmdlet will select any Excel® spreadsheet files in the current directory. Each Excel® file is pipelined to the PowerShell Cmdlet.
  • This allows to create workflows from a larger number of Excel® spreadsheet files in a bulk operation.

Further Resources

...