04-04-2017 11:24 AM
I'm trying to set up a property loader to load in test limits from a CSV/Excel file but I want to avoid all of the horrible XML that gets generated.
There could be 0..N limits for the different parameters. My local is an empty array of the same type.
I want my limits file to look like this:
<Locals>,Variable Value CLOVER_Drive_Conditions_Limits[0].Parameter_Name,"SOA_Current" CLOVER_Drive_Conditions_Limits[0].Comparison.Comparison_Type,"GELE" CLOVER_Drive_Conditions_Limits[0].Comparison.Low_Limit,0 CLOVER_Drive_Conditions_Limits[0].Comparison.High_Limit,100 CLOVER_Drive_Conditions_Limits[0].Comparison.Units,"Amps" CLOVER_Drive_Conditions_Limits[1].Parameter_Name,"SOA_Voltage" CLOVER_Drive_Conditions_Limits[1].Comparison.Comparison_Type,"GT" CLOVER_Drive_Conditions_Limits[1].Comparison.Low_Limit,5 CLOVER_Drive_Conditions_Limits[1].Comparison.High_Limit,0 CLOVER_Drive_Conditions_Limits[1].Comparison.Units,"Volts"
When I run the property loader step, it says 'done' but it doesn't import the items.
Any ideas?
Solved! Go to Solution.
04-04-2017 11:49 AM
Hi Sam,
I don't know why this is happening for you, but a possible solution might be to do include the array size you will be loading as a property and then do the properly load operation(s) as follows:
1. Load the array size to a local variable using the specific variable properly loader.
2. Change the number of elements of your empty array using SetNumElements () and the array size local value.
3. Load the array elements using the 'Import all Properties from Data Location' option (reloading the array size, but so what).
I've used this method in the past to design a one-size fits all property loader function to handle variable size arrays.
I hope this helps.
-Jack
04-05-2017 04:16 AM
04-05-2017 09:24 AM
I didn't explicitly say it, but [in theory] you could create a utility sequence that the developer would call with parameters for what property file to call, Markers to use (if not statically defined), and the array to populate, and which would do the three steps internally. So you could at least do it in one sequence call step. I'm sure this can be done, but I can't find my example to verify that what I described above was actually what we did...
04-05-2017 11:51 AM
Yup, that's almost exactly what I ended up doing - creating a sub-sequence in a Utility sequence and creating a custom step type out of that which does the following:
Thanks for the pointers!