for (Activity act : activitiesToAnalyze_copy) {
ActivityDecorator actDec = null;
try {
actDec = (ActivityDecorator) decFactory.getDecorator(act);
} catch (ClassNotFoundException e) {
throw new TranslationException(this, "Unable to compute activities' dependencies.", e);
} catch (InvalidContextException e) {
throw new TranslationException(this, "Unable to compute activities' dependencies.", e);
}
// create or get the info object associated to the activity
ActivityInfo actInfo = activitiesInfo.get(act);
if (actInfo == null) {
actInfo = new ActivityInfo(act, decFactory);
activitiesInfo.put(act, actInfo);
}
Set<CallBehaviorAction> invocationActions = actDec.getInvokeActions();
for (CallBehaviorAction invokeAct : invocationActions) {
if (invokeAct.getBehavior() instanceof Activity) {
actInfo.addDependency((Activity) invokeAct.getBehavior());
activitiesToAnalyze.add((Activity) invokeAct.getBehavior());
} else throw new TranslationException(this, "Unable to compute activities' dependencies : activity \"" +
act.getQualifiedName() + "\" invokes the external behaviour \"" + invokeAct.getQualifiedName() +
"\" which is not itself an activity.");
}
activitiesToAnalyze.remove(act); // remove this activity from the set of activities to analyze