KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Solutions KX Control – stopStateFunct? Re: KX Control – stopStateFunct?

  • Laura

    Administrator
    August 10, 2021 at 12:00 am

    Hi David,
    Thanks for the reply. It looks like what I already do is in line with what you told me.

    Here is my scenario:
    I have one workflow that contains a single RTE that I use to start a bunch of service classes.
    To do that, i used the initial state function of the RTE to call the startServiceCSV.sh script provided on the KX Data Warehouse tutorial.  Meanwhile, the csv contains hardcoded information about the “parent” RTE at each service class row.

    Then, each service class has a custom initStateFunction that, among other things, creates an IPC handle to their parent RTE and keeps checking (with a timer) if the handle is still valid. So whenever i stop the workflow, the RTE obviously dies, making the handles invalid and therefore killing the services.

    I asked about a stopStateFunction because if such a thing existed, i would not have to do the ipc logic – but what I am getting from your response is that this is as good as it gets?

    cheers,
    Adriano