Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute state paths in scenario are not reliable with append mechanics #148

Open
Denire opened this issue Mar 10, 2021 · 0 comments
Open

Comments

@Denire
Copy link
Contributor

Denire commented Mar 10, 2021

After #139 was merged JAICF obtained ability to merge sub-scenarios inside parent scenario.

Scenario example:

val HelperScenario = Scenario {
    state("ask4name") {
        activators {
            catchAll()
            intent("name")
        }
    ...
}

val HelloWorldScenario = Scenario {
    append(context = "helper", HelperScenario)
}

Here we can see that parent scenario provides context for subscenario. Thus means subscenario can never know absolute state path and should rely only on relative state paths (e.g. do reactions.go("../../someState") instead of reactions.go("/someState")).
This opens a major issue for many StateNotFound runtime exceptions in bot.

What can be done:
Create new symbol in statepath resolution - ~, which will hold a root path of current scenario object. This will allow to use absolute paths from scenario root (from ~) and will give more flexibility for appended sub-scenarios.
So the transition will look like reactions.go(~/someState)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant