Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Variable for Workflow/Task Staging Level?
Topic Summary:
Created On: 06/28/2018 01:54 PM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 06/28/2018 01:54 PM
User is offline View Users Profile Print this message

Author Icon
MarkMckibben
Student (5-19 posts)

Posts: 14
Joined: 06/07/2018

Are there variables to pull the staging level into a workflow/task? If not, then could this be added in the future? Maybe something like %AMCurrentTask.StagingLevel%?

Being able to check the Stage of the task/workflow would allow us to build a single workflow/task that connects to different servers/environments depending on whether the workflow/task was Testing vs. Production.
 06/29/2018 11:52 AM
User is offline View Users Profile Print this message

Author Icon
DavidSeibel
Apprentice (20-49)

Posts: 42
Joined: 11/14/2014

There are a few ways to get this:
1) Via the API

Call the API with tasks/%GetManagedTaskID()%/get, and look at the CompletionState property:
0 means "In Development"
1 means "Testing"
2 means "Production"
3 means "Archive"

You can use the PoshBPA PowerShell module to do this. From a PowerShell console:

Connect-BPAServer myservername -Port 9703 -Username david -Password (ConvertTo-SecureString "1234" -AsPlainText -Force)
$staging = switch ((Get-BPATask -ID '%GetManagedTaskID()%').CompletionState) {
0 { "In Development" }
1 { "Testing" }
2 { "Production" }
3 { "Archive" }
}
Disconnect-BPAServer
return $staging

2) Query the BPA database:
SELECT
CASE CompletionState
WHEN 0 THEN 'In Development'
WHEN 1 THEN 'Testing'
WHEN 2 THEN 'Production'
WHEN 3 THEN 'Archive'
END AS Staging
FROM automateconstructs
WHERE ResourceID = '%GetManagedTaskID()%'

Both of these can be embedded in the task in question to query the staging level.

Edited: 07/02/2018 at 11:11 AM by DavidSeibel
 07/02/2018 07:20 AM
User is offline View Users Profile Print this message

Author Icon
MarkMckibben
Student (5-19 posts)

Posts: 14
Joined: 06/07/2018

Thanks David, that looks very helpful. I noticed your API link was for Automate 10.5.0.56; do you know if the API has changed or will that example still work with Automate 11.0.6.11?
 07/02/2018 07:22 AM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Hi Mark,

The API has not changed since 10.5. David's example should work with v11.

-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 485 guests browsing this forum, which makes a total of 485 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2019 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog