conditional handling of gel_objectInstanceId parameter in GEL script

Discussion created by beekerc2 on Oct 12, 2010
Latest reply on Oct 12, 2010 by mark
I have a GEL script that performs a set of tasks when a project is created.I associate with the project object, set the trigger to the Create event.I use gel_objectInstanceId in the GEL script to query data from the project object instance to use XOG to create sub-object instances.           select from inv_investments where id = ${gel_objectInstanceId}  Hvaing seen how the process engine can get twitchy sometimes, I'm trying to contend with the possibilty that over time there may be projects that don't have their sub-objects created because of a process error or the process didn't launch.   As such, I'd like to use the same GEL script, defined as a different on-demand process, but have it process all projects, not just the one.   However, in a non-object linked, on-demand process, the paramter gel_objectInstanceId, either does not exist or is null.   What i'd like to do is this.           if ${gel_objectInstanceId} is null or does not exist then                            else                            endif  then change the SQL  query  to read           select from inv_investments where (${project_id} = 0) or (${project_id}   0 and id = ${project_id})  this way i won't have to maintain two code trees.  can this even be done?   I'm not clear on how GEL handles null state variables, so i'm looking for some advice.THanksB