Hi Mark.

After throwing in an if statement for the Priority variation and some other local tweaks I have this working perfectly, so thank you for sharing.

I also added the Token and User Key as a setting to be set from the Operation within Ensemble.

It would be good to catch up outside of the Intersystems forums sometime soon.

Cheers!


For anyone interested in adding the Token and User Key

So I included before the method:

Property Token As %String;

Property User As %String;

Parameter SETTINGS = "Token, User";

And then the http request parameter became:

        Do httprequest.SetParam("token",..Token)
        
        Do httprequest.SetParam("user",..User)

This leaves the token and user key to be configured within Ensemble via the Management Portal:

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.