From f8856d06491c83410ae2f34f04358d90114740d9 Mon Sep 17 00:00:00 2001 From: Xiwen Cheng Date: Wed, 15 Apr 2026 21:38:23 +0200 Subject: [PATCH] more memory optimizations --- mpr/export_stream.go | 30 +- mpr/microflow.go | 275 +--------------- mpr/microflow_test.go | 66 +--- mpr/mpr.go | 118 ++++--- mpr/mpr_test.go | 48 +-- mpr/types.go | 58 +--- mpr/utils.go | 135 ++++---- resources/modelsource-v1/Metadata.yaml | 293 ++---------------- ...flowComplexSplit.Microflows$Microflow.yaml | 201 +++--------- ...MicroflowForLoop.Microflows$Microflow.yaml | 115 ++----- .../MicroflowLoop.Microflows$Microflow.yaml | 145 +++------ ...roflowLoopNested.Microflows$Microflow.yaml | 264 ++++------------ .../MicroflowSimple.Microflows$Microflow.yaml | 59 ++-- .../MicroflowSplit.Microflows$Microflow.yaml | 143 +++------ ...owSplitThenMerge.Microflows$Microflow.yaml | 151 +++------ .../MyFirstLogic.Microflows$Microflow.yaml | 59 ++-- .../VA_Age.Microflows$Microflow.yaml | 93 +++--- resources/modelsource-v2/Metadata.yaml | 289 ++--------------- ...oflowLoopExample.Microflows$Microflow.yaml | 110 ++----- ...ltiLineMicroflow.Microflows$Microflow.yaml | 118 +++---- ...MicroflowExample.Microflows$Microflow.yaml | 172 ++++------ .../MyFirstLogic.Microflows$Microflow.yaml | 26 +- 22 files changed, 706 insertions(+), 2262 deletions(-) diff --git a/mpr/export_stream.go b/mpr/export_stream.go index ca6361d..7370fad 100644 --- a/mpr/export_stream.go +++ b/mpr/export_stream.go @@ -213,10 +213,19 @@ func buildExportPlanV2(inputDirectory string, mprPath string) (*exportPlan, erro func appendUnitDescriptor(unit MxUnit, contents bson.M, modules *[]MxModule, folders *[]MxFolder, documents *[]exportDocumentDescriptor) { if unit.ContainmentName == "Modules" { name, _ := contents["Name"].(string) + fromAppStore, _ := contents["FromAppStore"].(bool) + appStoreVersion, _ := contents["AppStoreVersion"].(string) + appStoreGuid, _ := contents["AppStoreGuid"].(string) + appStoreVersionGuid, _ := contents["AppStoreVersionGuid"].(string) + appStorePackageId, _ := contents["AppStorePackageId"].(string) *modules = append(*modules, MxModule{ - Name: name, - ID: unit.UnitID, - Attributes: contents, + Name: name, + ID: unit.UnitID, + FromAppStore: fromAppStore, + AppStoreVersion: appStoreVersion, + AppStoreGuid: appStoreGuid, + AppStoreVersionGuid: appStoreVersionGuid, + AppStorePackageId: appStorePackageId, }) } @@ -226,10 +235,9 @@ func appendUnitDescriptor(unit MxUnit, contents bson.M, modules *[]MxModule, fol name, _ = contents["Name"].(string) } *folders = append(*folders, MxFolder{ - Name: name, - ID: unit.UnitID, - ParentID: unit.ContainerID, - Attributes: contents, + Name: name, + ID: unit.UnitID, + ParentID: unit.ContainerID, }) } @@ -281,13 +289,7 @@ func exportDocumentsFromPlan(plan *exportPlan, outputDirectory string, raw bool, } if docType, _ := attributes["$Type"].(string); docType == microflowDocumentType { - enriched := enrichMicroflowDocument(MxDocument{ - Name: document.Name, - Type: document.Type, - Path: document.Path, - Attributes: attributes, - }) - attributes = enriched.Attributes + addMicroflowPseudocode(document.Name, attributes) } if err := writeDocumentToDisk(document, outputDirectory, cleanData(attributes, raw)); err != nil { diff --git a/mpr/microflow.go b/mpr/microflow.go index 1b217e0..13ad577 100644 --- a/mpr/microflow.go +++ b/mpr/microflow.go @@ -1,276 +1,15 @@ package mpr -const microflowDocumentType = "Microflows$Microflow" - -func enrichMicroflowDocument(mf MxDocument) MxDocument { - mf = addMicroflowPseudocode(mf) - mf = transformMicroflow(mf) - return mf -} - -func transformMicroflow(mf MxDocument) MxDocument { - log.Infof("Transforming microflow %s", mf.Name) +import "go.mongodb.org/mongo-driver/bson" - cleanedData := bsonToMap(mf.Attributes) - objs, flows, ok := extractMicroflowGraphData(mf.Name, cleanedData) - if !ok { - return mf - } - startEvent, ok := getMxMicroflowObjectByType(objs, "Microflows$StartEvent") - if !ok { - log.Warnf("StartEvent not found for microflow %s, skipping transformation", mf.Name) - return mf - } - - root := MxMicroflowNode{ - Type: startEvent.Type, - ID: startEvent.ID, - Attributes: startEvent.Attributes, - } - buildDAG(&root, nil, flows, objs) - mainFlow := make([]map[string]interface{}, 0) - labels := make(map[string]interface{}, 0) - extractMainFlow(&mainFlow, &root, &labels) - mf.Attributes["MainFunction"] = mainFlow - // remove ObjectCollection - delete(mf.Attributes, "ObjectCollection") - return mf -} +const microflowDocumentType = "Microflows$Microflow" -func addMicroflowPseudocode(mf MxDocument) MxDocument { - cleanedData := bsonToMap(mf.Attributes) - pseudocode, err := generateMicroflowPseudocode(mf.Name, cleanedData) +func addMicroflowPseudocode(name string, attributes bson.M) { + cleanedData := bsonToMap(attributes) + pseudocode, err := generateMicroflowPseudocode(name, cleanedData) if err != nil { - log.Warnf("Could not generate pseudocode for microflow %s: %v", mf.Name, err) - return mf - } - mf.Attributes["pseudocode"] = pseudocode - return mf -} - -func extractMicroflowGraphData(name string, cleanedData map[string]interface{}) ([]MxMicroflowObject, []MxMicroflowEdge, bool) { - objsCollectionRaw, ok := cleanedData["ObjectCollection"] - if !ok || objsCollectionRaw == nil { - log.Warnf("ObjectCollection not found for microflow %s, skipping transformation", name) - return nil, nil, false - } - - objsCollection, ok := objsCollectionRaw.(map[string]interface{}) - if !ok { - log.Warnf("ObjectCollection is not a map for microflow %s, skipping transformation", name) - return nil, nil, false - } - - objectsRaw, ok := objsCollection["Objects"] - if !ok || objectsRaw == nil { - log.Warnf("Objects not found in ObjectCollection for microflow %s, skipping transformation", name) - return nil, nil, false - } - - objects, ok := objectsRaw.([]interface{}) - if !ok { - log.Warnf("Objects is not a slice for microflow %s, skipping transformation", name) - return nil, nil, false - } - - flowsRaw, ok := cleanedData["Flows"] - if !ok || flowsRaw == nil { - log.Warnf("Flows not found for microflow %s, skipping transformation", name) - return nil, nil, false - } - - flowsSlice, ok := flowsRaw.([]interface{}) - if !ok { - log.Warnf("Flows is not a slice for microflow %s, skipping transformation", name) - return nil, nil, false - } - - return convertToMxMicroflowObjects(objects), convertToMxMicroflowEdges(flowsSlice), true -} - -func extractMainFlow(mainFlow *[]map[string]interface{}, current *MxMicroflowNode, labels *map[string]interface{}) { - c := convertMxMicroflowNodeToMap(current) - *mainFlow = append(*mainFlow, c) - if current.Type == "Microflows$EndEvent" { - return - } - - if current.Type == "Microflows$ExclusiveMerge" { - id, ok := c["ID"].(string) - if !ok { - log.Warn("ID is not a string or is nil") - return - } - // check if label already exists - if _, ok := (*labels)[id]; !ok { - (*labels)[id] = c - // continue expanding this subflow - } else { - log.Infof("Loop detected; not traversing") - return - } - } - - children := current.Children - //current.Children = nil - if children == nil { - return - } - if len(*children) == 0 { + log.Warnf("Could not generate pseudocode for microflow %s: %v", name, err) return - } else if len(*children) == 1 { - // sequence - child := (*children)[0] - extractMainFlow(mainFlow, &child, labels) - } else { - // split - splits := make([]interface{}, 0) - for _, child := range *children { - subflow := make([]map[string]interface{}, 0) - extractMainFlow(&subflow, &child, labels) - splits = append(splits, subflow) - } - c["Splits"] = splits - } -} - -func buildDAG(current *MxMicroflowNode, parent *MxMicroflowNode, flows []MxMicroflowEdge, objects []MxMicroflowObject) { - - current.Parent = parent - children := make([]MxMicroflowNode, 0) - - switch current.Type { - case "Microflows$ExclusiveMerge": - start := backtrack(current, current.Parent) - if start == nil { - // no loop - edges := getMxMicroflowEdgesByOrigin(flows, current.ID) - - for _, edge := range edges { - edgeNode := MxMicroflowNode{ - Type: edge.Type, - ID: edge.ID, - Attributes: edge.Attributes, - } - - buildDAG(&edgeNode, current, flows, objects) - children = append(children, edgeNode) - } - } else { - log.Infof("Loop detected; not traversing") - return - } - case "Microflows$SequenceFlow": - destination, _ := current.Attributes["DestinationPointer"].(string) - obj, ok := getMxMicroflowObjectByID(objects, destination) - if !ok { - log.Warnf("Destination object %s not found for sequence flow %s", destination, current.ID) - return - } - objectNode := MxMicroflowNode{ - Type: obj.Type, - ID: obj.ID, - Attributes: obj.Attributes, - } - buildDAG(&objectNode, current, flows, objects) - children = append(children, objectNode) - default: - edges := getMxMicroflowEdgesByOrigin(flows, current.ID) - - for _, edge := range edges { - edgeNode := MxMicroflowNode{ - Type: edge.Type, - ID: edge.ID, - Attributes: edge.Attributes, - } - - buildDAG(&edgeNode, current, flows, objects) - children = append(children, edgeNode) - } - } - current.Children = &children -} - -func backtrack(current *MxMicroflowNode, parent *MxMicroflowNode) *MxMicroflowNode { - if parent == nil { - return nil - } - if parent.ID == current.ID { - return parent - } - return backtrack(current, parent.Parent) -} - -func getMxMicroflowEdgesByOrigin(edges []MxMicroflowEdge, originId string) []MxMicroflowEdge { - result := make([]MxMicroflowEdge, 0) - for _, edge := range edges { - if edge.Origin == originId { - result = append(result, edge) - } - } - return result -} - -func getMxMicroflowObjectByType(objs []MxMicroflowObject, objType string) (MxMicroflowObject, bool) { - for _, obj := range objs { - if obj.Type == objType { - return obj, true - } - } - return MxMicroflowObject{}, false -} - -func getMxMicroflowObjectByID(objs []MxMicroflowObject, objID string) (MxMicroflowObject, bool) { - for _, obj := range objs { - if obj.ID == objID { - return obj, true - } - } - return MxMicroflowObject{}, false -} - -func convertToMxMicroflowObjects(objs []interface{}) []MxMicroflowObject { - result := make([]MxMicroflowObject, 0, len(objs)) - for _, o := range objs { - castedObject, ok := o.(map[string]interface{}) - if !ok { - continue - } - objType, _ := castedObject["$Type"].(string) - id := readMicroflowID(castedObject["$ID"]) - if objType == "" || id == "" { - continue - } - result = append(result, MxMicroflowObject{ - Type: objType, - ID: id, - Attributes: castedObject, - }) - } - return result -} - -func convertToMxMicroflowEdges(flows []interface{}) []MxMicroflowEdge { - result := make([]MxMicroflowEdge, 0, len(flows)) - for _, f := range flows { - castedFlow, ok := f.(map[string]interface{}) - if !ok { - continue - } - flowType, _ := castedFlow["$Type"].(string) - id := readMicroflowID(castedFlow["$ID"]) - origin := readMicroflowID(castedFlow["OriginPointer"]) - destination := readMicroflowID(castedFlow["DestinationPointer"]) - if flowType == "" || id == "" || origin == "" || destination == "" { - continue - } - result = append(result, MxMicroflowEdge{ - Type: flowType, - ID: id, - Origin: origin, - Destination: destination, - Attributes: castedFlow, - }) } - return result + attributes["pseudocode"] = pseudocode } diff --git a/mpr/microflow_test.go b/mpr/microflow_test.go index 27e2245..c8f8706 100644 --- a/mpr/microflow_test.go +++ b/mpr/microflow_test.go @@ -1,4 +1,3 @@ -// microflow_test.go package mpr import ( @@ -10,8 +9,6 @@ import ( "gopkg.in/yaml.v3" ) -// TestAdd tests the Add function to ensure it returns correct results. - func TestMPRMicroflow(t *testing.T) { t.Run("microflow-simple", func(t *testing.T) { if _, err := exportUnits("./../resources/app-mpr-v1/App.mpr", "./../tmp", true, ""); err != nil { @@ -22,7 +19,6 @@ func TestMPRMicroflow(t *testing.T) { if err != nil { t.Errorf("Failed to read file: %v", err) } - // parse file var mfObj bson.M var node yaml.Node if err := yaml.Unmarshal(mfFile, &node); err != nil { @@ -31,17 +27,10 @@ func TestMPRMicroflow(t *testing.T) { if err := node.Decode(&mfObj); err != nil { t.Errorf("Failed to decode microflow file: %v", err) } - // check metadata if mfObj["Name"] != "MicroflowSimple" { t.Errorf("Unexpected name. Got: %s", mfObj["Name"]) } - // check sequence - sequence := mfObj["MainFunction"].([]interface{}) - if len(sequence) != 5 { - t.Errorf("Unexpected instructions length. Got: %d", len(sequence)) - } - pseudocode, ok := mfObj["pseudocode"].(string) if !ok || pseudocode == "" { t.Errorf("Expected pseudocode to be a non-empty string") @@ -76,7 +65,7 @@ func TestMPRMicroflow(t *testing.T) { t.Errorf("Expected pseudocode to be present in export") } }) - t.Run("microflow-with-split", func(t *testing.T) { + t.Run("microflow-with-split-has-pseudocode", func(t *testing.T) { if _, err := exportUnits("./../resources/app-mpr-v1/App.mpr", "./../tmp", true, ""); err != nil { t.Errorf("Failed to export units from MPR file") } @@ -85,7 +74,6 @@ func TestMPRMicroflow(t *testing.T) { if err != nil { t.Errorf("Failed to read file: %v", err) } - // parse file var mfObj bson.M var node yaml.Node if err := yaml.Unmarshal(mfFile, &node); err != nil { @@ -94,18 +82,16 @@ func TestMPRMicroflow(t *testing.T) { if err := node.Decode(&mfObj); err != nil { t.Errorf("Failed to decode microflow file: %v", err) } - // check metadata if mfObj["Name"] != "MicroflowSplit" { t.Errorf("Unexpected name. Got: %s", mfObj["Name"]) } - // check sequence - sequence := mfObj["MainFunction"].([]interface{}) - if len(sequence) != 5 { - t.Errorf("Unexpected instructions length. Got: %d", len(sequence)) + pseudocode, ok := mfObj["pseudocode"].(string) + if !ok || pseudocode == "" { + t.Errorf("Expected pseudocode to be present in export") } }) - t.Run("microflow-split-then-merge", func(t *testing.T) { + t.Run("microflow-split-then-merge-has-pseudocode", func(t *testing.T) { if _, err := exportUnits("./../resources/app-mpr-v1/App.mpr", "./../tmp", true, ""); err != nil { t.Errorf("Failed to export units from MPR file") } @@ -114,7 +100,6 @@ func TestMPRMicroflow(t *testing.T) { if err != nil { t.Errorf("Failed to read file: %v", err) } - // parse file var mfObj bson.M var node yaml.Node if err := yaml.Unmarshal(mfFile, &node); err != nil { @@ -123,48 +108,13 @@ func TestMPRMicroflow(t *testing.T) { if err := node.Decode(&mfObj); err != nil { t.Errorf("Failed to decode microflow file: %v", err) } - // check metadata if mfObj["Name"] != "MicroflowSplitThenMerge" { t.Errorf("Unexpected name. Got: %s", mfObj["Name"]) } - // check sequence - sequence := mfObj["MainFunction"].([]interface{}) - if len(sequence) != 5 { - t.Errorf("Unexpected instructions length. Got: %d", len(sequence)) - } - - split := sequence[4] - splitMap, ok := split.(bson.M) - if !ok { - t.Errorf("Expected split to be bson.M, got %T", split) - return - } - splits, ok := splitMap["Splits"].([]interface{}) - if !ok { - t.Errorf("Expected Splits to be []interface{}, got %T", splitMap["Splits"]) - return - } - if len(splits) != 2 { - t.Errorf("Unexpected instructions length. Got: %d", len(splits)) - } - - split1, ok := splits[0].([]interface{}) - if !ok { - t.Errorf("Expected splits[0] to be []interface{}, got %T", splits[0]) - return - } - if len(split1) != 4 { - t.Errorf("Unexpected instructions length. Got: %d", len(split1)) - } - - split2, ok := splits[1].([]interface{}) - if !ok { - t.Errorf("Expected splits[1] to be []interface{}, got %T", splits[1]) - return - } - if len(split2) != 4 { - t.Errorf("Unexpected instructions length. Got: %d", len(split2)) + pseudocode, ok := mfObj["pseudocode"].(string) + if !ok || pseudocode == "" { + t.Errorf("Expected pseudocode to be present in export") } }) } diff --git a/mpr/mpr.go b/mpr/mpr.go index 2fe1be9..c12e044 100644 --- a/mpr/mpr.go +++ b/mpr/mpr.go @@ -258,10 +258,19 @@ func getMxModules(units []MxUnit) []MxModule { modules := make([]MxModule, 0) for _, unit := range units { if unit.ContainmentName == "Modules" { + fromAppStore, _ := unit.Contents["FromAppStore"].(bool) + appStoreVersion, _ := unit.Contents["AppStoreVersion"].(string) + appStoreGuid, _ := unit.Contents["AppStoreGuid"].(string) + appStoreVersionGuid, _ := unit.Contents["AppStoreVersionGuid"].(string) + appStorePackageId, _ := unit.Contents["AppStorePackageId"].(string) myModule := MxModule{ - Name: unit.Contents["Name"].(string), - ID: unit.UnitID, - Attributes: unit.Contents, + Name: unit.Contents["Name"].(string), + ID: unit.UnitID, + FromAppStore: fromAppStore, + AppStoreVersion: appStoreVersion, + AppStoreGuid: appStoreGuid, + AppStoreVersionGuid: appStoreVersionGuid, + AppStorePackageId: appStorePackageId, } modules = append(modules, myModule) } @@ -275,32 +284,26 @@ func getMxFolders(units []MxUnit) ([]MxFolder, error) { if unit.ContainmentName == "Folders" || unit.ContainmentName == "Modules" { log.Debugf("Unit: %v", unit.ContainmentName) myFolder := MxFolder{ - Name: unit.Contents["Name"].(string), - ID: unit.UnitID, - ParentID: unit.ContainerID, - Attributes: unit.Contents, - Parent: nil, + Name: unit.Contents["Name"].(string), + ID: unit.UnitID, + ParentID: unit.ContainerID, } folders = append(folders, myFolder) } else if unit.ContainmentName == "" { myFolder := MxFolder{ - Name: "", - ID: unit.UnitID, - ParentID: unit.ContainerID, - Attributes: unit.Contents, - Parent: nil, + Name: "", + ID: unit.UnitID, + ParentID: unit.ContainerID, } folders = append(folders, myFolder) } } - // Temporary map to hold folder references for easy lookup. folderMap := make(map[string]*MxFolder) for i := range folders { folderMap[folders[i].ID] = &folders[i] } - // Set up the parent references. for i, folder := range folders { if parent, exists := folderMap[folder.ParentID]; exists && folder.ParentID != folder.ID { folders[i].Parent = parent @@ -523,7 +526,7 @@ func getMxDocuments(units []MxUnit, folders []MxFolder) ([]MxDocument, error) { } if unit.Contents["$Type"] == microflowDocumentType { - myDocument = enrichMicroflowDocument(myDocument) + addMicroflowPseudocode(myDocument.Name, unit.Contents) } documents = append(documents, myDocument) } @@ -637,8 +640,8 @@ func writeFile(filepath string, contents map[string]interface{}) error { } func renderYAML(contents map[string]interface{}) ([]byte, error) { - normalizedContents := normalizeMultilineValues(contents) - yamlstring, err := yaml.Marshal(normalizedContents) + normalizeMultilineValuesInPlace(contents) + yamlstring, err := yaml.Marshal(contents) if err != nil { return nil, fmt.Errorf("error marshaling: %v", err) } @@ -748,50 +751,47 @@ func (s literalBlockMultilineString) MarshalYAML() (interface{}, error) { }, nil } -// normalizeMultilineValues normalizes indentation in multiline string values recursively -// and forces multiline strings to be encoded as double-quoted scalars. -func normalizeMultilineValues(v interface{}) interface{} { +// normalizeMultilineValuesInPlace normalizes indentation in multiline string +// values recursively, modifying maps and slices in-place rather than +// allocating copies. +func normalizeMultilineValuesInPlace(v interface{}) { switch value := v.(type) { case bson.M: - result := make(bson.M, len(value)) for k, item := range value { - result[k] = normalizeMultilineValues(item) + value[k] = normalizeMultilineValue(item) } - return result case map[string]interface{}: - result := make(map[string]interface{}, len(value)) for k, item := range value { - result[k] = normalizeMultilineValues(item) + value[k] = normalizeMultilineValue(item) } - return result - case []bson.M: - result := make([]bson.M, len(value)) - for i, item := range value { - normalized := normalizeMultilineValues(item) - if itemMap, ok := normalized.(bson.M); ok { - result[i] = itemMap - } else { - result[i] = item - } - } - return result - case []map[string]interface{}: - result := make([]map[string]interface{}, len(value)) + case []interface{}: for i, item := range value { - normalized := normalizeMultilineValues(item) - if itemMap, ok := normalized.(map[string]interface{}); ok { - result[i] = itemMap - } else { - result[i] = item - } + value[i] = normalizeMultilineValue(item) } - return result + } +} + +func normalizeMultilineValue(v interface{}) interface{} { + switch value := v.(type) { + case bson.M: + normalizeMultilineValuesInPlace(value) + return value + case map[string]interface{}: + normalizeMultilineValuesInPlace(value) + return value case []interface{}: - result := make([]interface{}, len(value)) - for i, item := range value { - result[i] = normalizeMultilineValues(item) + normalizeMultilineValuesInPlace(value) + return value + case []bson.M: + for _, item := range value { + normalizeMultilineValuesInPlace(item) + } + return value + case []map[string]interface{}: + for _, item := range value { + normalizeMultilineValuesInPlace(item) } - return result + return value case string: normalized := normalizeMultilineString(value) if strings.Contains(normalized, "\n") { @@ -892,22 +892,8 @@ func removeAppstoreModules(tmpDir string, modules []MxModule) error { return nil } -// isAppstoreModule checks if a module is an appstore module based on its attributes func isAppstoreModule(module MxModule) bool { - // Check for appstore module indicators - if module.Attributes == nil { - return false - } - - // Check if module has appstore specific attributes - if _, ok := module.Attributes["FromAppStore"]; ok { - fromAppStore := module.Attributes["FromAppStore"].(bool) - if fromAppStore { - return true - } - } - - return false + return module.FromAppStore } // syncDirectories synchronizes the contents of src to dst diff --git a/mpr/mpr_test.go b/mpr/mpr_test.go index 6c8b973..bcce707 100644 --- a/mpr/mpr_test.go +++ b/mpr/mpr_test.go @@ -429,40 +429,26 @@ func TestIsAppstoreModule(t *testing.T) { { name: "appstore module", module: MxModule{ - Name: "AppStoreModule", - ID: "1", - Attributes: map[string]interface{}{ - "FromAppStore": true, - }, + Name: "AppStoreModule", + ID: "1", + FromAppStore: true, }, expected: true, }, { name: "not appstore module", module: MxModule{ - Name: "CustomModule", - ID: "2", - Attributes: map[string]interface{}{ - "FromAppStore": false, - }, + Name: "CustomModule", + ID: "2", + FromAppStore: false, }, expected: false, }, { - name: "no appstore attribute", + name: "default zero value", module: MxModule{ - Name: "CustomModule", - ID: "3", - Attributes: map[string]interface{}{}, - }, - expected: false, - }, - { - name: "nil attributes", - module: MxModule{ - Name: "CustomModule", - ID: "4", - Attributes: nil, + Name: "CustomModule", + ID: "3", }, expected: false, }, @@ -923,18 +909,14 @@ func TestRemoveAppstoreModules(t *testing.T) { modules := []MxModule{ { - Name: "AppStoreModule", - ID: "1", - Attributes: map[string]interface{}{ - "FromAppStore": true, - }, + Name: "AppStoreModule", + ID: "1", + FromAppStore: true, }, { - Name: "CustomModule", - ID: "2", - Attributes: map[string]interface{}{ - "FromAppStore": false, - }, + Name: "CustomModule", + ID: "2", + FromAppStore: false, }, } diff --git a/mpr/types.go b/mpr/types.go index 01deede..4a63e95 100644 --- a/mpr/types.go +++ b/mpr/types.go @@ -15,54 +15,28 @@ type MxUnit struct { } type MxDocument struct { - Name string `yaml:"Name"` - Type string `yaml:"Type"` - Path string `yaml:"Path"` - Attributes map[string]interface{} `yaml:"Attributes"` - ContentsHash string `yaml:"ContentsHash,omitempty"` + Name string `yaml:"Name"` + Type string `yaml:"Type"` + Path string `yaml:"Path"` + Attributes map[string]interface{} `yaml:"Attributes"` + ContentsHash string `yaml:"ContentsHash,omitempty"` } type MxModule struct { - Name string `yaml:"Name"` - ID string `yaml:"ID"` - Attributes map[string]interface{} `yaml:"Attributes"` + Name string `yaml:"Name"` + ID string `yaml:"ID"` + FromAppStore bool `yaml:"FromAppStore,omitempty"` + AppStoreVersion string `yaml:"AppStoreVersion,omitempty"` + AppStoreGuid string `yaml:"AppStoreGuid,omitempty"` + AppStoreVersionGuid string `yaml:"AppStoreVersionGuid,omitempty"` + AppStorePackageId string `yaml:"AppStorePackageId,omitempty"` } type MxFolder struct { - Name string `yaml:"Name"` - ID string `yaml:"ID"` - ParentID string `yaml:"ParentID"` - Parent *MxFolder `yaml:"Parent"` - Attributes map[string]interface{} `yaml:"Attributes"` -} - -type MxMicroflow struct { - Name string `yaml:"Name"` - ID string `yaml:"ID"` - Attributes map[string]interface{} `yaml:"Attributes"` -} - -type MxMicroflowEdge struct { - Type string `yaml:"Type"` - ID string `yaml:"ID"` - Origin string `yaml:"Origin"` - Destination string `yaml:"Destination"` - Attributes map[string]interface{} `yaml:"Attributes"` -} -type MxMicroflowObject struct { - Type string `yaml:"Type"` - ID string `yaml:"ID"` - Origin string `yaml:"Origin"` - Destination string `yaml:"Destination"` - Attributes map[string]interface{} `yaml:"Attributes"` -} - -type MxMicroflowNode struct { - Type string `yaml:"Type"` - ID string `yaml:"ID"` - Attributes map[string]interface{} `yaml:"Attributes"` - Parent *MxMicroflowNode - Children *[]MxMicroflowNode + Name string `yaml:"Name"` + ID string `yaml:"ID"` + ParentID string `yaml:"ParentID"` + Parent *MxFolder `yaml:"Parent"` } type MxID struct { diff --git a/mpr/utils.go b/mpr/utils.go index a018271..78aa5f6 100644 --- a/mpr/utils.go +++ b/mpr/utils.go @@ -3,16 +3,14 @@ package mpr import ( "encoding/base64" "fmt" - "reflect" "github.com/sirupsen/logrus" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" ) -var log = logrus.New() // Initialize with a default logger +var log = logrus.New() -// SetLogger allows the main application to set the logger, including its configuration. func SetLogger(logger *logrus.Logger) { log = logger } @@ -28,102 +26,81 @@ func Contains(slice []string, str string) bool { return false } -func ignoreAttributes(data bson.M, ignore []string) bson.M { - result := make(bson.M) - +// stripIgnoredAttributes removes ignored keys and normalises primitive.A +// slices in-place, avoiding a full deep copy. +func stripIgnoredAttributes(data map[string]interface{}, ignore []string) { + for _, key := range ignore { + delete(data, key) + } for key, value := range data { - ignoreKey := false - - for _, ignoreAttr := range ignore { - if key == ignoreAttr { - ignoreKey = true - break - } - } - - if !ignoreKey { - if reflect.TypeOf(value) == reflect.TypeOf(primitive.A{}) { - castedData := value.(primitive.A) - var interfaceSlice []interface{} = castedData - if len(interfaceSlice) > 0 { - if reflect.TypeOf(interfaceSlice[0]) == reflect.TypeOf(int32(1)) { - value = interfaceSlice[1:] - } else { - value = interfaceSlice - } - } else { - value = interfaceSlice + switch v := value.(type) { + case primitive.A: + s := []interface{}(v) + if len(s) > 0 { + if _, ok := s[0].(int32); ok { + s = s[1:] } } - - switch v := value.(type) { - case bson.M: - result[key] = ignoreAttributes(v, ignore) - case []interface{}: - var slice []interface{} - for _, item := range v { - switch item := item.(type) { - case []map[string]interface{}: - var slice2 []map[string]interface{} - for _, item2 := range item { - slice2 = append(slice2, ignoreAttributes(item2, ignore)) - } - slice = append(slice, slice2) - case bson.M: - slice = append(slice, ignoreAttributes(item, ignore)) - default: - slice = append(slice, item) - } + data[key] = s + stripSliceItems(s, ignore) + case []interface{}: + if len(v) > 0 { + if _, ok := v[0].(int32); ok { + v = v[1:] + data[key] = v } - result[key] = slice - case []map[string]interface{}: - var slice []map[string]interface{} - for _, item := range v { - slice = append(slice, ignoreAttributes(item, ignore)) - } - result[key] = slice - case map[string]interface{}: - result[key] = ignoreAttributes(v, ignore) - default: - result[key] = value + } + stripSliceItems(v, ignore) + case bson.M: + stripIgnoredAttributes(v, ignore) + case map[string]interface{}: + stripIgnoredAttributes(v, ignore) + case []bson.M: + for _, item := range v { + stripIgnoredAttributes(item, ignore) + } + case []map[string]interface{}: + for _, item := range v { + stripIgnoredAttributes(item, ignore) } } } +} - return result +func stripSliceItems(s []interface{}, ignore []string) { + for _, item := range s { + switch m := item.(type) { + case bson.M: + stripIgnoredAttributes(m, ignore) + case map[string]interface{}: + stripIgnoredAttributes(m, ignore) + } + } } func cleanData(data bson.M, raw bool) bson.M { - var filteredData bson.M - if raw { - filteredData = data - } else { - filteredData = ignoreAttributes(data, ignoredAttributes) + if !raw { + stripIgnoredAttributes(data, ignoredAttributes) } - return filteredData + return data } func bsonToMap(data bson.M) map[string]interface{} { result := make(map[string]interface{}) for key, value := range data { - // log.Infof("Key: %s, Value: %v", key, value) - switch value.(type) { + switch v := value.(type) { case string, int, bool, int64: result[key] = value case primitive.Binary: - data := value.(primitive.Binary).Data - encodedData := base64.StdEncoding.EncodeToString(data) + encodedData := base64.StdEncoding.EncodeToString(v.Data) result[key] = encodedData case bson.A: - // Handle bson.A (array) by converting to slice of interface{} - result[key] = convertBsonAToSliceInterface(value.(bson.A)) + result[key] = convertBsonAToSliceInterface(v) case bson.M: - // Handle nested bson.M by recursively converting to map[string]interface{} - result[key] = bsonToMap(value.(bson.M)) + result[key] = bsonToMap(v) case nil: result[key] = nil default: - // Handle unknown types (optional: log or return error) fmt.Printf("Unknown type encountered while converting key '%s': %T\n", key, value) } } @@ -133,22 +110,14 @@ func bsonToMap(data bson.M) map[string]interface{} { func convertBsonAToSliceInterface(data bson.A) []interface{} { result := make([]interface{}, 0, len(data)) for _, element := range data { - switch element.(type) { + switch v := element.(type) { case int32: continue case string: - result = append(result, element.(string)) + result = append(result, v) default: result = append(result, bsonToMap(element.(bson.M))) } } return result } - -func convertMxMicroflowNodeToMap(node *MxMicroflowNode) map[string]interface{} { - c := make(map[string]interface{}) - c["Type"] = node.Type - c["ID"] = node.ID - c["Attributes"] = node.Attributes - return c -} diff --git a/resources/modelsource-v1/Metadata.yaml b/resources/modelsource-v1/Metadata.yaml index 4092208..64ec0ee 100644 --- a/resources/modelsource-v1/Metadata.yaml +++ b/resources/modelsource-v1/Metadata.yaml @@ -3,280 +3,51 @@ BuildVersion: 10.18.3.58900 Modules: - Name: Administration ID: TJ9xCCh3h0mdTVo+0PSB5A== - Attributes: - $ID: - subtype: 0 - data: - - 76 - - 159 - - 113 - - 8 - - 40 - - 119 - - 135 - - 73 - - 157 - - 77 - - 90 - - 62 - - 208 - - 244 - - 129 - - 228 - $Type: Projects$ModuleImpl - AppStoreGuid: 1d7b7a3f-84e6-4fc1-baf0-afbd0ee23b13 - AppStorePackageId: 23513 - AppStoreVersion: 4.1.0 - AppStoreVersionGuid: 08b6928f-4a67-4983-b98e-decffcec5a82 - FromAppStore: true - IsThemeModule: false - Name: Administration - NewSortIndex: -0.5 + FromAppStore: true + AppStoreVersion: 4.1.0 + AppStoreGuid: 1d7b7a3f-84e6-4fc1-baf0-afbd0ee23b13 + AppStoreVersionGuid: 08b6928f-4a67-4983-b98e-decffcec5a82 - Name: Atlas_Core ID: N+Ifuf/Of0mwB5I9DLbDOA== - Attributes: - $ID: - subtype: 0 - data: - - 55 - - 226 - - 31 - - 185 - - 255 - - 206 - - 127 - - 73 - - 176 - - 7 - - 146 - - 61 - - 12 - - 182 - - 195 - - 56 - $Type: Projects$ModuleImpl - AppStoreGuid: 0404ab0c-4521-419c-9a90-b804e7038da3 - AppStorePackageId: 117187 - AppStoreVersion: 3.14.0 - AppStoreVersionGuid: bed44828-c85d-4b50-ad20-8633589dd6a9 - FromAppStore: true - IsThemeModule: true - Name: Atlas_Core - NewSortIndex: 38 + FromAppStore: true + AppStoreVersion: 3.14.0 + AppStoreGuid: 0404ab0c-4521-419c-9a90-b804e7038da3 + AppStoreVersionGuid: bed44828-c85d-4b50-ad20-8633589dd6a9 - Name: Atlas_Web_Content ID: ZSsTntE9bkWOq8+tPUe98w== - Attributes: - $ID: - subtype: 0 - data: - - 101 - - 43 - - 19 - - 158 - - 209 - - 61 - - 110 - - 69 - - 142 - - 171 - - 207 - - 173 - - 61 - - 71 - - 189 - - 243 - $Type: Projects$ModuleImpl - AppStoreGuid: 08060dc1-8f61-4969-8f90-707c74fc0cc1 - AppStorePackageId: 117183 - AppStoreVersion: 3.5.1 - AppStoreVersionGuid: 5fb7fee5-dbd7-44ad-a948-b96d3f4c3f9a - FromAppStore: true - IsThemeModule: true - Name: Atlas_Web_Content - NewSortIndex: 39 + FromAppStore: true + AppStoreVersion: 3.5.1 + AppStoreGuid: 08060dc1-8f61-4969-8f90-707c74fc0cc1 + AppStoreVersionGuid: 5fb7fee5-dbd7-44ad-a948-b96d3f4c3f9a - Name: CommunityCommons ID: CJwh54tYwk+hc1+bCPwjDg== - Attributes: - $ID: - subtype: 0 - data: - - 8 - - 156 - - 33 - - 231 - - 139 - - 88 - - 194 - - 79 - - 161 - - 115 - - 95 - - 155 - - 8 - - 252 - - 35 - - 14 - $Type: Projects$ModuleImpl - AppStoreGuid: 1f12fd41-98dc-4965-8473-ae46e16ad853 - AppStorePackageId: 170 - AppStoreVersion: 10.9.0 - AppStoreVersionGuid: 1f12fd41-98dc-4965-8473-ae46e16ad853 - FromAppStore: true - IsThemeModule: false - Name: CommunityCommons - NewSortIndex: 3 + FromAppStore: true + AppStoreVersion: 10.9.0 + AppStoreGuid: 1f12fd41-98dc-4965-8473-ae46e16ad853 + AppStoreVersionGuid: 1f12fd41-98dc-4965-8473-ae46e16ad853 - Name: DataWidgets ID: rOLa4hehRU2AzTf/EaZ+Hw== - Attributes: - $ID: - subtype: 0 - data: - - 172 - - 226 - - 218 - - 226 - - 23 - - 161 - - 69 - - 77 - - 128 - - 205 - - 55 - - 255 - - 17 - - 166 - - 126 - - 31 - $Type: Projects$ModuleImpl - AppStoreGuid: b0376c9a-37f9-4c96-bca9-491d20f3e975 - AppStorePackageId: 116540 - AppStoreVersion: 2.13.0 - AppStoreVersionGuid: 43ef2e62-089b-465b-be44-20144ef9e0be - FromAppStore: true - IsThemeModule: true - Name: DataWidgets - NewSortIndex: 2 + FromAppStore: true + AppStoreVersion: 2.13.0 + AppStoreGuid: b0376c9a-37f9-4c96-bca9-491d20f3e975 + AppStoreVersionGuid: 43ef2e62-089b-465b-be44-20144ef9e0be - Name: FeedbackModule ID: anwcVtQfBESck7qCSr6wYA== - Attributes: - $ID: - subtype: 0 - data: - - 106 - - 124 - - 28 - - 86 - - 212 - - 31 - - 4 - - 68 - - 156 - - 147 - - 186 - - 130 - - 74 - - 190 - - 176 - - 96 - $Type: Projects$ModuleImpl - AppStoreGuid: de8fdcee-11ea-4431-aead-8caba99a1c60 - AppStorePackageId: 205506 - AppStoreVersion: 1.4.0 - AppStoreVersionGuid: 8d3b9e71-ac72-4aab-ba3f-ee283bf4d81a - FromAppStore: true - IsThemeModule: false - Name: FeedbackModule - NewSortIndex: 4 + FromAppStore: true + AppStoreVersion: 1.4.0 + AppStoreGuid: de8fdcee-11ea-4431-aead-8caba99a1c60 + AppStoreVersionGuid: 8d3b9e71-ac72-4aab-ba3f-ee283bf4d81a - Name: MyFirstModule ID: xn10Fre2rkKqvyVdyirurw== - Attributes: - $ID: - subtype: 0 - data: - - 198 - - 125 - - 116 - - 22 - - 183 - - 182 - - 174 - - 66 - - 170 - - 191 - - 37 - - 93 - - 202 - - 42 - - 238 - - 175 - $Type: Projects$ModuleImpl - AppStoreGuid: "" - AppStorePackageId: 0 - AppStoreVersion: "" - AppStoreVersionGuid: "" - FromAppStore: false - IsThemeModule: false - Name: MyFirstModule - NewSortIndex: 2 - Name: NanoflowCommons ID: EBEQuiOQm0CiZysqR/iiQw== - Attributes: - $ID: - subtype: 0 - data: - - 16 - - 17 - - 16 - - 186 - - 35 - - 144 - - 155 - - 64 - - 162 - - 103 - - 43 - - 42 - - 71 - - 248 - - 162 - - 67 - $Type: Projects$ModuleImpl - AppStoreGuid: 75fda84f-6c3d-460d-98eb-50cdbfd3b53d - AppStorePackageId: 109515 - AppStoreVersion: 4.0.2 - AppStoreVersionGuid: 4bb5080c-8939-4001-a86d-e16d1711a693 - FromAppStore: true - IsThemeModule: false - Name: NanoflowCommons - NewSortIndex: 2.75 + FromAppStore: true + AppStoreVersion: 4.0.2 + AppStoreGuid: 75fda84f-6c3d-460d-98eb-50cdbfd3b53d + AppStoreVersionGuid: 4bb5080c-8939-4001-a86d-e16d1711a693 - Name: WebActions ID: tklS1TNqIECWUG8EyKUaDw== - Attributes: - $ID: - subtype: 0 - data: - - 182 - - 73 - - 82 - - 213 - - 51 - - 106 - - 32 - - 64 - - 150 - - 80 - - 111 - - 4 - - 200 - - 165 - - 26 - - 15 - $Type: Projects$ModuleImpl - AppStoreGuid: 87f3694f-b0d1-432e-a150-df1753dbd0e8 - AppStorePackageId: 114337 - AppStoreVersion: 2.10.0 - AppStoreVersionGuid: 507824ec-9757-4b89-85b5-8d1f4fc4bc34 - FromAppStore: true - IsThemeModule: false - Name: WebActions - NewSortIndex: 3 + FromAppStore: true + AppStoreVersion: 2.10.0 + AppStoreGuid: 87f3694f-b0d1-432e-a150-df1753dbd0e8 + AppStoreVersionGuid: 507824ec-9757-4b89-85b5-8d1f4fc4bc34 diff --git a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowComplexSplit.Microflows$Microflow.yaml b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowComplexSplit.Microflows$Microflow.yaml index ab8f000..c8ff546 100644 --- a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowComplexSplit.Microflows$Microflow.yaml +++ b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowComplexSplit.Microflows$Microflow.yaml @@ -9,22 +9,20 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: ByoAvHEnAECoob0TcBsoCQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 0;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MicroflowComplexSplit +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$CreateVariableAction ErrorHandlingType: Rollback InitialValue: MyFirstModule.EnumerationStatus._New @@ -32,145 +30,42 @@ MainFunction: VariableType: $Type: DataTypes$EnumerationType Enumeration: MyFirstModule.EnumerationStatus - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: WRDtQdo6JUyYuOoGOduyKg== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ExclusiveSplit - Caption: Decision - Documentation: "" - ErrorHandlingType: Rollback - SplitCondition: + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveSplit + Caption: Decision + Documentation: "" + ErrorHandlingType: Rollback + SplitCondition: $Type: Microflows$ExpressionSplitCondition Expression: $status - Splits: - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: GtQF96dtV0G8gOv2X9ulQw== - $Type: Microflows$EnumerationCase - Value: Done - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ExclusiveMerge - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: 4lsobhDlDEmu00iffEjksA== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: mTqnRBztSU+tw1feVZstJw== - $Type: Microflows$EnumerationCase - Value: InProgress - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-15 - OriginControlVector: -2;14 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: ofqfAAZ6W0Oi4BaPJNdYfg== - $Type: Microflows$EnumerationCase - Value: (empty) - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-30 - OriginControlVector: 0;15 - - Attributes: - $Type: Microflows$ActionActivity - Action: - $Type: Microflows$CreateChangeAction - Commit: "No" - Entity: MyFirstModule.Bike - ErrorHandlingType: Rollback - Items: [] - RefreshInClient: false - VariableName: NewBike - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: zcwSb1ri20aIsWKv+U6d9Q== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-15 - OriginControlVector: 0;30 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: eafhO9mN/ka+Uu6v154wUw== - $Type: Microflows$EnumerationCase - Value: Cancelled - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;15 - OriginControlVector: 0;15 - - Attributes: - $Type: Microflows$ExclusiveMerge - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: nbqcFg2i+Eu2YAO95CVRwQ== - $Type: Microflows$EnumerationCase - Value: _New - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 15;0 - OriginControlVector: 0;15 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MicroflowComplexSplit + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ExclusiveMerge + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: + $Type: Microflows$CreateChangeAction + Commit: "No" + Entity: MyFirstModule.Bike + ErrorHandlingType: Rollback + Items: [] + RefreshInClient: false + VariableName: NewBike + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowForLoop.Microflows$Microflow.yaml b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowForLoop.Microflows$Microflow.yaml index d0511bb..b9d6cba 100644 --- a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowForLoop.Microflows$Microflow.yaml +++ b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowForLoop.Microflows$Microflow.yaml @@ -9,22 +9,20 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: mNbOo7XmhE22WCcjlxz4Zw== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 0;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MicroflowForLoop +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$RetrieveAction ErrorHandlingType: Rollback ResultVariableName: BikeList @@ -38,46 +36,31 @@ MainFunction: $Type: Microflows$ConstantRange SingleObject: false XpathConstraint: "" - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: oSElvrlmJkGpoeUrbtZjKw== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$LoopedActivity - Documentation: "" - ErrorHandlingType: Rollback - LoopSource: + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$LoopedActivity + Documentation: "" + ErrorHandlingType: Rollback + LoopSource: $Type: Microflows$IterableList ListVariableName: BikeList VariableName: IteratorBike - ObjectCollection: + ObjectCollection: $Type: Microflows$MicroflowObjectCollection Objects: - - $ID: REoQzbooxUqlJfxtM61uuw== - $Type: Microflows$ActionActivity + - $Type: Microflows$ActionActivity Action: - $ID: ePBJZv2ockmxBjt1gRJInw== $Type: Microflows$ChangeAction ChangeVariableName: IteratorBike Commit: "No" ErrorHandlingType: Rollback Items: - - $ID: vlZ2qLGLHkaufP+Kexafqg== - $Type: Microflows$ChangeActionItem + - $Type: Microflows$ChangeActionItem Association: "" Attribute: MyFirstModule.Bike.Name - Type: Set Value: '''abc''' RefreshInClient: false AutoGenerateCaption: true @@ -85,50 +68,18 @@ MainFunction: Caption: Activity Disabled: false Documentation: "" - RelativeMiddlePoint: 184;120 - Size: 120;60 - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: fn8Jgb25I0yZH/iZubEH3w== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$CommitAction CommitVariableName: BikeList ErrorHandlingType: Rollback RefreshInClient: false WithEvents: true - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: 5k1lHmjvtUWTjcbw91JXYQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MicroflowForLoop + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowLoop.Microflows$Microflow.yaml b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowLoop.Microflows$Microflow.yaml index e083e06..ba6de77 100644 --- a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowLoop.Microflows$Microflow.yaml +++ b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowLoop.Microflows$Microflow.yaml @@ -9,119 +9,54 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: GiH0TK39nUWNx49qCaO+7Q== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MicroflowLoop +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$CreateVariableAction ErrorHandlingType: Rollback InitialValue: "10" VariableName: counter VariableType: $Type: DataTypes$IntegerType - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: ssykl6pqyUqJCuOggJOUtQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ExclusiveMerge - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: NwmcF32mSUug4t2CDPQghQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ExclusiveSplit - Caption: Enough? - Documentation: "" - ErrorHandlingType: Rollback - SplitCondition: + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveSplit + Caption: Enough? + Documentation: "" + ErrorHandlingType: Rollback + SplitCondition: $Type: Microflows$ExpressionSplitCondition Expression: $counter > 0 - Splits: - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: X8BX7EbNHEKxzAzXbV9PVw== - $Type: Microflows$EnumerationCase - Value: "true" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: ujmRZNU150qvnlAUoqPLJA== - $Type: Microflows$EnumerationCase - Value: "false" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;30 - OriginControlVector: 0;-15 - - Attributes: - $Type: Microflows$ActionActivity - Action: - $Type: Microflows$ChangeVariableAction - ChangeVariableName: counter - ErrorHandlingType: Rollback - Value: $counter-1 - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: n6vcUe3E4EWUB7u+Zoe2/Q== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-15 - OriginControlVector: -30;0 - - Attributes: - $Type: Microflows$ExclusiveMerge -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MicroflowLoop + - $Type: Microflows$ActionActivity + Action: + $Type: Microflows$ChangeVariableAction + ChangeVariableName: counter + ErrorHandlingType: Rollback + Value: $counter-1 + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveMerge + - $Type: Microflows$Annotation + Caption: 'label: label1' + - $Type: Microflows$Annotation + Caption: 'goto: label1' ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowLoopNested.Microflows$Microflow.yaml b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowLoopNested.Microflows$Microflow.yaml index a7bd63b..0249d84 100644 --- a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowLoopNested.Microflows$Microflow.yaml +++ b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowLoopNested.Microflows$Microflow.yaml @@ -9,210 +9,82 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: pns0UIqrRUWOihSp3xfF0g== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MicroflowLoopNested +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$CreateVariableAction ErrorHandlingType: Rollback InitialValue: "10" VariableName: counter VariableType: $Type: DataTypes$IntegerType - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: UKaIBh0q5EG61Fd5Hb1V1w== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ExclusiveMerge - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: 5D4FtjfHaU2hqHvOhHuW/g== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ExclusiveSplit - Caption: Enough? - Documentation: "" - ErrorHandlingType: Rollback - SplitCondition: + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveSplit + Caption: Enough? + Documentation: "" + ErrorHandlingType: Rollback + SplitCondition: $Type: Microflows$ExpressionSplitCondition Expression: $counter > 0 - Splits: - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: +iET+CRW00Gp3hNjUtwu5g== - $Type: Microflows$EnumerationCase - Value: "true" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: QEeT4yPDzk6a3czfYVVGrg== - $Type: Microflows$EnumerationCase - Value: "false" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;30 - OriginControlVector: 0;-15 - - Attributes: - $Type: Microflows$ActionActivity - Action: - $Type: Microflows$CreateVariableAction - ErrorHandlingType: Rollback - InitialValue: "20" - VariableName: counter2 - VariableType: - $Type: DataTypes$IntegerType - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: nD1AKthUmEq3h50QOXyQZQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;15 - OriginControlVector: 0;-30 - - Attributes: - $Type: Microflows$ExclusiveMerge - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: Cwi0Y+E+cEKMwOh2n+/ehA== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;15 - OriginControlVector: 0;-15 - - Attributes: - $Type: Microflows$ExclusiveSplit - Caption: more? - Documentation: "" - ErrorHandlingType: Rollback - SplitCondition: - $Type: Microflows$ExpressionSplitCondition - Expression: $counter2 > 0 - Splits: - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: 57Dpwr4rtECju/dbpm0UcA== - $Type: Microflows$EnumerationCase - Value: "false" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 30;0 - OriginControlVector: -15;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: - $Type: Microflows$ChangeVariableAction - ChangeVariableName: counter - ErrorHandlingType: Rollback - Value: $counter-1 - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: kOOW1HJnm06lCraExHD1AQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-15 - OriginControlVector: 0;30 - - Attributes: - $Type: Microflows$ExclusiveMerge - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: GJUIOCVuFkyxppsqr8/Lbw== - $Type: Microflows$EnumerationCase - Value: "true" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-30 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: - $Type: Microflows$ChangeVariableAction - ChangeVariableName: counter2 - ErrorHandlingType: Rollback - Value: $counter2-1 - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: dc3qO8PZ1EKIClotmzP5Tg== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 15;0 - OriginControlVector: 0;30 - - Attributes: - $Type: Microflows$ExclusiveMerge -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MicroflowLoopNested + - $Type: Microflows$ActionActivity + Action: + $Type: Microflows$ChangeVariableAction + ChangeVariableName: counter + ErrorHandlingType: Rollback + Value: $counter-1 + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveMerge + - $Type: Microflows$ExclusiveSplit + Caption: more? + Documentation: "" + ErrorHandlingType: Rollback + SplitCondition: + $Type: Microflows$ExpressionSplitCondition + Expression: $counter2 > 0 + - $Type: Microflows$ActionActivity + Action: + $Type: Microflows$CreateVariableAction + ErrorHandlingType: Rollback + InitialValue: "20" + VariableName: counter2 + VariableType: + $Type: DataTypes$IntegerType + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ActionActivity + Action: + $Type: Microflows$ChangeVariableAction + ChangeVariableName: counter2 + ErrorHandlingType: Rollback + Value: $counter2-1 + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveMerge ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSimple.Microflows$Microflow.yaml b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSimple.Microflows$Microflow.yaml index b46d017..4868b35 100644 --- a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSimple.Microflows$Microflow.yaml +++ b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSimple.Microflows$Microflow.yaml @@ -9,52 +9,31 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: 3aYgrUdk2kes8OgRwAn/2w== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MicroflowSimple +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$CreateVariableAction ErrorHandlingType: Rollback InitialValue: "false" VariableName: Variable VariableType: $Type: DataTypes$BooleanType - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: qTDWISziZ025rDj2XnQbSA== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MicroflowSimple + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSplit.Microflows$Microflow.yaml b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSplit.Microflows$Microflow.yaml index af3824c..56962f8 100644 --- a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSplit.Microflows$Microflow.yaml +++ b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSplit.Microflows$Microflow.yaml @@ -9,114 +9,57 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: gus6TaZ+7EqtgIf2bAnl2g== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 0;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MicroflowSplit +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$CreateVariableAction ErrorHandlingType: Rollback InitialValue: '''test'' ' VariableName: Variable VariableType: $Type: DataTypes$StringType - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: ZNXIj10BZUmfZB6SrZGZaA== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ExclusiveSplit - Caption: empty? - Documentation: "" - ErrorHandlingType: Rollback - SplitCondition: + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveSplit + Caption: empty? + Documentation: "" + ErrorHandlingType: Rollback + SplitCondition: $Type: Microflows$ExpressionSplitCondition Expression: $Variable != empty and $Variable != '' - Splits: - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: 5pQc0Ffffk6oRS0KWA0uWg== - $Type: Microflows$EnumerationCase - Value: "false" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: fxaQkhvbpUq3X9IcxtTEow== - $Type: Microflows$EnumerationCase - Value: "true" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-30 - OriginControlVector: 0;15 - - Attributes: - $Type: Microflows$ActionActivity - Action: - $Type: Microflows$LogMessageAction - ErrorHandlingType: Rollback - IncludeLatestStackTrace: false - Level: Info - MessageTemplate: - $Type: Microflows$StringTemplate - Parameters: [] - Text: test - Node: '''XXX''' - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: dpl6eUL5SUaChpbo+ZkS1g== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-15 - OriginControlVector: 0;30 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MicroflowSplit + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: + $Type: Microflows$LogMessageAction + ErrorHandlingType: Rollback + IncludeLatestStackTrace: false + Level: Info + MessageTemplate: + $Type: Microflows$StringTemplate + Parameters: [] + Text: test + Node: '''XXX''' + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSplitThenMerge.Microflows$Microflow.yaml b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSplitThenMerge.Microflows$Microflow.yaml index eb2f088..107bfb2 100644 --- a/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSplitThenMerge.Microflows$Microflow.yaml +++ b/resources/modelsource-v1/MyFirstModule/Folder/MicroflowSplitThenMerge.Microflows$Microflow.yaml @@ -9,124 +9,55 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: svSfk27rQUOrFsOuNKD7DA== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 0;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MicroflowSplitThenMerge +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$CreateVariableAction ErrorHandlingType: Rollback InitialValue: "false" VariableName: Variable VariableType: $Type: DataTypes$BooleanType - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: vA0rbX3mvEezhz7u1QUK6g== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ExclusiveSplit - Caption: left or right? - Documentation: "" - ErrorHandlingType: Rollback - SplitCondition: + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveSplit + Caption: left or right? + Documentation: "" + ErrorHandlingType: Rollback + SplitCondition: $Type: Microflows$ExpressionSplitCondition Expression: $Variable - Splits: - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: aN4Nm1Ztw0e8gDQvOw2mTQ== - $Type: Microflows$EnumerationCase - Value: "false" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ExclusiveMerge - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: xUuozi7+DkaKHOnHCW2EZQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: Jd4hAUJwpE6gt6868Ytiqw== - $Type: Microflows$EnumerationCase - Value: "true" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-30 - OriginControlVector: 0;15 - - Attributes: - $Type: Microflows$ActionActivity - Action: - $Type: Microflows$LogMessageAction - ErrorHandlingType: Rollback - IncludeLatestStackTrace: false - Level: Info - MessageTemplate: - $Type: Microflows$StringTemplate - Parameters: [] - Text: test - Node: '''XXX''' - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: +2Dc4CHizkOnL9xyPXkCRA== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;15 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ExclusiveMerge -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MicroflowSplitThenMerge + - $Type: Microflows$ActionActivity + Action: + $Type: Microflows$LogMessageAction + ErrorHandlingType: Rollback + IncludeLatestStackTrace: false + Level: Info + MessageTemplate: + $Type: Microflows$StringTemplate + Parameters: [] + Text: test + Node: '''XXX''' + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveMerge ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v1/MyFirstModule/MyFirstLogic.Microflows$Microflow.yaml b/resources/modelsource-v1/MyFirstModule/MyFirstLogic.Microflows$Microflow.yaml index 5a424c1..66f8a2a 100644 --- a/resources/modelsource-v1/MyFirstModule/MyFirstLogic.Microflows$Microflow.yaml +++ b/resources/modelsource-v1/MyFirstModule/MyFirstLogic.Microflows$Microflow.yaml @@ -12,22 +12,22 @@ ConcurrenyErrorMessage: Documentation: '#noqa' Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: D3Po1QicOkyhuybPVJjvAQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 0;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MyFirstLogic +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$Annotation + Caption: "Microflows are used to define server logic in your app.\r\n\r\n- For client logic you can use Nanoflows\r\n- For business process logic you can use Workflows\r\n\r\nDocumentation: https://docs.mendix.com/refguide/application-logic" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$RetrieveAction ErrorHandlingType: Rollback ResultVariableName: SessionList @@ -35,28 +35,11 @@ MainFunction: $Type: Microflows$AssociationRetrieveSource AssociationId: System.Session_User StartVariableName: currentUser - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;0 - OriginControlVector: 0;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MyFirstLogic + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v1/MyFirstModule/VA_Age.Microflows$Microflow.yaml b/resources/modelsource-v1/MyFirstModule/VA_Age.Microflows$Microflow.yaml index 2fdc3f1..dc92d99 100644 --- a/resources/modelsource-v1/MyFirstModule/VA_Age.Microflows$Microflow.yaml +++ b/resources/modelsource-v1/MyFirstModule/VA_Age.Microflows$Microflow.yaml @@ -9,46 +9,42 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: Zd8wxeDn2UG3o0H3iJTjqg== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 0;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$IntegerType +Name: VA_Age +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: $Variable - $Bike/Year + - $Type: Microflows$MicroflowParameter + DefaultValue: "" + Documentation: "" + HasVariableNameBeenChanged: false + IsRequired: true + Name: Bike + VariableType: + $Type: DataTypes$ObjectType + Entity: MyFirstModule.Bike + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$CreateVariableAction ErrorHandlingType: Rollback InitialValue: "2024" VariableName: Variable VariableType: $Type: DataTypes$IntegerType - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: wkvhJt34KU2JSNqkhjNmeQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$RetrieveAction ErrorHandlingType: Rollback ResultVariableName: PhotoList @@ -62,30 +58,11 @@ MainFunction: $Type: Microflows$ConstantRange SingleObject: false XpathConstraint: "" - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: eTq+WKyueUuvBhP3PGvxdQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: $Variable - $Bike/Year -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$IntegerType -Name: VA_Age + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" ReturnVariableName: Variable Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v2/Metadata.yaml b/resources/modelsource-v2/Metadata.yaml index ac2a19e..cf8462e 100644 --- a/resources/modelsource-v2/Metadata.yaml +++ b/resources/modelsource-v2/Metadata.yaml @@ -3,280 +3,47 @@ BuildVersion: 10.24.9.81004 Modules: - Name: Administration ID: O5j0GrEKKkmyWj3j8dSfVQ== - Attributes: - $ID: - subtype: 0 - data: - - 59 - - 152 - - 244 - - 26 - - 177 - - 10 - - 42 - - 73 - - 178 - - 90 - - 61 - - 227 - - 241 - - 212 - - 159 - - 85 - $Type: Projects$ModuleImpl - AppStoreGuid: 1d7b7a3f-84e6-4fc1-baf0-afbd0ee23b13 - AppStorePackageId: 23513 - AppStoreVersion: 4.1.0 - AppStoreVersionGuid: 08b6928f-4a67-4983-b98e-decffcec5a82 - FromAppStore: true - IsThemeModule: false - Name: Administration - NewSortIndex: -0.5 + FromAppStore: true + AppStoreVersion: 4.1.0 + AppStoreGuid: 1d7b7a3f-84e6-4fc1-baf0-afbd0ee23b13 + AppStoreVersionGuid: 08b6928f-4a67-4983-b98e-decffcec5a82 - Name: Atlas_Core ID: po8inIuZIUaXMNeU8eApPQ== - Attributes: - $ID: - subtype: 0 - data: - - 166 - - 143 - - 34 - - 156 - - 139 - - 153 - - 33 - - 70 - - 151 - - 48 - - 215 - - 148 - - 241 - - 224 - - 41 - - 61 - $Type: Projects$ModuleImpl - AppStoreGuid: 0404ab0c-4521-419c-9a90-b804e7038da3 - AppStorePackageId: 117187 - AppStoreVersion: 3.15.0 - AppStoreVersionGuid: 9c8be597-7410-4fa5-bd40-330ba80417f5 - FromAppStore: true - IsThemeModule: true - Name: Atlas_Core - NewSortIndex: 38 + FromAppStore: true + AppStoreVersion: 3.15.0 + AppStoreGuid: 0404ab0c-4521-419c-9a90-b804e7038da3 + AppStoreVersionGuid: 9c8be597-7410-4fa5-bd40-330ba80417f5 - Name: Atlas_Web_Content ID: GMyJGqJY0U2f8EzUDi71Dg== - Attributes: - $ID: - subtype: 0 - data: - - 24 - - 204 - - 137 - - 26 - - 162 - - 88 - - 209 - - 77 - - 159 - - 240 - - 76 - - 212 - - 14 - - 46 - - 245 - - 14 - $Type: Projects$ModuleImpl - AppStoreGuid: 08060dc1-8f61-4969-8f90-707c74fc0cc1 - AppStorePackageId: 117183 - AppStoreVersion: 3.7.0 - AppStoreVersionGuid: c78ddb3b-ecb1-4970-b3f7-e1aa18334abb - FromAppStore: true - IsThemeModule: true - Name: Atlas_Web_Content - NewSortIndex: 39 + FromAppStore: true + AppStoreVersion: 3.7.0 + AppStoreGuid: 08060dc1-8f61-4969-8f90-707c74fc0cc1 + AppStoreVersionGuid: c78ddb3b-ecb1-4970-b3f7-e1aa18334abb - Name: DataWidgets ID: jwnoFbjX9UKZzhRqfaFXdw== - Attributes: - $ID: - subtype: 0 - data: - - 143 - - 9 - - 232 - - 21 - - 184 - - 215 - - 245 - - 66 - - 153 - - 206 - - 20 - - 106 - - 125 - - 161 - - 87 - - 119 - $Type: Projects$ModuleImpl - AppStoreGuid: b0376c9a-37f9-4c96-bca9-491d20f3e975 - AppStorePackageId: 116540 - AppStoreVersion: 2.28.1 - AppStoreVersionGuid: 3ab7ec2f-84cd-4973-bc66-3e0f4d992b90 - FromAppStore: true - IsThemeModule: true - Name: DataWidgets - NewSortIndex: 2 + FromAppStore: true + AppStoreVersion: 2.28.1 + AppStoreGuid: b0376c9a-37f9-4c96-bca9-491d20f3e975 + AppStoreVersionGuid: 3ab7ec2f-84cd-4973-bc66-3e0f4d992b90 - Name: FeedbackModule ID: uiNyvoj+W0uB9ORByapJZw== - Attributes: - $ID: - subtype: 0 - data: - - 186 - - 35 - - 114 - - 190 - - 136 - - 254 - - 91 - - 75 - - 129 - - 244 - - 228 - - 65 - - 201 - - 170 - - 73 - - 103 - $Type: Projects$ModuleImpl - AppStoreGuid: de8fdcee-11ea-4431-aead-8caba99a1c60 - AppStorePackageId: 205506 - AppStoreVersion: 3.0.0 - AppStoreVersionGuid: ef1f1ed1-df73-43c8-b8df-4253b1213f2d - FromAppStore: true - IsThemeModule: true - Name: FeedbackModule - NewSortIndex: 4 + FromAppStore: true + AppStoreVersion: 3.0.0 + AppStoreGuid: de8fdcee-11ea-4431-aead-8caba99a1c60 + AppStoreVersionGuid: ef1f1ed1-df73-43c8-b8df-4253b1213f2d - Name: Module2 ID: NR8NSYo2t0qz/m3jTEL67A== - Attributes: - $ID: - subtype: 0 - data: - - 53 - - 31 - - 13 - - 73 - - 138 - - 54 - - 183 - - 74 - - 179 - - 254 - - 109 - - 227 - - 76 - - 66 - - 250 - - 236 - $Type: Projects$ModuleImpl - AppStoreGuid: "" - AppStorePackageId: 0 - AppStoreVersion: "" - AppStoreVersionGuid: "" - FromAppStore: false - IsThemeModule: false - Name: Module2 - NewSortIndex: 3.86974074450023 - Name: MyFirstModule ID: xn10Fre2rkKqvyVdyirurw== - Attributes: - $ID: - subtype: 0 - data: - - 198 - - 125 - - 116 - - 22 - - 183 - - 182 - - 174 - - 66 - - 170 - - 191 - - 37 - - 93 - - 202 - - 42 - - 238 - - 175 - $Type: Projects$ModuleImpl - AppStoreGuid: "" - AppStorePackageId: 0 - AppStoreVersion: "" - AppStoreVersionGuid: "" - FromAppStore: false - IsThemeModule: false - Name: MyFirstModule - NewSortIndex: 2 - Name: NanoflowCommons ID: /mV0S5zof0WElMGNgYBtnA== - Attributes: - $ID: - subtype: 0 - data: - - 254 - - 101 - - 116 - - 75 - - 156 - - 232 - - 127 - - 69 - - 132 - - 148 - - 193 - - 141 - - 129 - - 128 - - 109 - - 156 - $Type: Projects$ModuleImpl - AppStoreGuid: 75fda84f-6c3d-460d-98eb-50cdbfd3b53d - AppStorePackageId: 109515 - AppStoreVersion: 4.0.4 - AppStoreVersionGuid: 3c158f97-71cf-4b32-b296-deb89e5e825e - FromAppStore: true - IsThemeModule: false - Name: NanoflowCommons - NewSortIndex: 2.75 + FromAppStore: true + AppStoreVersion: 4.0.4 + AppStoreGuid: 75fda84f-6c3d-460d-98eb-50cdbfd3b53d + AppStoreVersionGuid: 3c158f97-71cf-4b32-b296-deb89e5e825e - Name: WebActions ID: LrkbIDFi7UqJBl7WEXRFzg== - Attributes: - $ID: - subtype: 0 - data: - - 46 - - 185 - - 27 - - 32 - - 49 - - 98 - - 237 - - 74 - - 137 - - 6 - - 94 - - 214 - - 17 - - 116 - - 69 - - 206 - $Type: Projects$ModuleImpl - AppStoreGuid: 87f3694f-b0d1-432e-a150-df1753dbd0e8 - AppStorePackageId: 114337 - AppStoreVersion: 2.10.0 - AppStoreVersionGuid: 507824ec-9757-4b89-85b5-8d1f4fc4bc34 - FromAppStore: true - IsThemeModule: false - Name: WebActions - NewSortIndex: 3 + FromAppStore: true + AppStoreVersion: 2.10.0 + AppStoreGuid: 87f3694f-b0d1-432e-a150-df1753dbd0e8 + AppStoreVersionGuid: 507824ec-9757-4b89-85b5-8d1f4fc4bc34 diff --git a/resources/modelsource-v2/Module2/MicroflowLoopExample.Microflows$Microflow.yaml b/resources/modelsource-v2/Module2/MicroflowLoopExample.Microflows$Microflow.yaml index cead6df..8111ed0 100644 --- a/resources/modelsource-v2/Module2/MicroflowLoopExample.Microflows$Microflow.yaml +++ b/resources/modelsource-v2/Module2/MicroflowLoopExample.Microflows$Microflow.yaml @@ -12,20 +12,20 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MicroflowLoopExample +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$RetrieveAction ErrorHandlingType: Rollback ResultVariableName: UserList @@ -39,55 +39,38 @@ MainFunction: $Type: Microflows$ConstantRange SingleObject: false XpathConstraint: "" - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$LoopedActivity - Documentation: "" - ErrorHandlingType: Rollback - LoopSource: + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$LoopedActivity + Documentation: "" + ErrorHandlingType: Rollback + LoopSource: $Type: Microflows$IterableList ListVariableName: UserList VariableName: IteratorUser - ObjectCollection: + ObjectCollection: $Type: Microflows$MicroflowObjectCollection Objects: - - $ID: g/PgRp//CUStmibDmOJGUQ== - $Type: Microflows$ExclusiveSplit + - $Type: Microflows$ExclusiveSplit Caption: Blocked? Documentation: "" ErrorHandlingType: Rollback - RelativeMiddlePoint: 423;230 - Size: 90;60 SplitCondition: - $ID: x671Oc5lIUqVaYCRFRq33Q== $Type: Microflows$ExpressionSplitCondition Expression: $IteratorUser/Blocked - - $ID: qvJvj4trREyhrd0EFQZqAA== - $Type: Microflows$ActionActivity + - $Type: Microflows$ActionActivity Action: - $ID: 0wFuJMG8Z0ODTTj4cFqdaw== $Type: Microflows$ChangeAction ChangeVariableName: IteratorUser Commit: "Yes" ErrorHandlingType: Rollback Items: - - $ID: 3ndmYkpAQEG56GUahxkUVQ== - $Type: Microflows$ChangeActionItem + - $Type: Microflows$ChangeActionItem Association: "" Attribute: System.User.Blocked - Type: Set Value: "false" RefreshInClient: false AutoGenerateCaption: true @@ -95,22 +78,16 @@ MainFunction: Caption: Activity Disabled: false Documentation: "" - RelativeMiddlePoint: 556;216 - Size: 120;60 - - $ID: FxQfVn3+6UalNzCY6BlRGQ== - $Type: Microflows$ActionActivity + - $Type: Microflows$ActionActivity Action: - $ID: BsJx2U6qc0mMSYhVzohrVA== $Type: Microflows$LogMessageAction ErrorHandlingType: Rollback IncludeLatestStackTrace: false Level: Info MessageTemplate: - $ID: pPxO50LYuECvCnIPPyLU8w== $Type: Microflows$StringTemplate Parameters: - - $ID: QmUmW9/5wkGUIEBKeJFeIw== - $Type: Microflows$TemplateParameter + - $Type: Microflows$TemplateParameter Expression: $IteratorUser/Name Text: User {1} not blocked Node: '''Module2''' @@ -119,21 +96,15 @@ MainFunction: Caption: Activity Disabled: false Documentation: "" - RelativeMiddlePoint: 89;259 - Size: 120;60 - - $ID: VbyRMrCfdECSP4TpmH3wJg== - $Type: Microflows$ActionActivity + - $Type: Microflows$ActionActivity Action: - $ID: ZZKOWEUdDUqCkmWvTkKvTg== $Type: Microflows$MicroflowCallAction ErrorHandlingType: Rollback MicroflowCall: - $ID: CkMwoLD0zkeY4/gzHvyLIQ== $Type: Microflows$MicroflowCall Microflow: Module2.SubMicroflowExample ParameterMappings: - - $ID: z1Oi4YYudUWjQw+shw//Og== - $Type: Microflows$MicroflowCallParameterMapping + - $Type: Microflows$MicroflowCallParameterMapping Argument: $IteratorUser Parameter: Module2.SubMicroflowExample.User QueueSettings: null @@ -144,25 +115,6 @@ MainFunction: Caption: Activity Disabled: false Documentation: "" - RelativeMiddlePoint: 242;101 - Size: 120;60 - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MicroflowLoopExample ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v2/Module2/MultiLineMicroflow.Microflows$Microflow.yaml b/resources/modelsource-v2/Module2/MultiLineMicroflow.Microflows$Microflow.yaml index 3e2f37f..0070765 100644 --- a/resources/modelsource-v2/Module2/MultiLineMicroflow.Microflows$Microflow.yaml +++ b/resources/modelsource-v2/Module2/MultiLineMicroflow.Microflows$Microflow.yaml @@ -9,23 +9,23 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ExclusiveSplit - Caption: hello - Documentation: "" - ErrorHandlingType: Rollback - SplitCondition: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: MultiLineMicroflow +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ExclusiveSplit + Caption: hello + Documentation: "" + ErrorHandlingType: Rollback + SplitCondition: $Type: Microflows$ExpressionSplitCondition Expression: |- if $currentUser/Name = 'Hello' then @@ -39,70 +39,26 @@ MainFunction: else false - Splits: - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: kFLcqSkTTE2SbZHeWHs7RA== - $Type: Microflows$EnumerationCase - Value: "true" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: - $Type: Microflows$ChangeAction - ChangeVariableName: currentUser - Commit: "No" - ErrorHandlingType: Rollback - Items: - - $ID: pP7PeHh36UGf5MurbcmkNw== - $Type: Microflows$ChangeActionItem - Association: "" - Attribute: System.User.Name - Type: Set - Value: " if $currentUser/Name = 'a' then\n'b'\nelse if $currentUser/Name = 'b' then\n'c'\nelse\n$currentUser/Name\n" - RefreshInClient: false - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: Pp0aNAtKQEGJxbZFmKrXcw== - $Type: Microflows$EnumerationCase - Value: "false" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-15 - OriginControlVector: 0;15 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: MultiLineMicroflow + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$ActionActivity + Action: + $Type: Microflows$ChangeAction + ChangeVariableName: currentUser + Commit: "No" + ErrorHandlingType: Rollback + Items: + - $Type: Microflows$ChangeActionItem + Association: "" + Attribute: System.User.Name + Value: " if $currentUser/Name = 'a' then\n'b'\nelse if $currentUser/Name = 'b' then\n'c'\nelse\n$currentUser/Name\n" + RefreshInClient: false + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v2/Module2/SubMicroflowExample.Microflows$Microflow.yaml b/resources/modelsource-v2/Module2/SubMicroflowExample.Microflows$Microflow.yaml index b9b15c3..ebcbd17 100644 --- a/resources/modelsource-v2/Module2/SubMicroflowExample.Microflows$Microflow.yaml +++ b/resources/modelsource-v2/Module2/SubMicroflowExample.Microflows$Microflow.yaml @@ -9,20 +9,29 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: +MarkAsUsed: false +MicroflowActionInfo: null +MicroflowReturnType: + $Type: DataTypes$VoidType +Name: SubMicroflowExample +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$MicroflowParameter + DefaultValue: "" + Documentation: "" + HasVariableNameBeenChanged: false + IsRequired: true + Name: User + VariableType: + $Type: DataTypes$ObjectType + Entity: System.User + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$LogMessageAction ErrorHandlingType: Rollback IncludeLatestStackTrace: false @@ -30,118 +39,47 @@ MainFunction: MessageTemplate: $Type: Microflows$StringTemplate Parameters: - - $ID: fzpeCz9EJ0euoHen2mxcIQ== - $Type: Microflows$TemplateParameter + - $Type: Microflows$TemplateParameter Expression: $User/Name Text: Hello {1} Node: '''Example''' - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -30;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ActionActivity - Action: + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveSplit + Caption: more than 0? + Documentation: "" + ErrorHandlingType: Rollback + SplitCondition: + $Type: Microflows$ExpressionSplitCondition + Expression: $counter > 0 + - $Type: Microflows$ActionActivity + Action: $Type: Microflows$CreateVariableAction ErrorHandlingType: Rollback InitialValue: "10" VariableName: counter VariableType: $Type: DataTypes$IntegerType - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 30;0 - - Attributes: - $Type: Microflows$ExclusiveMerge - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$ExclusiveSplit - Caption: more than 0? - Documentation: "" - ErrorHandlingType: Rollback - SplitCondition: - $Type: Microflows$ExpressionSplitCondition - Expression: $counter > 0 - Splits: - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: ckJSVPWxw0CZrqKfFsuO5A== - $Type: Microflows$EnumerationCase - Value: "false" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 15;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" - - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: JTA1JyHlTkOWjStmhI0qGg== - $Type: Microflows$EnumerationCase - Value: "true" - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;-30 - OriginControlVector: 0;15 - - Attributes: - $Type: Microflows$ActionActivity - Action: - $Type: Microflows$ChangeVariableAction - ChangeVariableName: counter - ErrorHandlingType: Rollback - Value: $counter - 1 - AutoGenerateCaption: true - BackgroundColor: Default - Caption: Activity - Disabled: false - Documentation: "" - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: [] - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: 0;15 - OriginControlVector: -30;0 - - Attributes: - $Type: Microflows$ExclusiveMerge -MarkAsUsed: false -MicroflowActionInfo: null -MicroflowReturnType: - $Type: DataTypes$VoidType -Name: SubMicroflowExample + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" + - $Type: Microflows$ExclusiveMerge + - $Type: Microflows$ActionActivity + Action: + $Type: Microflows$ChangeVariableAction + ChangeVariableName: counter + ErrorHandlingType: Rollback + Value: $counter - 1 + AutoGenerateCaption: true + BackgroundColor: Default + Caption: Activity + Disabled: false + Documentation: "" ReturnVariableName: "" Url: "" UrlSearchParameters: [] diff --git a/resources/modelsource-v2/MyFirstModule/MyFirstLogic.Microflows$Microflow.yaml b/resources/modelsource-v2/MyFirstModule/MyFirstLogic.Microflows$Microflow.yaml index 882a57e..a551aaa 100644 --- a/resources/modelsource-v2/MyFirstModule/MyFirstLogic.Microflows$Microflow.yaml +++ b/resources/modelsource-v2/MyFirstModule/MyFirstLogic.Microflows$Microflow.yaml @@ -9,28 +9,20 @@ ConcurrenyErrorMessage: Documentation: "" Excluded: false ExportLevel: Hidden -MainFunction: - - Attributes: - $Type: Microflows$StartEvent - - Attributes: - $Type: Microflows$SequenceFlow - CaseValues: - - $ID: D3Po1QicOkyhuybPVJjvAQ== - $Type: Microflows$NoCase - IsErrorHandler: false - Line: - $Type: Microflows$BezierCurve - DestinationControlVector: -15;0 - OriginControlVector: 0;0 - - Attributes: - $Type: Microflows$EndEvent - Documentation: "" - ReturnValue: "" MarkAsUsed: false MicroflowActionInfo: null MicroflowReturnType: $Type: DataTypes$VoidType Name: MyFirstLogic +ObjectCollection: + $Type: Microflows$MicroflowObjectCollection + Objects: + - $Type: Microflows$StartEvent + - $Type: Microflows$EndEvent + Documentation: "" + ReturnValue: "" + - $Type: Microflows$Annotation + Caption: "Microflows are used to define server logic in your app.\r\n\r\n- For client logic you can use Nanoflows\r\n- For business process logic you can use Workflows\r\n\r\nDocumentation: https://docs.mendix.com/refguide/application-logic" ReturnVariableName: "" Url: "" UrlSearchParameters: []