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: Create variables from a file
Topic Summary: how do I create variables from a config file
Created On: 01/28/2014 11:36 AM
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.
 01/28/2014 11:36 AM
User is offline View Users Profile Print this message

Author Icon
GaryRobar
n00b (>6 posts)

Posts: 2
Joined: 01/28/2014

I am using Automate BPA server 8. 

what is the best way to initialize and populate a set of variables from a file.

e.g. perhaps an xml file might contain parameter name/value pairs or even a simple text file. Is there a good way to do this other than looping through each row in a text file and creating variables?



 Category Survey


Edited: 01/28/2014 at 11:51 AM by GaryRobar
 01/28/2014 08:50 PM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

Gary,
I'm afraid some sort of looping cannot be avoided.
Seeing the real format of your file could better help refine.
But parsing a file is always a touchy business.

 Category Survey
AutoMate 8 version:
Windows version:


-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
 01/29/2014 09:52 AM
User is offline View Users Profile Print this message

Author Icon
GaryRobar
n00b (>6 posts)

Posts: 2
Joined: 01/28/2014

Hi Jean,

I decided to create an XML parameter file and use that by reading nodes to retrieve variables. 

 

<settings>
   <TargetFolder>E:\SFTP_Accounts\in</TargetFolder>
   <ArchiveFolder>E:\SFTP_Accounts\archive</ArchiveFolder>
   <DoneFiles>complete.done</DoneFiles>
</settings>

That works, but I have to create the task in BPA in such a way that it knows what is in the file e.g. manually creating variables, assigning specific node to it.

 

What I really want is to do is have a generic parameter file, similar to above, but more like this:

<settings>
   <setting name="TargetFolder">E:\SFTP_Accounts\in</setting>
   <setting name="ArchiveFolder">E:\SFTP_Accounts\archive</setting>
   <setting name="DoneFiles">complete.done</setting>
</settings>

...then be able to loop that, and dynamically generate variables based on the name attribute, and assign values to them from the node's value.

 

Ideally I just want some kind of key.value pair (e.g. like a dictionary) object I can use throughout the task, but I am afraid that might not be possible.

Have not figured that out.



 Category Survey
 01/29/2014 11:48 AM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

Gary,
have a look at this.

 Category Survey
AutoMate 8 version:
Windows version:



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4


Edited: 01/29/2014 at 11:56 AM by JeanDelfosse
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 1870 guests browsing this forum, which makes a total of 1870 users using this forum.

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

Sitemap Network Automation Software Blog