Is it possible through a process to pass the entire pram collection to a script?

I have a script that have lots of attributes as inparameters. I have taken those and created a param collection and passed that to a process. In that process, I want to take the entire param collection and pass it to another script.

I've seen, and used, individual attributes from a param collection, but now I want to pass along the entire param collection.

/Henrik

  • A PC (parameter collection) is passed during the generation of the process and every process step is able to access them. You do not need to pass the collection around.

    Maybe I misunderstood your use-case. If so, please let me know.

  • If I have a script that take one parameter and I want to pass along one attribute from the param collection I write $PC(PwdErrors)$. If my one inparameter in my script is a collection, how do I wirte then? Neither $PC or $PC$ seems to be working

  • So the real question is, how to access the complete parameter collection in a script. Correct?

  • The real question (if it is somehow unclear) is how do I pass a param collection from a script to a process and to another script?

  • What you can do, is to access the complete parameter collection in a script. The parameter collection includes all out parameters set by previous process steps executed.

    What you need to do, is to set the parameter PassParametersAndResult to True at the ScriptExec task.

    Your script then needs the following signature for the first two parameters:  (parameters As JobParameters, result As JobResult)

    You can then access the parameter collection in the script and even add some more for the following tasks.

    A sample script would look like this:

    Public Sub SDK_ScriptExec_PassParameterAndResult(parameters As JobParameters, result As JobResult)
        ' Access available job parameters. These include out parameters from previous process steps.
        For Each parameter As JobProcessing.JobParameter In parameters.Values
            AppData.Instance.RaiseMessage(MsgSeverity.Info, String.Format("Parameter {0}={1} with flags {2}", parameter.Name, parameter.Value, parameter.Flags.ToString()))
        Next
    
    	
    	' Do something here
    	
    	
    	
        ' Add additional out parameters to be available in sub-sequent process steps
        result.OutParameters.Add(New JobProcessing.JobParameter("OutValue", "One Identity Manager"))
        result.OutParameters.Add(New JobProcessing.JobParameter("OutValueDate", Date.UtcNow))
        result.OutParameters.Add(New JobProcessing.JobParameter("OutValueBool", True))
        result.OutParameters.Add(New JobProcessing.JobParameter("OutValueHidden", "SECRET") With {.Flags = JobParameterFlags.Hidden})
    End Sub
    

    HtH