ActionCode.pattern.metamodel 967 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {
  2. "types": {
  3. "__pCode": [
  4. {
  5. "name": "__pLabel",
  6. "type": "string",
  7. "default": ""
  8. },
  9. {
  10. "name": "__pMatchSubtypes",
  11. "type": "boolean",
  12. "default": false
  13. },
  14. {
  15. "name": "imports",
  16. "type": "code",
  17. "default": "getAttr()"
  18. },
  19. {
  20. "name": "body",
  21. "type": "code",
  22. "default": "getAttr()"
  23. }
  24. ]
  25. },
  26. "constraints": [],
  27. "actions": [
  28. {
  29. "name": "distinctPLabels",
  30. "event": "post-create",
  31. "code": "if( getAttr(\"__pLabel\") == \"\" )\n{\n\tvar pLabels = getAllNodes().\n\t\t\t\t\t\t\tfilter( function(n) {return hasAttr(\"__pLabel\",n);} ).\n\t\t\t\t\t\t\t\tmap( function(n) {return getAttr(\"__pLabel\",n);} ),\n\t\t i\t\t\t= \"0\";\n\n\twhile( _utils.contains(pLabels,i) )\n\t\ti = String(parseInt(i)+1);\n\tsetAttr(\"__pLabel\",i);\n}",
  32. "targetType": "*"
  33. }
  34. ],
  35. "cardinalities": {
  36. "__pCode": []
  37. },
  38. "legalConnections": {},
  39. "connectorTypes": {},
  40. "types2parentTypes": {
  41. "__pCode": []
  42. }
  43. }