Introduction

  • The JS7 PowerShell® module provides simplified access to the REST Web Service, see the PowerShell Command Line Interface 2.0 - Introduction for more information.
    • Any operation that can be performed on orders, workflows, jobs and related objects such as cancelling, suspending and resuming orders is performed by the JS7 - REST Web Service API.
  • The PowerShell® module offers high level functionality such as managing orders, deploying workflows, managing the daily plan, creating reports etc.

Examples

Start a Workflow on demand

  • Cmdlets to add an order to a workflow
    PS C:\> Import-Module JS7
    
    # connect to a JOC Cockpit instance using certificate authentication and preselecting the Controller
    PS C:\> Connect-JS7 -Url https://joc-2-0-secondary.sos:7543 -KeystorePath "c:/users/me/client_certificate.p12" -Id testsuite
    
    # add an order to a workflow, optionally provide an order name and arguments
    PS C:\> $order = Add-JS7Order -OrderName EOD91 -WorkflowPath /TestCases/EODReports -Arguments @{ 'fullReport'=$true; 'reportScope'=3; "reportTitle"="EOD Processing Report" }

Check the Status of an Order in a Workflow

  • Cmdlets to receive status information of an order
    PS C:\> Import-Module JS7
    
    # connect to a JOC Cockpit instance using certificate authentication and preselecting the Controller
    PS C:\> Connect-JS7 -Url https://joc-2-0-secondary.sos:7543 -KeystorePath "c:/users/me/client_certificate.p12" -Id testsuite
    
    # get orders from workflow, alternatively use a previously assigned order name e.g. with -RegularExpression "EOD91$"
    PS C:\> $order = Get-JS7Order -WorkflowPath /TestCases/EODReports
    
    # display results
    PS C:\> $order
    
    orderId       : #2021-03-19#P0000004603-EOD91
    arguments     : @{fullReport=True; reportScope=3; reportTitle=EOD Processing Report}
    workflowId    : @{path=/TestCases/EODReports; versionId=25ef143e-9d2f-4425-82ac-25ba2cfd189f}
    state         : @{severity=1; _text=PENDING}
    attachedState : @{TYPE=Attached}
    agentId       : agent_001
    position      : {0}
    scheduledFor  : 1616131800000
    requirements  : @{parameters=}
    
    orderId       : #2021-03-20#P0000004644-EOD91
    arguments     : @{fullReport=False; reportScope=2; reportTitle=EOD Processing Report}
    workflowId    : @{path=/TestCases/EODReports; versionId=25ef143e-9d2f-4425-82ac-25ba2cfd189f}
    state         : @{severity=1; _text=PENDING}
    attachedState : @{TYPE=Attached}
    agentId       : agent_001
    position      : {0}
    scheduledFor  : 1616218200000
    requirements  : @{parameters=}
    
    # display order state
    PS C:\> $order[0].state
    
    severity _text
    -------- -----
           1 PENDING

Cancel Execution of an Order in a Workflow

  • Cmdlets to cancel execution of an order in a workflow
    PS C:\> Import-Module JS7
    
    # connect to a JOC Cockpit instance using certificate authentication and preselecting the Controller
    PS C:\> Connect-JS7 -Url https://joc-2-0-secondary.sos:7543 -KeystorePath "c:/users/me/client_certificate.p12" -Id testsuite
    
    # cancel any orders for the current day from a workflow including cyclic orders
    PS C:\> Get-JS7Order -WorkflowPath /TestCases/EODReports | Stop-JS7Order -Kill

Further Resources

How To ... Instructions

Frequently Asked Questions

There is no content with the specified labels


  • No labels