Skip navigation
All Places > Clarity PPM > Blog > 2018 > April > 02

All,

 

Running / Scheduling a Job in CA PPM through Gel Script is possible with very simple code. Here you go.

 

<gel:script xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"  >
    <gel:parse var="inputDoc">
        <data>
            <job job_name="Delete Process Instance" job_definition_id="50420"
                job_definition_type="JOB" recurrence_type="4" whenNow="1" whenRecur="1" >
            </job>
        </data>
    </gel:parse>
    <core:catch var="excp">
        <core:new className="com.niku.odf.object.xbl.XBLExecutor" var="xblInstance">
            <core:arg value="scheduler/postSchedulerProperties.xbl"/>
            <core:arg value="nmc"/>
            <core:arg value="${inputDoc}"/>
        </core:new>
        <core:invoke method="executeXBL" on="${xblInstance}" var="responseDoc"/>
    </core:catch>
    <gel:log>Response Doc : <gel:expr select="$responseDoc"/> </gel:log>
    <gel:log>Exception: ${excp} </gel:log>
</gel:script>

 

 

The above code is just for demonstration purpose and it immediately schedules "Delete Process Instance" job to run immediately. There are additional attributes as well as sub elements of "data" element through which we can either schedule any job just the way we do it through UI.

Note: Many hacks into ca ppm are possible with XBLs