Sfoglia il codice sorgente

Clicking the "Start New..." enactment button opens WEE in a new tab

Joeri Exelmans 2 anni fa
parent
commit
cf5bc6a761
1 ha cambiato i file con 9 aggiunte e 7 eliminazioni
  1. 9 7
      src/main/webapp/myPlugins/dtdesign.js

+ 9 - 7
src/main/webapp/myPlugins/dtdesign.js

@@ -150,12 +150,6 @@ const typeToLinkType = new Map([
       description: (element, type) => `Has port ${type}`,
     },
   ]],
-  ["processtraces#Artifact", [
-    {
-      relation: "processtraces#hasLocation",
-      description: (element, type) => `Filename ${element}`,
-    },
-  ]],
   ["pm#element", [
     {
       relation: "processtraces#relatesTo",
@@ -168,6 +162,11 @@ const typeToLinkType = new Map([
       relation: "processtraces#relatesTo",
       description: (element, type) => `Enactment of ${element}`,
     },
+    // pt-element is not a sub-type of 'Object', so we must repeat this:
+    {
+      relation: "cs_as#renderedAs",
+      description: (element, type) => `Is rendered as ${type}`,
+    },
   ]],
   ["pm#Artifact", [
     {
@@ -648,9 +647,12 @@ fetch(BACKEND+"/version")
 
   const extraPMstuff = modelName => {
     if (modelName.endsWith(":pm")) {
-      const enactButton = mxUtils.button("Start New", ()=>{});
       const pmModel = addArtifactPrefix(modelName.substr(0, modelName.length-3)+"_pm#model");
       const urlEncoded = encodeURIComponent(pmModel);
+      const enactButton = mxUtils.button("Start New...", ()=>{
+        // open WEE in new tab:
+        window.open(WEE+"/gettraces?iri="+urlEncoded, "_blank");
+      });
       const shortTraceName = traceIri => dropArtifactPrefix(traceIri).split('#').findLast(str => str.length > 0);
       return Promise.all([
         fetch(WEE+"/traces/active/"+urlEncoded)