Skip to Content
avatar image
Former Member

Why Array is showing null value?


I am using following code for Due date notification, but array is returning null

array.length is zero


// create a duration of one hour

// IGPDuration duration = GPNotificationFactory.createDuration(1,14);

IGPDuration duration = GPNotificationFactory.createDuration(1, IGPDuration.DURATION_MINUTE);

//create a deadline with duration one hour (start date is current system time)

IGPDeadline deadline2 = GPNotificationFactory.createDeadline(

IGPDeadline.DEADLINE_FROM_ACTION_START, duration, System.currentTimeMillis(),0);



IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();

Calendar cal = Calendar.getInstance();

java.sql.Date jsqlD = new java.sql.Date(cal.getTime().getTime());

IUser user = UMFactory.getUserFactory().getUserByLogonID("mrityunjay");

wdComponentAPI.getMessageManager().reportSuccess("user: "+user);

//String processId= executionContext.getProcessId();

//IWDClientUser wdUser = WDClientUser.getCurrentUser();

//IUser user =wdUser.getSAPUser();

IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user);

wdComponentAPI.getMessageManager().reportSuccess("user: "+userContext);

IGPProcessInstanceInfo[] array = rtm.getRunningInstances(GPSearchRole.SEARCH_ROLE_OWNER,jsqlD , jsqlD,userContext);

wdComponentAPI.getMessageManager().reportSuccess("arraylength outside loop: "+array.length);

for (int i=0; i<array.length; i++)


wdComponentAPI.getMessageManager().reportSuccess("arraylength inside loop: "+array.length);

String instanceId = array<i>.getProcessInstanceID();

IGPProcessInstance instance = rtm.getProcessInstance(instanceId, userContext);




catch (Exception e)


//wdComponentAPI.getMessageManager().reportSuccess("exp in terminal: "+e);



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Aug 27, 2007 at 11:17 PM

    Hello Yogesh,



    I think you are missing the array index in your code.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Austin

      Thanks for reply.

      Before the 'for' loop I am not getting the value in array.

      I mean that array length is zero before loop