How to convert job trigger event to add event

I am using Scripting driver. I have one job attached to the driver. I need to convert job trigger event to add/modify event as Scripting driver does not support job trigger event. I will appreciate if someone provide some guidance how to convert job trigger event to add event. I think I can do this in Output transformation policy but not sure how to achieve this. Thanks 

  • 0  

    Jobs all start in the subscriber thread, sort of.  I think they actually run in their own thread, but they submit the <trigger> event into the Sub thread processing flow.

    So start with this is the Subscriber thread.  The first chance you get to capture it is in the Event Transform.

    So in your sub-event check for If Operation= trigger, you can get the @source-name and the DN of the target of the Job.  (Could be an OU, could be an object, depends how you config it).

    By definition, no drivers really support Jobs they all have to add support a <trigger> event and convert it  into something else.  Which is what you are going to do then.

  • 0 in reply to   

    Thanks, Geoffrey. How should I convert trigger event to add  ?

  • 0   in reply to 

    A trigger does not make sense as an add...

    Unless you point the Job object at a container, and want to add all the children of the OU every time the Job runs?  That does not really make a lot of sense.

    How would your Job define the objects info?  Jobs have really just a name, and a target object in the IDV. (Why not sync the object from the IDV then?)

  • Suggested Answer

    0   in reply to   

    I had the case with a customer that a container with groups had to be synchronized daily by a driver (please don't ask why). I solved this with a job and a policy in the sub-etp which converted the trigger event into a "sync" event.

    edit: Was used in a loopback driver

    The sync event then automatically becomes an ADD (or Modify if Assoc exists)

    This is my policy in the event block

    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE policy PUBLIC "policy-builder-dtd" "/opt/netiq/designer/plugins/com.novell.idm.policybuilder_4.0.0.202306212152/DTD/dirxmlscript4.8.7.dtd"><policy>
    	<description>Wandelt das "Trigger"-Event zu einem "Sync"-Event für die weitere Verarbeitung um. Dadurch werden Gruppenmitgliedschaften für Gruppen erneut berechnet.
    </description>
    	<rule>
    		<description>break if irrelevant event</description>
    		<comment xml:space="preserve">only relevant for the job 'handleTriggerToSync'</comment>
    		<conditions>
    			<or>
    				<if-operation mode="nocase" op="not-equal">trigger</if-operation>
    				<if-op-property mode="nocase" name="source" op="not-equal">handleTriggerToSync</if-op-property>
    			</or>
    		</conditions>
    		<actions>
    			<do-break/>
    		</actions>
    	</rule>
    	<rule>
    		<description>Create sync event for each triggered object</description>
    		<comment name="author" xml:space="preserve">alekz</comment>
    		<comment name="version" xml:space="preserve">1.0</comment>
    		<comment name="lastchanged" xml:space="preserve">2010-08-29</comment>
    		<conditions>
    			<and>
    				<if-src-dn op="available"/>
    				<if-operation mode="case" op="equal">trigger</if-operation>
    				<if-op-property mode="nocase" name="source" op="equal">handleTriggerToSync</if-op-property>
    			</and>
    		</conditions>
    		<actions>
    			<do-append-xml-element expression=".." name="sync"/>
    			<do-set-xml-attr expression="../sync[last()]" name="class-name">
    				<arg-string>
    					<token-class-name/>
    				</arg-string>
    			</do-set-xml-attr>
    			<do-set-xml-attr expression="../sync[last()]" name="src-dn">
    				<arg-string>
    					<token-src-dn/>
    				</arg-string>
    			</do-set-xml-attr>
    			<do-set-xml-attr expression="../sync[last()]" name="qualified-src-dn">
    				<arg-string>
    					<token-xpath expression="@qualified-src-dn"/>
    				</arg-string>
    			</do-set-xml-attr>
    		</actions>
    	</rule>
    	<rule>
    		<description>Veto trigger</description>
    		<comment name="author" xml:space="preserve">alekz</comment>
    		<comment name="version" xml:space="preserve">1.0</comment>
    		<comment name="lastchanged" xml:space="preserve">2010-08-29</comment>
    		<conditions>
    			<and>
    				<if-operation mode="case" op="equal">trigger</if-operation>
    			</and>
    		</conditions>
    		<actions>
    			<do-veto/>
    		</actions>
    	</rule>
    </policy>

  • 0 in reply to   

    Thanks, this is what I was looking for.