void setFlowActivityLinks(Flow flow, CtMethod<?> flowMethod, Activity activity){
HashMap<String,Link> linkMap = new HashMap<String,Link>();
FlowActivity flowActivity = flowMethod.getAnnotation(FlowActivity.class);
if (flowActivity != null){
if (flowActivity.targets().length > 0){
Targets targets = BPELFactory.eINSTANCE.createTargets();
activity.setTargets(targets);
for(int i=0; i < flowActivity.targets().length; i++){
FlowLinkTarget linkTarget = flowActivity.targets()[i];
if (!linkTarget.name().equals("")){
Link link = linkMap.get(linkTarget.name());
if (link == null){
link = BPELFactory.eINSTANCE.createLink();
link.setName(linkTarget.name());
linkMap.put(linkTarget.name(), link);
flow.getLinks().getChildren().add(link);
}
Target target = BPELFactory.eINSTANCE.createTarget();
target.setLink(link);
target.setActivity(activity);
targets.getChildren().add(target);
}
}
}
if (flowActivity.sources().length > 0){
Sources sources = BPELFactory.eINSTANCE.createSources();