/** * Set source and target of association. */ public Object postProcess(IContext context, Object object) { MBpmnModel dia = (MBpmnModel)context.getRootObject(); MAssociation asso = (MAssociation)object; MArtifact source = (MArtifact)dia.getAllAssociationSources().get(asso.getId()); MAssociationTarget target = (MAssociationTarget)dia.getAllAssociationTargets().get(asso.getId()); if(source==null) throw new RuntimeException("Could not find association source: "+source); if(target==null) throw new RuntimeException("Could not find association target: "+target); asso.setSource(source); asso.setTarget(target); source.addAssociation(asso); target.addAssociation(asso); return null; }
/** * Set source and target of association. */ public Object postProcess(IContext context, Object object) { MBpmnModel dia = (MBpmnModel)context.getRootObject(); MAssociation asso = (MAssociation)object; MArtifact source = (MArtifact)dia.getAllAssociationSources().get(asso.getId()); MAssociationTarget target = (MAssociationTarget)dia.getAllAssociationTargets().get(asso.getId()); if(source==null) throw new RuntimeException("Could not find association source: "+asso.getId()); if(target==null) throw new RuntimeException("Could not find association target: "+asso.getId()); asso.setSource(source); asso.setTarget(target); source.addAssociation(asso); target.addAssociation(asso); return null; }