Dear experts ,
I am in dire need of help.
In my portal I have a GP (Proccess , Block , Action)
From Web Dynpro I need to get the runtime value of a attribute in the action.(that is currently being processed)
For this currently I first get the runtime manager
IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager(); IGPDesigntimeManager dtm = GPProcessFactory.getDesigntimeManager() ; IGPUserContext userContext = this.getUserContext();
Then I get the activities for the process
IGPProcessInstanceInfo[] processInstanceInfoArray = rtm.getRunningInstances(GPSearchRole.SEARCH_ROLE_OWNER, java.sql.Date.valueOf("2008-08-01") , java.sql.Date.valueOf("2008-08-10"), userContext);
for (int i=0; i<processInstanceInfoArray.length; i++)
{
messageMgr.reportSuccess("Nr. Actions: " + processInstanceInfoArray<i>.getTotalNumberOfActions() );
IGPProcessInstance processInstance = rtm.getProcessInstance(processInstanceInfoArray<i>, userContext);
messageMgr.reportSuccess("ID processInstance: " + processInstance.getID() );
IGPBlockInstance blockInstance = (IGPBlockInstance)processInstance.getChildrenInformation()[0];
messageMgr.reportSuccess("ID blockInstance: " + blockInstance.getID() );
IGPActivityInstance[] activityInstance = blockInstance.getChildrenInformation();
messageMgr.reportSuccess("getChildrenInformation: " + activityInstance.length);
Then I try to read the attributes
for( int j=0; j<activityInstance.length; j++)
{
messageMgr.reportSuccess("ID activityInstance: " + activityInstance[j].getID());
messageMgr.reportSuccess("isAction: " + activityInstance[j].isAction() );
messageMgr.reportSuccess("isBlock: " + activityInstance[j].isBlock() );
IGPActionInstance actionInstance = rtm.getActionInstance(processInstance.getID(), activityInstance[j].getID() , userContext); //blockInstance.getDecisionActionInformation();
messageMgr.reportSuccess("ID actionInstance: " + actionInstance.getID());
Collection collectionAttr = actionInstance.getTemplate().getInputParameters().getAttributes();
Iterator itr = collectionAttr.iterator();
while(itr.hasNext())
{
IGPAttributeInfo attr = (IGPAttributeInfo)itr.next();
messageMgr.reportSuccess("attr: " + attr.toString() );// this works
messageMgr.reportSuccess(attr.getStructureInfo().toString());
IGPStructureInfo structureInfo = attr.getStructureInfo();
Collection output = structureInfo.getStructures();
Iterator itr2 = output.iterator();
while(itr2.hasNext())
{
IGPStructureInfo str = (IGPStructureInfo)itr2.next();
IGPStructure structure = GPStructureFactory.getStructure(str);
messageMgr.reportSuccess("str: " + structure.toString() );
//IGPAttributeInfo attr3 = str.getAttributeValues();
//Collection output3 = str.getAttributeValues(attr.getTechName());
//Iterator itr3 = output3.iterator();
//while(itr3.hasNext())
//{
// IGPAttributeInfo attr3 = (IGPAttributeInfo)itr.next();
// messageMgr.reportSuccess("attr3: " + attr3.toString());
// }
}
}
}
This brings me the attribute name but the attribute value shows up as null and not the value that is specified at runtime (u201C123u201D).
What changes do I need to do in order for this to work properly?
Thank you in Advance,
Evandro