6 Replies Latest reply: Oct 6, 2015 5:40 AM by Sebastian Öhman RSS

    Passing parameters in Supporting Tasks

      Hi,

       

      Is there any way to pass parameters to a Supporting Task defined as an external program?

       

      Currently we have:

       

      -Task A (External Trigger)

      --- Supporting Task B (after Task A finishes)

       

      Task A is triggered by EDX with one variable passed: myVar = 1

       

      When Task B runs the external program, I'd like to use the myVar value passed before, so I could execute "C:\MyExternalCommand.exe /myVar=1"

       

      Is this possible?

       

      Thanks

        • Re: Passing parameters in Supporting Tasks

          In plain, no.

          The taskchain in Publisher can only exacute on Success or failure.

          So it won´t rrecognize if a trigger has excuted on a  varible, it only execute on state on the task

          • Re: Passing parameters in Supporting Tasks
            Sebastian Öhman

            I would like to have parameter support as well, at least built in parameters.

            I have a notification script, which I want to run on failure.

             

            I'm missing two things:

            1) A trigger that globally triggers on _any_ failure (or success).

            With the current implementation I have to add one trigger for every task I want to monitor.

            Or at least a way to select multiple tasks in one trigger.

             

            2) Variables that I can use when calling the external program, for example $triggeringTaskName

            With the current implementation, I have to add one external task for every task I want to check and do a unique execution for.

             

            Current setup, 3x supporting tasks

            A)

            Trigger: Failure Task1

            Command line statement: d:\failscript.exe "Task name 1"

            B)

            Trigger: Failure Task2

            Command line statement: d:\failscript.exe "Task name 2"

            C)

            Trigger: Failure Task3

            Command line statement: d:\failscript.exe "Task name 3"


            Wanted scenario

            A)

            Trigger: Any-Task-Fails

            Command line statement: d:\failscript.exe $triggeringTaskName

              • Re: Passing parameters in Supporting Tasks
                Peter Cammaert

                If you operate a Publisher, you can assign three or more triggers "on Failure" to a single Supporting task.

                 

                Passing QMC parameters to a Supporting task is not possible. In that case you're better off with three task definitions because you can embed the failure details in the command line.

                 

                Peter

                  • Re: Passing parameters in Supporting Tasks

                    Hello!

                     

                    • Yes, I can assign multiple triggers, but then my receiving script won't know which trigger that was triggered?
                    • I operate a publisher, how do I embed the failure details in the command line? I (quickly) read the help but did not see that?
                    • Finally, my example was just an example, in reality i have 100+ tasks, and adding/maintaining triggers for all of them is a hassle. Therefore a */catchall "on failure" with a parameter of which task that failed would be a really nice thing to have.


                    Thanks for taking your time to reply.

                    /Sebastian


                      • Re: Passing parameters in Supporting Tasks
                        Peter Cammaert
                        • True, that's the tradeoff for not having to create 100+ additional and almost identical failure registration tasks.
                        • I don't know. You are free to put anything in the command line that is acceptable to the program you try to run. Suppose your command line says something like this: C:\Program Files\Report\Report.exe -msg="ABC", then you can adjust the msg parameter for every other task you need to trigger. Of course this only works if you keep to the 100+ additional failure registration tasks.
                        • I do believe that this is a major hassle. But unfortunately there is no standard solution available as you describe. Maybe you can request a new QlikView Server feature in Ideas

                         

                        I guess you could use the management API to create a task monitoring tool that checks for task failures and reports them in a generalized way. But I'm sure that building your own tool is part of range of possible solutions you are envisioning...

                         

                        Best,

                         

                        Peter