cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mega Api Java : Problems to get linked collection of SequenceFlow type

Accelinn
New Contributor

Hello,

 

I use Mega API to communicate via Java Application ( I'm include Mega Vocabulary in my projects ).

 

I'm retreive all mega object like "Business Process", "Organizational Process" etc... And i navigate to linked collection like this :

Example of working java code

But when i try to get predecessor/successor of sequenceFlow megaObject, Mega API return me empty list...

 

Not working java code

public static final String MAE_Successor = "~jqV6ztHL71M0[Sequence Flow.Successor]";
public static final String MAE_Predecessor = "~2sV6luHL79O0[Sequence Flow.Predecessor]";

 

When i check the sequence Flow element in the Mega Repository, he has only one predecessor/successor. But MegaApi return me empty list.

 

When i launch :

 

sequenceFlow.isMemberName(MegaSequenceFlow.MAE_OwnerElement); => resutl is True

sequenceFlow.isMemberName(MegaSequenceFlow.MAE_Predecessor); => result is True

 

sequenceFlow.getAttribute(MegaSequenceFlow.MAE_Predecessor); => return null

sequenceFlow.getCollection("TestHackValue") => Launch exception

sequenceFlow.getCollection(MegaSequenceFlow.MAE_Predecessor).size() => 0 return empty list !!!!!!

 

It's a bug in Mega API ?

Can someone help me ?

Accelinn IT
3 Replies

farhad
MEGA Partner
MEGA Partner
 

I am new to filters: but i usually just use oRoot.GetSelection("") to get specific type of objects. 

gquiniou
Retired

Hi

mgObject.Getcollection("Owned Element") returns objects of the abstract metaclass "BPMN Owned Element".

You can filter this result to retain only sequence flow objects:

Megacollection mgColelction = mgObject.getCollection(BusinessProcess.MAE_OwnedElement).Filter("~jsV6VsHL7vJ0[Sequence Flow] ");

 

Best regards

 

Gregory