public ActivityImpl createActivity(String activityId) {
ActivityImpl activity = new ActivityImpl(activityId, processDefinition);
if (activityId!=null) {
if (processDefinition.findActivity(activityId) != null) {
throw new PvmException("duplicate activity id '" + activityId + "'");
}
namedActivities.put(activityId, activity);
}
activity.setParent(this);
activities.add(activity);