Can a Custom Process be triggered from the Custom Script in one identity manager?

Hi,

It is known that a custom script can be invoked from a process by passing the script name and input parameters.

But I have a requirement in which I have a custom script in place. I need to call or trigger the process execution from the script code. Is it feasible in One Identity 8.0.5 or higher versions?

Your kind response will be much appreciable. Thank you.

Regards,

Jilani Basha

  • Hi,

    In order to run a process from a script you have to generate the event that generates the process:

    If you need to pass parameters to the process you will need a Dictionary e.g.:

    Dim strSplitClause As String = "1=1"
    Dim pc As New Dictionary(Of String, String)(StringComparer.OrdinalIgnoreCase)
    pc("SplitClause") = strSplitClause

    Then use this code to generate the event:

    VI.DB.JobGeneration.JobGen.Generate(Connection.CreateSingle("AttestationPolicy", pol.GetValue("UID_AttestationPolicy").String), "CCC_AttestationPolicy_Generate_Attestations", pc)

    In the above example I am firing the event:  CCC_AttestationPolicy_Generate_Attestations

    Against the table:  AttestationPolicy

    For the object:  Connection.CreateSingle("AttestationPolicy", pol.GetValue("UID_AttestationPolicy").String)

    (It has to be an iSingleDbObject)

    With the parameters defined in:  pc (used in the process with code $PC(<parameter>)$ )

    HTH, Barry.

  • Just as an addition to the solution from .

    Here the code sample to generating an event using the current iEntity interface (not the older iSingleDBObject interface which would still work).

    Dim myEntity As IEntity = Session.Source.Get("<Tablename>", existingUID)
    
    Dim htParameter = New Dictionary(Of String, Object)(StringComparer.OrdinalIgnoreCase) ' Dictionary for any additional parameters
    ' Add any additional parameters.
    htParameter.Add("<ParameterName>", <Value>)
    
    Using uow As IUnitOfWork = Session.StartUnitOfWork()
    	' Generate event 'myevent'
    	uow.Generate(myEntity, "myevent", htParameter)
    	' Commit the changes
    	uow.Commit()
    End Using

  • This is a nice example that shows how to trigger a process from a script and how to pass additional information (parameters) to the process with a Dictionary. Is there also a way to pass additional information to the process when it is triggered from a Process automation?

  • In Process automation you can specify Parameters that are passed to the process when it is generated: