Skip to content

Instantly share code, notes, and snippets.

View pavelsid's full-sized avatar

Pavel Sidorov pavelsid

  • K2IT LLC
  • Moscow, Russia
View GitHub Profile
@jbsarrodie
jbsarrodie / ConvertConcept.lib.js
Last active May 23, 2022 12:44
#jArchi script to change concepts' type (and optionally convert no more valid relationships to association)
function convert(selection, convertToType) {
var relaxed = window.confirm('By default, selected concepts are converted, and relationships involving them that would no more be valid are converted to associations. Click Ok for this behavior or Cancel if you want a "strict" mode where relationships are not changed.');
$(selection).each(function(o) {
$(concept(o)).outRels().each(function(r) {
if (! $.model.isAllowedRelationship(r.type, convertToType, r.target.type)) {
checkAndConvertRelationship(r, relaxed);
}
});
$(concept(o)).inRels().each(function(r) {