Question
Lorraine Dodgson · Feb 8, 2018

File Passthrough when using a Router getting ERROR #5005

Hello

I am writing a simple routing interface that picks up files from a share using File.InboundAdapter.

I am then using PassthroughService and passing it to a router.

The Router is using Ens.StreamContainer to then get the filename.  I have then used contains to pick out part of the filename.

and then pass it to another simple passthrough operation to another share.

 

If I do a direct link without using the router it works fine and I get no errors, once I direct the messages through the router I am getting ERROR #5005  Cannot open file, it does however write a file to the share but the file is a corrupt pdf I cannot open.

Is there something I have missed or a reason I can't do this? 

Thanks

Lorraine

0
0 802
Discussion (8)4
Log in or sign up to continue

If I do a direct link without using the router it works fine

How fo you test directly? If you're doing it from a terminal, then that terminal process works as your OS user. Ensemble works under another OS user. Check that this user has access to file.

I am receiving the error on the Operation.

I literally just want to sort by filename so for example I will get files with different ward names in so I want to route them relating to this.

If I remove the router so its a direct service to operation for all files it works.  its only when I add in this router that I get the error on the operation.

 

Thanks

Lorraine

Thanks, this is helpful.

In your routing rule, can you try setting the condition from "Document.OriginalFilename Contains "NTWD33"" to "1"?  Also, can you post a snapshot of the "general" tab in the rule editor?

I got the same error when I changed the condition to "1"

 

Thanks Lorraine.

At this point it would be best to open a WRC ticket so a support rep can help look into this in more detail.

Hi Lorraine,

A few questions to help us get a clearer picture:

  • Which component is generating the 5005 error? Is it the router or the business operation?
  • Can you post a screenshot or the source code for your routing rule?
  • Is your router calling a transformation or just passing the file through unchanged?
  • What happens if you remove all logic from your router and just change it to do a simple "send" with no transformation?

-Marc

Hi Lorraine.

I think the issue is that the Constraint is not set for the condition to be able to reference the filename. I see that you have added a comment to another post which explains how to do this, but it stops short in explaining fully. Fortunately, Joshua Goldman then links to another post where he goes in to more detail.

I'll copy and paste it here, and include the link.

https://community.intersystems.com/post/how-route-file-based-file-type

  1.  Define a business rule. Make it a General Message Routing Rule and have the assist class be EnsLib.MsgRouter.RuleAssist.
  2. Add a rule to the rule set and double-click Constraint. Specify the rule class Persistent > ENS > StreamContainer
    That's the message class used by the pass-through file service/operation. You can also specify the business service as the source.
  3. Double-click  condition, and in the expression editor specify Document.Type or Document.OriginalFilename, add an operation, and a  value.
  4. Send it to the correct operation.
  5. Define a router business process and specify the rule you just created.
  6. Connect the pass-through file service to the router.

Hi,

If you are getting "ERROR #5005: Cannot open file 'C:\...' when trying to use EnsLib.File.PassthroughOperation via a router, ensure you have a 'Work Path' set on the Service that connects to the router.

This is because there are 2 components trying to access the file, so it needs to use a temporary location.

Hope that helps

Mark