Cannot access callflow varable within custom component

Dedicated forum for the visual 'drag and drop' voice application designer that allows easy creation of advanced voice applications without programming knowledge

Moderators: kevin, 3CX staff

Cannot access callflow varable within custom component

Postby SWSDEV » Wed Dec 08, 2010 12:15 am

The ivr log is showing this erro:

ReferenceError: callflow$ is not definedline1linetxttokentxt

This seems like a huge bug. Not being able to access the callflow variable from within a custom component. This additionally makes it so I can't get error message information from within the error handlers of a component.
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA

Re: Cannot access callflow varable within custom component

Postby VAD_Support » Thu Dec 09, 2010 2:05 pm

Thanks again for your feedback.
The fix will be included in the next release.
Regards,
VAD_Support
3CX Valued Professional
3CX Valued Professional
 
Posts: 439
Joined: Thu Aug 06, 2009 5:29 pm

Re: Cannot access callflow varable within custom component

Postby VAD_Support » Tue Jan 04, 2011 8:39 pm

Hi,

We were thinking more about this, and this is not a bug. The custom component can be included in many callflows, so you can't be sure that the callflow variable will exist. If you need to access a callflow variable, then you should send that value as an input parameter to the custom component, and then it will be available.

Other option is defining that variable as a project level variable. Then, it will be visible to all the callflows and components into the project.

Regards,
VAD_Support
3CX Valued Professional
3CX Valued Professional
 
Posts: 439
Joined: Thu Aug 06, 2009 5:29 pm

Re: Cannot access callflow varable within custom component

Postby SWSDEV » Tue Jan 04, 2011 9:46 pm

The main problem is that when an exception happens, I cannot get the error information to log.

Also either way, the 3cx IVR log is still logging an error. If it's not a bug then that needs to be removed or clarified.
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA

Re: Cannot access callflow varable within custom component

Postby VAD_Support » Tue Jan 04, 2011 11:50 pm

Hi,

When an exception happens, you can log the error using the project properties (project$.CurrentErrorName$ and project$.CurrentErrorDescription$). But in the error log you mentioned, you're using callflow$. Those properties are project variables, and not callflow variables.

In order to get the error you previously mentioned, you need to manually enter "callflow$.XXXX" as a javascript expression, where XXXX is an invalid property name. If you choose a variable name from the Expression Editor you will probably avoid that kind of errors.

The expression editor allows entering any javascript expression, and it can not evaluate it at compile time, so you may get that kind of runtime errors if you enter an invalid expression there. You need to be very careful when entering that kind of expressions.
VAD_Support
3CX Valued Professional
3CX Valued Professional
 
Posts: 439
Joined: Thu Aug 06, 2009 5:29 pm

Re: Cannot access callflow varable within custom component

Postby SWSDEV » Wed Jan 05, 2011 2:07 am

OK, I'll go try that.

Please try this though, create a custom component and create something in the error handler of that component.

Now put the component into a main call flow.

Make sure the component will throw an error that will get trapped inside the component and not kick back to the main callflow.

Now run it and then debug.

Are you able to see in the debugger the values or the error name and error description?

In my experience, the only times those errors actually show up is if you're debugging in the top level call flow.
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA

Re: Cannot access callflow varable within custom component

Postby VAD_Support » Wed Jan 05, 2011 1:14 pm

I will try this and let you know.
Thanks,
VAD_Support
3CX Valued Professional
3CX Valued Professional
 
Posts: 439
Joined: Thu Aug 06, 2009 5:29 pm

Re: Cannot access callflow varable within custom component

Postby VAD_Support » Thu Jan 06, 2011 5:09 pm

Hi,

I did the suggested test, and works as expected. I see the error name in the error handler into the custom component.

My test was the following:
- I created a new project with the Main callflow
- I created a custom component
- I added the custom component into the Main callflow
- Into the main flow of the custom component, I added a Variable Assignment component which throws an error.semantic error
- Into the error handler flow of the custom component, I added a branch to handle the error. When debugging, Into that branch I see the error name.

Please, if you have problems seeing the error name into the error handler of a custom component, then send me a sample project reproducing this and we'll verify it.

Thanks,
VAD_Support
3CX Valued Professional
3CX Valued Professional
 
Posts: 439
Joined: Thu Aug 06, 2009 5:29 pm

Re: Cannot access callflow varable within custom component

Postby SWSDEV » Thu Jan 06, 2011 8:24 pm

OK, I will clarify the steps to reproduce.
Shahzad Qureshi
SWS Development - 3CX Certified Partner
Custom 3CX integration
Salt Lake City, UT USA
801-938-7712
swsdev.com
SWSDEV
Expert
Expert
 
Posts: 246
Joined: Sat Feb 23, 2008 6:51 am
Location: Salt Lake City, Utah - USA


Return to 3CX Voice Application Designer (VAD)


Who is online

Users browsing this forum: No registered users and 0 guests

Announcements: