Cannot access callflow varable within custom component

Discussion in 'CRM / Helpdesk / App Integration' started by SWSDEV, Dec 7, 2010.

Thread Status:
Not open for further replies.
  1. SWSDEV

    SWSDEV Member

    Joined:
    Feb 23, 2008
    Messages:
    256
    Likes Received:
    0
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    Thanks again for your feedback.
    The fix will be included in the next release.
    Regards,
     
  3. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    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,
     
  4. SWSDEV

    SWSDEV Member

    Joined:
    Feb 23, 2008
    Messages:
    256
    Likes Received:
    0
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    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.
     
  6. SWSDEV

    SWSDEV Member

    Joined:
    Feb 23, 2008
    Messages:
    256
    Likes Received:
    0
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    I will try this and let you know.
    Thanks,
     
  8. VAD_Support

    VAD_Support Active Member

    Joined:
    Aug 6, 2009
    Messages:
    690
    Likes Received:
    0
    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,
     
  9. SWSDEV

    SWSDEV Member

    Joined:
    Feb 23, 2008
    Messages:
    256
    Likes Received:
    0
    OK, I will clarify the steps to reproduce.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.