Script Tasks and input and output variables

  • is there any way in a script task to find out the actual variable names that were specified as readonly and readwrite? I looked at the readonly property, but it seems to be false for all of them.

    I get the feeling I'm missing something.

    Thanks
    Luther

  • latkinson - Friday, January 26, 2018 6:47 AM

    is there any way in a script task to find out the actual variable names that were specified as readonly and readwrite? I looked at the readonly property, but it seems to be false for all of them.

    I get the feeling I'm missing something.

    Thanks
    Luther

    Why do you want to do this?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Mostly I want to know for personal education and understanding, but it seems to me, that knowing what variables were provided outsite the task could improve re-usability by allowing the task and to be more generic.

  • latkinson - Monday, January 29, 2018 6:45 AM

    Mostly I want to know for personal education and understanding, but it seems to me, that knowing what variables were provided outsite the task could improve re-usability by allowing the task and to be more generic.

    To be generic, don't use read-only or read-write variables at all. Instead make appropriate calls to the VariableDispenser class.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Makes sense. Thanks!

  • I might be missing something as the question seems straightforward, but are there two lists accessed via the interface.  One list is the read only variables, the other the read write variables?  I don't work with the script task often, but I do remember something like that because I've had to move variables to one or the other.

  • True, but if you are trying inside the code to know or identify which is which by properties, methods, etc. the option doesn't exist yet.

  • RonKyle - Tuesday, January 30, 2018 7:22 AM

    I might be missing something as the question seems straightforward, but are there two lists accessed via the interface.  One list is the read only variables, the other the read write variables?  I don't work with the script task often, but I do remember something like that because I've had to move variables to one or the other.

    True, but if your script task 'does not know what these variables are, nor whether they are read-only or read-write', I'm not sure how you would write 'generic' code to determine that – in fact, I cannot think of any practical reason why you would bother.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • OK, I see.  You knew the list was there, you just wondered if there was a way to determine that in code.  Can't think of a scenario for that, as it seems to be an extra check on something that should be known before the code is written, but my inability to think of one doesn't mean one doesn't exist.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply