Clarity

Expand all | Collapse all

launching a job or report from GEL script

Anon Anon

Anon AnonAug 31, 2011 02:31 AM

  • 1.  launching a job or report from GEL script

    Posted Oct 12, 2010 07:07 AM
    Does anyone know how to run a job or report, with parameters, from within a GEL script?    


  • 2.  Re: launching a job or report from GEL script

    Posted Oct 12, 2010 07:07 AM
    i would find this very handy to do...  anyone?  [edits: spelling] Message Edited by samos on 20-01-2010 02:28 PM [left]


  • 3.  Re: launching a job or report from GEL script

    Posted Oct 12, 2010 07:07 AM
    To give an example, lets set aside what i'm suggesting is akin to handing someone a can of gasoline and a bic lighter, this is what i'm looking to do.  The Purge Financial Tables job takes one project at a time when it runs.I want to write a GEL script that makes a SQL call to get the code and name of all the projects in the system.Via XOG i will close and inactive the project, close it for time entry and make it financially inactive.I then want to launch the Purge Financial Table job and pass it the project code as a parameter.once this i all done, i can mark the projects for deletion in the project list view screen and then run the delete investements job manually.  Any thoughts on how i can run the PFT job from GEL?ThanksB


  • 4.  RE: Re: launching a job or report from GEL script

    Posted Oct 12, 2010 07:08 AM
    Try something like this

    include this in your headder
    <gel:script xmlns:bpm="jelly:com.niku.bpm.gel.BPMTagLibrary"

    use this to run it.

    <bpm:startProcess initObjectId="${v_tcid}"
    initObjectKey="${proc.rows[0].object_name}"
    initUserId="${user.rows[0].id}" processVersionId="${proc.rows[0].process_version_id}"/>


  • 5.  RE: Re: launching a job or report from GEL script

    Posted Aug 29, 2011 12:41 PM
    Hi beekerc2,

    I am looking to do a similar thing which you mention here. Please convey if you have found a solution to execute a job from a gel script.

    Thanks and Regards,
    Rajini


  • 6.  RE: launching a job or report from GEL script
    Best Answer

    Posted Oct 22, 2010 06:48 PM
    [color=#121E9C][size=4][font=Arial]Hi beekerc2,

    This exact option was the subject of a very interesting CA World 2010 seminar/lab named web services integrations within CA ClarityTM PPM conducted by Lasr Seibert from CA. It shows how to use WSDL in GEL scripting to call/execute Clarity jobs, reports processes, reports and queries. It is well laid out and easy to follow. Click on the links to get the documentation.

    I hope this helps.

    Patrick
    [font][size][color]


  • 7.  RE: Re: launching a job or report from GEL script

    Posted Aug 31, 2011 02:31 AM
    broken link


  • 8.  RE: Re: launching a job or report from GEL script

    Posted Oct 06, 2011 03:51 PM
    Patrick,
    Your post is excellent, and helps a lot. I was able to obtain the pdf from the webmeister at CA, and we got much further. We can now launch the process. The remaining issue is how to pass a parameter to the process. The process is executable on demand, but project is the primary object, so we need to be able to pass along a project id.

    Can anyone shed light on this? Or does anyone have contact information for the author of the paper?

    I am uploading the pdf file to this thread for others.


  • 9.  RE: Re: launching a job or report from GEL script

    Posted Oct 07, 2011 02:58 AM
    The process is executable on demand
    So the processes is associated with the PROJECT object and you start it from the 'available processes' under a project?

    ...in which case the GEL script 'knows' which project instance you are running against and the project ID is just in the ${gel_objectInstanceId} variable?


  • 10.  RE: Re: launching a job or report from GEL script

    Posted Oct 07, 2011 02:43 PM
    No the process is launched from another process which queries the database looking for projects that meet certain criteria. For each of those projects, it wants to launch a new process. That new process would not be started from the available processes under a project, rather it would be launched as though started from the Organizer -> Processes -> Available Processes. This could work fine if we could find a way to pass a parameter (project ID) to that process since we can't associate the process with the project object instance.


  • 11.  RE: Re: launching a job or report from GEL script

    Posted Oct 07, 2011 11:17 AM

    suep wrote:

    No the process is launched from another process which queries the database looking for projects that meet certain criteria.
    OK right - sorry I don't immediately know how you would do this; perhaps store the project id on the database in the "driving process" and retrieve it from the database in the "called process", but there must be a neater way of doing this sort of thing.


  • 12.  Re: launching a job or report from GEL script

    Posted Feb 20, 2015 04:12 PM

    So if the first process is launched via invokeAction WSDL, you should be able to just pass the data (as XML) into the process via the invokeAction within the <request> tag.

     

    Gel access to WSDL Process InvokeAction content

     

    Also take a look the the gel:getDocument / gel:setDocument tags for passing / setting request  information for processes.

     

    Once you have the data, you should be able to persist using gel:persist global which would make it available for any downstream processes.

     

    V/r,

    Gene



  • 13.  RE: Re: launching a job or report from GEL script

    Posted Oct 10, 2011 04:01 PM
    might be an idea, but what about a variant of this at least as an option to consider:

    1 using the first process / query that you already have, once you have the set of projects, xog in a project update to variable (A) below to each project that matches the query, using only xog in of project code, project name, and project_A variable.
    2 have a hidden variable on the project object (A), eg a lookup, or a boolean if it is a once off.
    3 have a second project-based process that starts on project-update and based on variable (A) when it is set to (1), where previously it was set to (0).
    4 do what you need to do within this second process, and then reset the project_A variable to (0) again.

    of course the above approach does need to take into consideration the performance aspect of having a process firing on a project update event. but that's for you guys to consider.


  • 14.  RE: Re: launching a job or report from GEL script

    Posted Oct 11, 2011 12:04 PM
    I got so excited when I saw your post, thank you very much!!! It works!!!! I have been struggling with this for DAYS.-_-


  • 15.  RE: Re: launching a job or report from GEL script

    Posted Oct 23, 2011 05:29 PM
    glad to hear!


  • 16.  RE: Re: launching a job or report from GEL script

    Posted Jan 05, 2012 11:49 AM

    Kknn wrote:

    Do you also have the wsdl file for Clarity WSDL Definitions? The link in the PDF is broken (http://clarityserver/niku/wsdl).
    the link in the PDF is meant to tell you to go to that URL on YOUR Clarity server;

    i.e. if you access YOUR Clarity system via

    http://[color=#ff0000]myclarityserver[color]/

    then go to

    http://[color=#ff0000]myclarityserver[color]/niku/wsdl

    :happy


  • 17.  RE: Re: launching a job or report from GEL script

    Posted Jan 05, 2012 02:25 PM

    Dave wrote:

    Kknn wrote:

    Do you also have the wsdl file for Clarity WSDL Definitions? The link in the PDF is broken (http://clarityserver/niku/wsdl).
    the link in the PDF is meant to tell you to go to that URL on YOUR Clarity server;

    i.e. if you access YOUR Clarity system via

    http://[color=#ff0000]myclarityserver[color]/

    then go to

    http://[color=#ff0000]myclarityserver[color]/niku/wsdl

    :happy
    Yes, I figured that out after a while =)

    Thanks!


  • 18.  Re: launching a job or report from GEL script

    Posted Feb 20, 2015 03:11 AM

    Hi Patrick,

     

    I could not see the PDF file in this thread, could you please upload it once for me ?

     

    Regards,

    Mathan



  • 19.  Re: launching a job or report from GEL script

    Posted Feb 20, 2015 09:50 AM

    Matt114 wrote:

     

    Hi Patrick,

     

    I could not see the PDF file in this thread, could you please upload it once for me ?

     

    Regards,

    Mathan

     

    Mike reposted that PPT here ; CA World 2010 - web services integrations within CA ClarityTM