Java Job Run from Gel Script in CAPPM

Blog Post created by SupratikUBS on Dec 9, 2018

Sometimes we require to run a Java Job in CAPPM using a gel script where we can change the parameters of the job on run time.


This can be achieved by a small code snippet which runs the XBL Executor in Gel and passes the parameter to the job.


The code goes here:


<gel:script xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
xmlns:soapenv="" xmlns:sql="jelly:sql" xmlns:util="jelly:util" xmlns:xog=""
xmlns:xsd="" xmlns:xsi="">

<core:catch var="excp">
<gel:parse var="inputDoc">

<!--job_name you can give any meaningful name and job_definition_id has to be the id of the job you want to run -->
<job job_name="Delete Process Instance-Supratik(Port Sync Java)" job_definition_id="50420" job_definition_type="JOB" recurrence_type="4" whenNow="1" whenRecur="1" />

<!-- Put the bind parameter code from the Job Definition pass the value in the similar format mentioned below-->
<param_process_name value="Portfolio Sync from Java"/>




<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:invoke method="executeXBL" on="${xblInstance}" var="responseDoc"/>
<gel:log>Response Doc : <gel:expr select="$responseDoc"/> </gel:log>


Thanks and Regards,



Kindly comment if you find it useful.