Highlighted

CFML event gateway for asynchronous And Context

New Here ,
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

35

Likes

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

CFML event gateway for asynchronous And Context

New Here ,
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

36

Likes

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
Aug 20, 2020 0
LEGEND ,
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,

 

^ _ ^

Likes

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
Reply
Loading...
Aug 21, 2020 0
New Here ,
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!

Likes

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
Reply
Loading...
Aug 21, 2020 0
New Here ,
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

Likes

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
Reply
Loading...
Aug 21, 2020 0
BKBK LATEST
Adobe Community Professional ,
Sep 07, 2020

Copy link to clipboard

Copied

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") >

Likes

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
Reply
Loading...
Sep 07, 2020 0
New Here ,
Aug 21, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Aug 21, 2020 0