This blog post will let you know how you can Fetch Variables from SAP Intelligent RPA Cloud Factory and use data in your process bot.
Cloud Factory Variables is useful to store deployment settings, environment details while running bot either in Attended or Unattended Mode.
Step-1 : Create Variables in SAP Intelligent Cloud Factory
For that you need to have access to SAP Intelligent RPA Cloud Factory.
GLOBAL.events.START.on(function (ev)
{
systray.addMenu('', 'Fetching_Cloud_Factory_Variables', 'Fetching_Cloud_Factory_Variables',
'',function (ev)
{
var rootData = ctx.dataManagers.rootData.create();
GLOBAL.scenarios.Fetching_Cloud_Factory_Variables.start(rootData);
});
});
/*
Scenario: Fetching_Cloud_Factory_Variables
*/
GLOBAL.scenario({ Fetching_Cloud_Factory_Variables: function(ev, sc)
{
var rootData = sc.data;
sc.setMode(e.scenario.mode.clearIfRunning);
sc.setScenarioTimeout(600000);
sc.onError(function(sc, st, ex) { sc.endScenario(); });
sc.onTimeout(300000, function(sc, st) { sc.endScenario(); });
sc.step(GLOBAL.steps.Fetching_Cloud_Factor);
}},ctx.dataManagers.rootData).setId('5c310ba0-c652-4220-86e0-807e4ea29b72') ;
GLOBAL.step({ Fetching_Cloud_Factor: function(ev, sc, st)
{
var rootData = sc.data;
ctx.workflow('Fetching Cloud Factory Variables', '327b51fa-07c9-43c9-bd8c-55eeb996191f');
/*
Here you will Write Code to Fetch Cloud Factory Variables
*/
sc.endStep();
return;
}
});
First, we will set the declaration
/*Declaring Setting for System URL*/
var settingDeclaration = {};
settingDeclaration["System URL"] =
{
key: ctx.cryptography.keys.none,
server: true
}
ctx.setting(settingDeclaration);
/*Declaring Setting for Credential*/
var credDeclaration = {};
credDeclaration["System Credentials"] =
{
server: true
}
ctx.cryptography.credential(credDeclaration);
ctx.settings["System URL"].get(function (code, label, setting)
{
if (code === e.error.OK)
{
ctx.log(setting.value);
}
else
{
sc.endScenario();
return;
}
});
ctx.cryptography.credentials["System Credentials"].get(function (code, label, credential)
{
if (code === e.error.OK)
{
sc.localData.cred =
{
username : credential.userName.get(),
password : credential.password.get()
}
ctx.log("Username: " +sc.localData.cred.username);
ctx.log("Password: " +sc.localData.cred.password);
}
else
{
sc.endScenario();
return;
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
23 | |
11 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 |