We am using FB4.1 build 199 and have come to a point where we are stuck.
One of the steps in our .net build process in Final Builder calls an program using the Execute Program action. The program it calls checks for and updates any webreferences that it finds in the app.config file depending on which environment we are building for.
At the moment if it finds something that it shouldnt find it fails and doesnt update the app.config file. Final Builder doesnt know that it has failed though as the failure is in the external program and there is nothing to tell Final Builder that something has gone wrong. We have tried to by getting the applciation to throw an exception when it fails but Final Builder doesnt pick this up as a failure. Is there any way we can get a message back to final builder to say that it has failed? One way to do it would be to use action studio but its quite a complicated application and would take some time to port over even if it could be done at all.
Is there an interface to Final Builder that an external program can use to indicate a failure or just to update a variable in Final Builder that we can use to flag a failure with the external program.
The execute program action responds to the return value of the application. By default the action will fail if your application return anything else then 0.
If your program doesn’t behave properly with respect to exit codes (and many don’t), then you can keep an eye on the program output in order to determine if it’s failed. ie, if you have a FinalBuilder variable called VarCommandFailed you can use JScript like this in the OnStatusMessage event:
if (StatusMessage.indexOf(‘Error’) > -1) VarCommandFailed = true;
then in the AfterAction event:
ActionResult = ActionResult and not VarCommandFailed;
and BeforeAction:
VarCommandFailed = false;
(Unfortunately, there’s no way to directly influence the action’s result from the OnStatusMessage event, which is why the FB variable is needed.)
(If you need to call the application many times, you could also create an Action Studio ‘Execute Program Action’ as a wrapper to the program, and perform the output parsing in there.)