The Model Only Tool called Calculate Value can be run in Batch.
To prove this to myself I did the following:
- Create a test feature class, add one feature and an empty field to it - I used Short Integer
- Write first tiny model with Iterator called For and Copy Features and run it to create five copies of the test feature class called test1, test2, ..., test5
- Write second tiny model that uses Calculate Value tool to do perhaps 12 + 17 and then feed that output_value to a Calculate Field tool that uses it to populate the field added in 1.
- Run the second model in Batch with the five feature classes created in 2.
Result is the number 29 in the field for each of the five feature classes so the Calculate Value tool was run in Batch.
The "proof" above was poorly designed because only proves that the Calculate Value tool run in Batch gives the right result when Calculate Value is not intended to provide a different answer for each row in the Batch Grid.
Consequently, I've now run another set of tests using this model.
The model takes a feature class (which must have an integer as the 5th character in its name e.g. test1, test2) as input, uses Calculate Value to grab the 5th character and return it as an integer so that Calculate Field can add that to the value of a field called Count (always has value of 1) to get a value written into another field called NewCount. Details of dialog settings to accomplish this are below.
The tool produces the expected result when run using Open or as a Batch with one row.
However, when the tool is run in batch using two input feature classes of test1 and test2 you would expect the NewCount fields to be updated to 2 (=1+1) and 3 (=1+2) respectively. Instead, what happens is that if test1 is in the first row of the batch grid then 2 gets written to both and if test2 is first then 3 gets written to both.
From the following it is obvious that while every other tool gets run once per row of the batch grid, the Calculate Value tool is only getting run once in total.
Executing: BatchGridBug C:\Support\MBarretts20\test.gdb\test1
Start Time: Fri Oct 26 15:17:26 2012
Executing (Parse Path): ParsePath C:\Support\MBarretts20\test.gdb\test1 NAME
Start Time: Fri Oct 26 15:17:26 2012
Executing (Parse Path): ParsePath C:\Support\MBarretts20\test.gdb\test2 NAME
Succeeded at Fri Oct 26 15:17:26 2012 (Elapsed Time: 0.00 seconds)
Executing (Calculate Value): CalculateValue UpdateValue("test1") "def UpdateValue(Value):\n Value = Value\[4:\]\n return int(Value)" Variant
Start Time: Fri Oct 26 15:17:26 2012
Value = 1
Succeeded at Fri Oct 26 15:17:26 2012 (Elapsed Time: 0.00 seconds)
Executing (Calculate Field): CalculateField C:\Support\MBarretts20\test.gdb\test1 NewCount "!Count! + 1" PYTHON #
Start Time: Fri Oct 26 15:17:26 2012
Executing (Calculate Field): CalculateField C:\Support\MBarretts20\test.gdb\test2 NewCount "!Count! + 1" PYTHON #
Succeeded at Fri Oct 26 15:17:27 2012 (Elapsed Time: 1.00 seconds)
Succeeded at Fri Oct 26 15:17:27 2012 (Elapsed Time: 1.00 seconds)
Feedback from Redlands via local support was "We have tested the case in house and observed that ... Issue is reproducible in house ... this is a known limit with Calculate Value tool ... NIM053898: "Calculate Value tool stops after first expression variable in batch mode (or when defined as a list of values)" Status of bug: Rejected as designed Reasons for rejection: Known limit. Use Iterate multivalue in 10." I'm disappointed that this is being treated as a Known Limit so have asked whether that Status can at least be documented under Calculate Value and Using Batch Grids.