• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFML event gateway for asynchronous And Context

New Here ,
Aug 20, 2020 Aug 20, 2020

Copy link to clipboard

Copied

Guys,


I'm using the CFML event gateway for asynchronous which works as discribed, however, within the listener cfc I cannot access my application's CFCs as they are not within the Coldfusion /cfusion/wwwroot folder but rather in a different directory. 

 

How can I reference an existing CFC within the context of the gateway CFC

Views

263

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 21, 2020 Aug 21, 2020

Copy link to clipboard

Copied

Hello, nak33,

 

I've never used this feature, so don't really know how to help you with this.  However, looking at the page you provided the link for, I did see the following:

cfcpath

Overrides the CFC path specified in the ColdFusion Administrator. This field lets you use a single gateway configuration in the ColdFusion Administrator multiple CFCs.

 

Would this optional field allow you to specify the path to the CFCs?

 

V/r,

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 21, 2020 Aug 21, 2020

Copy link to clipboard

Copied

Unfortunately that's not a fix. 

 

That attribute is to point to the CFC that digests the incoming event.  The issue is that the context within that CFC is within the wwwroot, but my application lives somewhere completely different, so when I attempt to call other CFCs (via the component="cfc_files.system.cfcname") it errors out because the CFC that I'm calling 'thinks' it's in the webroot...one would expect something in the configuration of the event gateway but I can't find it. 

 

Thanks for chimming in!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 21, 2020 Aug 21, 2020

Copy link to clipboard

Copied

Here's an example of what I'm describing.  The first is the output of the ExpandPath(/) in the event gateway the second is occuring outside the gateway.  I need the first output to be the same as the second. 

 

process.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 07, 2020 Sep 07, 2020

Copy link to clipboard

Copied

LATEST

Easy. There are at least several possibilities. Here's the one I consider the most straightforward:

 

  1.  Define in the Application.cfc file that your gateway uses:
    <cfset this.mappings[ "/myAppCFCs" ] = "D:\Websites\ycWeb\trunk\yc\">
    Suppose that one such CFC is D:\Websites\ycWeb\trunk\yc\Customer.cfc
  2. Then, within the gateway's listener CFC, you can instantiate the Customer CFC as
    <cfset customerObject=createobject("component", "myAppCFCs.Customer") >

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 21, 2020 Aug 21, 2020

Copy link to clipboard

Copied

Is there anything I can configure in the neoruntime.xml?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation