Skip to content

Commit

Permalink
Merge pull request #2 from Akaizoku/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Akaizoku authored Feb 26, 2020
2 parents 4269110 + abd6b23 commit df209cf
Show file tree
Hide file tree
Showing 4 changed files with 408 additions and 6 deletions.
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Changelog
All notable changes to the [PSRP](https://github.com/Akaizoku/PSRP) project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1](https://github.com/Akaizoku/PSRP/releases/tag/1.0.1) - 2020-02-26

Update

### Added

The following function has been added:
- Start-ContractSelection

The following file has been added:
- CHANGELOG

### Changed

The following files have been updated:
- README

## [1.0.0](https://github.com/Akaizoku/PSRP/releases/tag/1.0.0) - 2020-02-21

### Added

The following functions have been added:
- Backup-Schema
- Get-ModelID
- Get-JavaClass
- Get-RiskProBatchResult
- Get-SolveID
- Grant-Role
- Invoke-CreateModel
- Invoke-CreateModelGroup
- Invoke-CreateUser
- Invoke-CreateUserGroup
- Invoke-DeleteModel
- Invoke-DeleteModelGroup
- Invoke-DeleteUser
- Invoke-List
- Invoke-MakeDir
- Invoke-MigratorTool
- Invoke-ModifyModel
- Invoke-ModifyModelGroup
- Invoke-ModifyUser
- Invoke-RiskProANTClient
- Invoke-RiskProBatchClient
- Invoke-Upload
- Restore-Schema
- Set-UserPassword
- Start-CleanRollupSolve
- Start-ExportToExcel
- Start-ImportXML
- Start-Maintenance
- Start-RollupSolve
- Start-Solve
- Test-MigratorToolOutcome
- Test-Model
- Test-RiskProBatchClientOutcome
- Test-Solve
- Unlock-User
- Write-MigratorToolCmd
- Write-RiskProANTCmd
- Write-RiskProBatchClientCmd

The following files have been added:
- LICENSE
- README
43 changes: 39 additions & 4 deletions PSRP.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSRP.psm1'

# Version number of this module.
ModuleVersion = '1.0.0'
ModuleVersion = '1.0.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -69,7 +69,42 @@ PowerShellVersion = '3.0'
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = '*'
FunctionsToExport = @(
"Backup-Schema",
"Get-ModelID",
"Get-RiskProBatchResult",
"Get-SolveID",
"Grant-Role",
"Invoke-CreateModel",
"Invoke-CreateModelGroup",
"Invoke-CreateUser",
"Invoke-CreateUserGroup",
"Invoke-DeleteModel",
"Invoke-DeleteModelGroup",
"Invoke-DeleteUser",
"Invoke-List",
"Invoke-MakeDir",
"Invoke-MigratorTool",
"Invoke-ModifyModel",
"Invoke-ModifyModelGroup",
"Invoke-ModifyUser",
"Invoke-RiskProANTClient",
"Invoke-RiskProBatchClient",
"Invoke-Upload",
"Restore-Schema",
"Set-UserPassword",
"Start-CleanRollupSolve",
"Start-ExportToExcel",
"Start-ImportXML",
"Start-Maintenance",
"Start-RollupSolve",
"Start-Solve",
"Test-MigratorToolOutcome",
"Test-Model",
"Test-RiskProBatchClientOutcome",
"Test-Solve",
"Unlock-User"
)

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
Expand Down Expand Up @@ -108,8 +143,8 @@ PrivateData = @{

# ReleaseNotes of this module
ReleaseNotes = @'
[1.0.0]
Framework for basic administration functions.
[1.0.1]
Add contract selection function and change log
'@

} # End of PSData hashtable
Expand Down
258 changes: 258 additions & 0 deletions Public/Start-ContractSelection.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
function Start-ContractSelection {
<#
.SYNOPSIS
Start contract selection
.DESCRIPTION
Wrapper function to start the contract selection process using the RiskPro batch client
.PARAMETER JavaPath
The optional java path parameter corresponds to the path to the Java executable file. If not specified, please ensure that the path contains the Java home.
.PARAMETER RiskProBatchClient
The RiskPro batch client parameter corresponds to the path to the RiskPro batch client JAR file.
.PARAMETER ServerURI
The server URI parameter corresponds to the Uniform Resource Identifier (URI) of the RiskPro server.
.PARAMETER Credentials
The credentials parameter corresponds to the credentials of the RiskPro account to use for the operation.
.PARAMETER JavaOptions
The optional Java options parameter corresponds to the additional Java options to pass to the Java client.
.PARAMETER ModelName
The model name parameter corresponds to the name of the model.
.PARAMETER ResultSelectionName
The result selection name parameter corresponds to the name of the result selection.
.PARAMETER SolveName
The solve name parameter corresponds to the name of the solve.
.PARAMETER AccountStructureName
The account structure name parameter corresponds to the name of the account structure.
.PARAMETER ContractSelectionType
The contract selection type parameter corresponds to the type of contract selection.
Two values are available:
- FULL
- INCREMENTAL
.PARAMETER SelectedContractGroup
The optional selected contract group parameter corresponds to the name of the data group in which to place selected contracts.
.PARAMETER NonSelectedContractGroup
The optional non-selected data group parameter corresponds to the name of the data group in which to place non-selected contracts.
.PARAMETER ErroneousContractGroup
The optional erroneous contract group parameter corresponds to the name of the data group in which to place erroneous contracts.
.PARAMETER MaxNumberOfErrorsToLog
The optional maximum number of errors to log parameter corresponds to the maximum number of errors to log.
.PARAMETER DataGroupNames
The optional data group names parameter corresponds to the name of the data groups.
.PARAMETER DataFilters
The optional data filters parameter corresponds to the name of the data filters.
.PARAMETER Separator
The optional separator parameter corresponds to the character used to separate values in lists.
.PARAMETER SynchronousMode
The synchronous mode switch defines if the synchronous mode should be used.
.NOTES
File name: Start-ContractSelection.ps1
Author: Florian CARRIER
Creation date: 26/02/2020
Last modified: 26/02/2020
#>
[CmdletBinding (
SupportsShouldProcess = $true
)]
Param(
[Parameter (
Position = 1,
Mandatory = $false,
HelpMessage = "Java path"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$JavaPath,
[Parameter (
Position = 2,
Mandatory = $true,
HelpMessage = "RiskPro batch client path"
)]
[ValidateNotNullOrEmpty ()]
[Alias ("Path", "RiskProPath")]
[System.String]
$RiskProBatchClient,
[Parameter (
Position = 3,
Mandatory = $true,
HelpMessage = "RiskPro server URI"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$ServerURI,
[Parameter (
Position = 4,
Mandatory = $true,
HelpMessage = "Credentials of the user"
)]
[ValidateNotNullOrEmpty ()]
[System.Management.Automation.PSCredential]
$Credentials,
[Parameter (
Position = 5,
Mandatory = $false,
HelpMessage = "Java options"
)]
[ValidateNotNullOrEmpty ()]
[System.String[]]
$JavaOptions,
[Parameter (
Position = 6,
Mandatory = $true,
HelpMessage = "Name of the model"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$ModelName,
[Parameter (
Position = 7,
Mandatory = $true,
HelpMessage = "Name of the result selection"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$ResultSelectionName,
[Parameter (
Position = 8,
Mandatory = $true,
HelpMessage = "Name of the solve"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$SolveName,
[Parameter (
Position = 9,
Mandatory = $true,
HelpMessage = "Name of the account structure"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$AccountStructureName,
[Parameter (
Position = 10,
Mandatory = $true,
HelpMessage = "Type of contract selection"
)]
[ValidateSet (
"FULL",
"INCREMENTAL"
)]
[System.String]
$ContractSelectionType,
[Parameter (
Position = 11,
Mandatory = $false,
HelpMessage = "Name of the data group in which to place selected contracts"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$SelectedContractGroup,
[Parameter (
Position = 12,
Mandatory = $false,
HelpMessage = "Name of the data group in which to place non-selected contracts"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$NonSelectedContractGroup,
[Parameter (
Position = 13,
Mandatory = $false,
HelpMessage = "Name of the data group in which to place erroneous contracts"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$ErroneousContractGroup,
[Parameter (
Position = 14,
Mandatory = $false,
HelpMessage = "Maximum number of errors to log"
)]
[ValidateNotNullOrEmpty ()]
[System.Int32]
$MaxNumberOfErrorsToLog,
[Parameter (
Position = 15,
Mandatory = $false,
HelpMessage = "Name of the data groups"
)]
[ValidateNotNullOrEmpty ()]
[System.String[]]
$DataGroupNames,
[Parameter (
Position = 16,
Mandatory = $false,
HelpMessage = "Name of the data filters"
)]
[ValidateNotNullOrEmpty ()]
[System.String[]]
$DataFilters,
[Parameter (
Position = 17,
Mandatory = $false,
HelpMessage = "Character used to separate values in lists"
)]
[ValidateNotNullOrEmpty ()]
[System.String]
$Separator,
[Parameter (
HelpMessage = "Define if the synchronous mode should be enabled"
)]
[Switch]
$SynchronousMode
)
Begin {
# Get global preference variables
Get-CallerPreference -Cmdlet $PSCmdlet -SessionState $ExecutionContext.SessionState
# Get utilities Java class
$JavaClass = Get-JavaClass -Name "Interfacing"
}
Process {
# Define operation
$Operation = "startContractSelection"
# Define mandatory operation parameters
$OperationParameters = New-Object -TypeName "System.Collections.Specialized.OrderedDictionary"
$OperationParameters.Add("ic.modelName" , $ModelName)
$OperationParameters.Add("ic.resultSelectionName" , $ResultSelectionName)
$OperationParameters.Add("ic.solveName" , $SolveName)
$OperationParameters.Add("ic.accountStructureName" , $AccountStructureName)
$OperationParameters.Add("ic.contractSelectionType" , $ContractSelectionType)
# Define optional operation parameters
if ($PSBoundParameters.ContainsKey("SelectedContractGroup")) { $OperationParameters.Add("ic.selectedContractGroup" , $SelectedContractGroup) }
if ($PSBoundParameters.ContainsKey("NonSelectedContractGroup")) { $OperationParameters.Add("ic.nonSelectedContractGroup" , $NonSelectedContractGroup) }
if ($PSBoundParameters.ContainsKey("ErroneousContractGroup")) { $OperationParameters.Add("ic.erroneousContractGroup" , $ErroneousContractGroup) }
if ($PSBoundParameters.ContainsKey("MaxNumberOfErrorsToLog")) { $OperationParameters.Add("ic.maxNumberOfErrorsToLog" , $MaxNumberOfErrorsToLog) }
if ($PSBoundParameters.ContainsKey("DataGroupNames")) { $OperationParameters.Add("ic.dataGroupNames" , $DataGroupNames) }
if ($PSBoundParameters.ContainsKey("DataFilters")) { $OperationParameters.Add("ic.dataFilters" , $DataFilters) }
if ($PSBoundParameters.ContainsKey("Separator")) { $OperationParameters.Add("ic.separator" , $Separator) }
# Configure syncrhonous mode
$OperationParameters.Add("ws.sync", $SynchronousMode)
# Format Java parameters
$Parameters = ConvertTo-JavaProperty -Properties $OperationParameters
# Call RiskPro batch client
if ($PSBoundParameters.ContainsKey("JavaPath")) {
Invoke-RiskProBatchClient -JavaPath $JavaPath -RiskProPath $RiskProBatchClient -ServerURI $ServerURI -Credentials $Credentials -JavaOptions $JavaOptions -Operation $Operation -Parameters $Parameters -Class $JavaClass
} else {
Invoke-RiskProBatchClient -RiskProPath $RiskProBatchClient -ServerURI $ServerURI -Credentials $Credentials -JavaOptions $JavaOptions -Operation $Operation -Parameters $Parameters -Class $JavaClass
}
}
}
Loading

0 comments on commit df209cf

Please sign in to comment.