0

When are workflow agents actually called? I've installed my own workflow agent (this one) and write to a log on the second line in ProcessWorkflow (the first one being the log4net XmlConfigurator.Configure call with a newly created FileInfo instance.

The log is always written after the KTM Server module. This WOULD make sense, because I read a configuration which prompts the WFA to do something with the workflow data. But after the KTM Validation module (where the WFA is also configured to do something) the log is not written.

Is there an explanation, why I don't see any log entries? I've checked the kofax logs too, but I found no evidence there.

The exact code snippet looks like this:

public void ProcessWorkflow(ref IACWorkflowData workflowData)
{
    XmlConfigurator.Configure(new FileInfo(@"C:\Program Files (x86)\Kofax\CaptureSS\ServLib\Configuration Files\log4net.config"));

    log.Info("Workflow Agent started ...");
    // rest of the code
Community
  • 1
  • 1
G_hi3
  • 588
  • 5
  • 22
  • Also, I have to post my questions here, because I can't access the Kofax Forums (admin has not given me permission yet). So, if any kofax board admin sees this, please enable marc.forrer :D – G_hi3 Sep 15 '15 at 14:51
  • 2
    AFAIK, the Forum is dead. My Account also never got activated. It still serves as a "library" to lookup things. They encourage using the linkedIn Kofax UserGroup. (IMHO no adequate replacement ... ) – Fildor Oct 26 '15 at 15:26

2 Answers2

0

So, since I kind of figured out how to use Workflow Agents, I decided to answer this question for future reference.

A Workflow Agent is being run every time a module has been executed. IIRC this includes viewing the properties with Batch Manager. The Workflow Agent will be called on the site where the module has been executed. So if you execute your automatic modules (i.e. PDF Generator, Export) on a server and Scan and Validation on client sites, the Workflow Agent will be executed on the server or the client station which executed the module respectively.

I actually forgot what didn't work in my original question, but I also ran into problems because I didn't register the DLL using RegAsm.exe. See my other Kofax-related question for more information about this: How to correctly install Workflow Agents in Kofax?

G_hi3
  • 588
  • 5
  • 22
0

You can also use this in your code so that it only runs the logic when you want it to:

if (workflowData.CurrentModule.Name != "Scan" || workflowData.get_NextState().Name != "Ready")
{
   return;
}
  • Thank you for your help, but the issue wasn't that the program logic was wrong. The Workflow Agent just wasn't installed on the machine I ran KTM Validation, so the code couldn't even execute. – G_hi3 Jan 30 '19 at 07:55