This just may not be possible, but thought I would throw it out there:
The base question: Is there a way to execute Infopath rules without actually opening up an Infopath form with the Infopath client? I don't believe there are Infopath APIs to be called from .NET code but maybe I'm wrong or is there some other way to access the rules "virturally" within code.
Background: I work for a company that has workflow software where we can update an Infopath form with data captured within our system and we're using the Infopath form as the user interface. We only want the user to get the Infopath form if there are errors present, otherwise send the form on to the next steps in the workflow.
We're using an Infopath 2007 form which will be published to a MOSS document library. Using an XML doc created by opening the form and saving it without adding any data, we will then add data. From there we need to validate the data using the rules created within Infopath. We know we can capture the number of validation errors to store on a field on the form to use later, but it requires quickly opening and closing the form programmatically (the rules execute on open). Our worry is that there could be hundreds of forms opening and closing which could hog server resources and create other errors as we do this. Ideally if there was a way to access the error count through .NET code, we wouldn't have to worry about opening and closing the form.
Any ideas or are we just dreaming?? Thanks.