diff --git a/mocha-dotnet/src/lib/Mocha.Core/InstanceHandle.cs b/mocha-dotnet/src/lib/Mocha.Core/InstanceHandle.cs
index 9102e18..f20e1d4 100755
--- a/mocha-dotnet/src/lib/Mocha.Core/InstanceHandle.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/InstanceHandle.cs
@@ -79,6 +79,10 @@ namespace Mocha.Core
if (IsEmpty)
return "(empty) ";
+ if (Oms.DebugOms != null)
+ {
+ return Oms.DebugOms.GetInstanceText(this);
+ }
return _ID.ToString();
}
diff --git a/mocha-dotnet/src/lib/Mocha.Core/KnownAttributeGuids.cs b/mocha-dotnet/src/lib/Mocha.Core/KnownAttributeGuids.cs
index 027e07d..21fea54 100755
--- a/mocha-dotnet/src/lib/Mocha.Core/KnownAttributeGuids.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/KnownAttributeGuids.cs
@@ -29,6 +29,7 @@ namespace Mocha.Core
}
public static class Boolean
{
+ public static Guid MethodIsOfTypeSpecified { get; } = new Guid("{6e9df667-0f95-4320-a4be-5cdb00f1d4ee}");
public static Guid DisplayVersionInBadge { get; } = new Guid("{BE5966A4-C4CA-49A6-B504-B6E8759F392D}");
public static Guid Editable { get; } = new Guid("{957fd8b3-fdc4-4f35-87d6-db1c0682f53c}");
public static Guid Static { get; } = new Guid("{9A3A0719-64C2-484F-A55E-22CD4597D9FD}");
diff --git a/mocha-dotnet/src/lib/Mocha.Core/KnownInstanceGuids.cs b/mocha-dotnet/src/lib/Mocha.Core/KnownInstanceGuids.cs
index 5f3b693..243dc70 100755
--- a/mocha-dotnet/src/lib/Mocha.Core/KnownInstanceGuids.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/KnownInstanceGuids.cs
@@ -44,10 +44,15 @@ namespace Mocha.Core
public static Guid Method { get; } = new Guid("{D2813913-80B6-4DD6-9AD6-56D989169734}");
+ public static Guid AccumulationFunction { get; } = new Guid("{64f1b972-63c8-46c9-94a5-17a3cab957fe}");
+ public static Guid SelectionFunction { get; } = new Guid("{bdaef55d-9905-4d24-84c2-7439d43a79df}");
+
// public static Guid MethodCall { get; } = new Guid("{084A6D58-32C9-4A5F-9D2B-86C46F74E522}");
+ public static Guid ConditionGroup { get; } = new Guid("{df2059e6-650c-49a8-8188-570ccbe4fd2d}");
public static Guid ConditionalEvaluationCase { get; } = new Guid("{ba18abdc-11ae-46af-850a-eb30280b0ffa}");
public static Guid ConditionalSelectAttributeCase { get; } = new Guid("{a1115690-c400-4e3e-9c8f-24e2a9477e8f}");
+ public static Guid ConditionalSelectFromInstanceSetCase { get; } = new Guid("{d799b07a-3f9e-4cb2-bd91-40ffa688ccb1}");
public static Guid AccessModifier { get; } = new Guid("{ca4fcc11-16c8-4872-a712-82e589d382ce}");
@@ -136,6 +141,11 @@ namespace Mocha.Core
public static Guid CommonBoolean { get; } = new Guid("{5b025da3-b7bd-45a9-b084-48c4a922bf72}");
public static Guid CommonInstanceSet { get; } = new Guid("{3382da21-4fc5-45dc-bbd1-f7ba3ece1a1b}");
+
+ public static Guid BooleanOperator { get; } = new Guid("{fb85933c-e2ad-4b1c-ac2a-f92c9cc57e1c}");
+ public static Guid RelationalOperator { get; } = new Guid("{f1b5d26f-2347-49cb-8aae-d80dd706fce2}");
+ public static Guid LogicalOperator { get; } = new Guid("{340d464a-b47d-40a2-a185-be4d974b5899}");
+ public static Guid ArithmeticOperator { get; } = new Guid("{8196e8b1-849d-4b18-a78b-5684dca7b7f4}");
}
public static class Methods
{
@@ -148,6 +158,16 @@ namespace Mocha.Core
public static Guid Tenant__get__Current_Tenant { get; } = new Guid("{22ec44d5-bede-48bb-96ca-03481611422c}");
public static Guid Instance__get__This_Instance { get; } = new Guid("{d78fe3ca-3c15-41a0-bccf-0a701b4712a4}");
}
+ public static class GetRelationship
+ {
+ public static Guid Instance__get__Parent_Class { get; } = new Guid("{bac8c59f-8994-41e8-b0c0-659ec8efc4e2}");
+ // public static Guid Method__get__Parent_Class__HACK { get; } = new Guid("{89034a1c-50e5-47a1-abb8-076ece5343a8}");
+ }
+ public static class ConditionalSelectAttribute
+ {
+ public static Guid Method__get__Method_Abbreviation { get; } = new Guid("{f0c64709-385d-481b-8f58-83e507fb261c}");
+ public static Guid Method_Binding__get__Method_Binding_Abbreviation { get; } = new Guid("{7154cb08-0f80-4af4-bca5-c2c12e54479a}");
+ }
}
[ExportEntities(Prefix = "IDC_", Suffix = null)]
@@ -202,12 +222,19 @@ namespace Mocha.Core
public static Guid InstanceOpMethod { get; } = new Guid("{4c814982-938f-4116-bdc1-827bae6a5f71}");
public static Guid ConditionalSelectAttributeMethod { get; } = new Guid("{d534a369-321e-4c32-bd7f-8ff2017f191e}"); // 13038
// SSC - Conditional Select from Instance Set Method - 13039
+ public static Guid ConditionalSelectFromInstanceSetMethod { get; } = new Guid("{ffea8e52-06e5-4e95-8c40-da3ba54ce95f}"); // 13039
+
}
public static class SystemAttributeRoutines
{
public static Guid GetRuntimeVersion { get; } = new Guid("{dc4e6c8d-936d-457f-90e9-af47e229b80c}");
// public static Guid SystemInstanceSetRoutine { get; } = new Guid("{d17a6d27-da03-4b5d-9256-f67f978f403d}");
}
+ public static class SystemInstanceSetRoutines
+ {
+ public static Guid GetRuntimeVersion { get; } = new Guid("{dc4e6c8d-936d-457f-90e9-af47e229b80c}");
+ // public static Guid SystemInstanceSetRoutine { get; } = new Guid("{d17a6d27-da03-4b5d-9256-f67f978f403d}");
+ }
public static class PromptValueClasses
{
public static Guid InstancePromptValue { get; } = new Guid("{0A6E2CF2-97B6-4339-B1DA-1DBBFE9806C6}");
@@ -327,5 +354,35 @@ namespace Mocha.Core
/// The GUID of the `Obscured Text` EC Display Option.
public static Guid ObscuredText { get; } = new Guid("{e42fb627-6559-42e7-a8fe-59c9d674eec4}");
}
+
+ public static class AccumulationFunctions
+ {
+ public static Guid Sum { get; } = new Guid("{c84c3615-c418-4273-8212-cb7766d95ee4}");
+ public static Guid Average { get; } = new Guid("{57eb3ded-96fe-4faa-98af-3edd9ed13ab4}");
+ }
+ public static class SelectionFunctions
+ {
+ public static Guid Minimum { get; } = new Guid("{1ff7be8c-fe48-4154-9028-8ee84b7dc367}");
+ public static Guid Maximum { get; } = new Guid("{dda6c31d-5bea-41a9-a6bc-0e5c189784da}");
+ }
+ public static class RelationalOperators
+ {
+ public static Guid SubsetOfSelectionList { get; } = new Guid("{76d42d7c-f7da-4df6-92cc-b362e3a87d7b}");
+ public static Guid IsEmpty { get; } = new Guid("{b416747b-537f-46f9-b855-e71ca361d265}");
+ public static Guid CountGreaterThan { get; } = new Guid("{dbc516aa-0fd9-47a9-bab5-8cede4102af6}");
+ public static Guid CountLessThan { get; } = new Guid("{5101eb0d-bce3-4f1e-b4b1-e75f68a42829}");
+ public static Guid CountEqualTo { get; } = new Guid("{beef419c-4375-41f2-909a-af8dded51d04}");
+ public static Guid CountGreaterThanOrEqualTo { get; } = new Guid("{3579168f-52bc-49f3-be6f-a548ac74f502}");
+ public static Guid CountLessThanOrEqualTo { get; } = new Guid("{bc05d0b7-59ee-42cc-91e9-90a1e0b3ed85}");
+ public static Guid SupersetOfSelectionList { get; } = new Guid("{67d2da4e-d147-4526-9a94-526f0d79ec9c}");
+ public static Guid CountNotEqualTo { get; } = new Guid("{92ac4ea4-b034-4b09-be67-c39608ae2ecf}");
+ public static Guid IsNotEmpty { get; } = new Guid("{aeb5a45f-2aff-4b2b-8f6d-f05f50bc8f8c}");
+ public static Guid NotInSelectionList { get; } = new Guid("{7fde8600-680b-4c07-be3b-2660f00b01c2}");
+ public static Guid InSelectionList { get; } = new Guid("{824417e6-61e5-4e74-9e95-514905c01846}");
+ public static Guid NotSupersetOfSelectionList { get; } = new Guid("{8e695935-548a-4177-a474-581fc960eddb}");
+ public static Guid NotSubsetOfSelectionList { get; } = new Guid("{ef7726d6-2feb-426c-bf2c-770014d35f68}");
+ public static Guid NotExactMatchWithSelectionList { get; } = new Guid("{f08a632a-1f3e-4979-8ec5-17fefc33b865}");
+ public static Guid ExactMatchWithSelectionList { get; } = new Guid("{93611da1-e21e-4021-9ddd-f7575e0c79ec}");
+ }
}
}
diff --git a/mocha-dotnet/src/lib/Mocha.Core/KnownRelationshipGuids.cs b/mocha-dotnet/src/lib/Mocha.Core/KnownRelationshipGuids.cs
index 27acd2d..66fada4 100755
--- a/mocha-dotnet/src/lib/Mocha.Core/KnownRelationshipGuids.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/KnownRelationshipGuids.cs
@@ -101,8 +101,10 @@ namespace Mocha.Core
public static Guid Parameter_Assignment__assigns_to__Parameter { get; } = new Guid("{a6d30e78-7bff-4fcc-b109-ee96681b0a9e}");
public static Guid Parameter__assigned_from__Parameter_Assignment { get; } = new Guid("{2085341e-5e7e-4a7f-bb8d-dfa58f6030d9}");
- public static Guid Method_Binding__assigned_to__Parameter_Assignment { get; } = new Guid("{cbcb23b7-10c4-49eb-a1ca-b9da73fe8b83}");
- public static Guid Parameter_Assignment__assigns_from__Method_Binding { get; } = new Guid("{1e055d30-a968-49d8-93fe-541994fc0c51}");
+ public static Guid Executable_returning_Work_Data__assigned_from__Parameter_Assignment { get; } = new Guid("{40540642-69b3-4713-ac55-6946060bd385}");
+ public static Guid Parameter_Assignment__assigns_from__Executable_returning_Work_Data { get; } = new Guid("{6f3687ed-7d88-4ece-914e-c47c57c1146d}");
+ public static Guid Parameter_Assignment__assigns_to__Work_Data { get; } = new Guid("{51c37636-35d2-4528-99ca-50cf09fa1427}");
+ public static Guid Work_Data__assigned_by__Parameter_Assignment { get; } = new Guid("{b9e0cc99-ef20-435f-b7b2-e19c5cd44916}");
public static Guid Method_Call__has__Method { get; } = new Guid("{3D3B601B-4EF0-49F3-AF05-86CEA0F00619}");
public static Guid Method_Call__has__Prompt_Value { get; } = new Guid("{765BD0C9-117D-4D0E-88C9-2CEBD4898135}");
@@ -128,8 +130,17 @@ namespace Mocha.Core
public static Guid Get_Referenced_Instance_Set_Method__loop_on__Instance_Set { get; } = new Guid("{2978238f-7cb0-4ba3-8c6f-473df782cfef}");
public static Guid Get_Referenced_Instance_Set_Method__has_relationship__Method { get; } = new Guid("{6a65819e-c8cb-4575-9af8-ee221364049b}");
- public static Guid Get_Referenced_Attribute_Method__has__Attribute { get; } = new Guid("{87f90fe9-5ec6-4b09-8f51-b8a4d1544cae}");
- public static Guid Get_Referenced_Attribute_Method__loop_on__Instance_Set { get; } = new Guid("{c7ecd498-6d05-4e07-b1bc-f7127d0d6666}");
+ public static Guid Get_Referenced_Attribute_Method__returns__Attribute { get; } = new Guid("{87f90fe9-5ec6-4b09-8f51-b8a4d1544cae}");
+ public static Guid Attribute__returned_by__Get_Referenced_Attribute_Method { get; } = new Guid("{80e4ffd8-77d8-4835-a4e0-73a176e7f646}");
+ public static Guid Get_Referenced_Attribute_Method__uses_reference__Executable_returning_Instance_Set { get; } = new Guid("{c7ecd498-6d05-4e07-b1bc-f7127d0d6666}");
+ public static Guid Executable_returning_Instance_Set__reference_used_by__Get_Referenced_Attribute_Method { get; } = new Guid("{b9a44398-e6c5-48f9-8ec5-a8b158a7adf5}");
+ public static Guid Get_Referenced_Attribute_Method__uses_answer__Executable_returning_Attribute { get; } = new Guid("{022ccde3-2b9e-4573-a8fc-e7568f420cd3}");
+ public static Guid Executable_returning_Attribute__answer_used_by__Get_Referenced_Attribute_Method { get; } = new Guid("{738ff9a4-eb71-476e-a0a4-524f1de56add}");
+
+ public static Guid Get_Referenced_Attribute_Method__uses__Accumulation_Function { get; } = new Guid("{68888355-a162-40b3-8dd6-532bf84d219a}");
+ public static Guid Accumulation_Function__used_by__Get_Referenced_Attribute_Method { get; } = new Guid("{a3af2e78-78ab-4c99-a2d2-f359aa7966cd}");
+ public static Guid Get_Referenced_Attribute_Method__uses_order__Executable_returning_Attribute { get; } = new Guid("{ee8e21c4-1afc-403a-a3f0-4c1544285f5c}");
+ public static Guid Executable_returning_Attribute__order_used_by__Get_Referenced_Attribute_Method { get; } = new Guid("{dec00186-e3c8-4440-ae23-dc9e91bccb49}");
public static Guid Evaluate_Boolean_Expression_Method__has_source_attribute__Method { get; } = new Guid("{45d76d56-01ed-4641-9f68-cfe0c7d0d265}");
public static Guid Evaluate_Boolean_Expression_Method__equal_to_attribute__Method { get; } = new Guid("{0646df91-7e3e-4d59-be71-b978a22ced8e}");
@@ -230,7 +241,9 @@ namespace Mocha.Core
public static Guid Method__provides_content_for__Content_Page_Component { get; } = new Guid("{5E75000D-2421-4AD4-9E5F-B9FDD9CB4744}");
public static Guid Securable_Item__secured_by__Method { get; } = new Guid("{15199c49-9595-4288-846d-13b0ad5dcd4b}");
- public static Guid Get_Relationship_Method__has__Relationship { get; } = new Guid("{321581d6-60c1-4547-8344-9d5bda027adc}");
+
+ public static Guid Get_Relationship_Method__returns__Relationship { get; } = new Guid("{321581d6-60c1-4547-8344-9d5bda027adc}");
+ public static Guid Relationship__returned_by__Get_Relationship_Method { get; } = new Guid("{174242ec-7615-42d9-9639-c70ff6e84e0d}");
public static Guid Integration_ID__has__Integration_ID_Usage { get; } = new Guid("{6cd30735-df83-4253-aabe-360d6e1a3701}");
public static Guid Integration_ID_Usage__for__Integration_ID { get; } = new Guid("{d8d981ec-7686-40da-b89f-006c85042444}");
@@ -241,11 +254,11 @@ namespace Mocha.Core
public static Guid Conditional_Method_Case__has_return_attribute__Method_Binding { get; } = new Guid("{b6715132-b438-4073-b81d-3ecf19584b7d}");
public static Guid Method_Binding__returns_attribute_for__Conditional_Method_Case { get; } = new Guid("{1c868a06-8fb7-432d-839b-7a5a02a50eb6}");
- public static Guid Conditional_Method_Case__has_true_condition__Method_Binding { get; } = new Guid("{d955da3f-7ef4-4374-8b86-167c73434f75}");
- public static Guid Method_Binding__true_condition_for__Conditional_Method_Case { get; } = new Guid("{1acdefd1-e1b4-45bb-99e1-bf73dea71da5}");
+ public static Guid Condition_Group__has_true_condition__Executable_returning_Work_Data { get; } = new Guid("{d955da3f-7ef4-4374-8b86-167c73434f75}");
+ public static Guid Executable_returning_Work_Data__true_condition_for__Condition_Group { get; } = new Guid("{1acdefd1-e1b4-45bb-99e1-bf73dea71da5}");
- public static Guid Conditional_Method_Case__has_false_condition__Method_Binding { get; } = new Guid("{e46dbc4f-ae8d-4ad8-b9e6-10cedfa68b73}");
- public static Guid Method_Binding__false_condition_for__Conditional_Method_Case { get; } = new Guid("{633af008-bf7f-4da1-94d6-67a9a80586d6}");
+ public static Guid Condition_Group__has_false_condition__Executable_returning_Work_Data { get; } = new Guid("{e46dbc4f-ae8d-4ad8-b9e6-10cedfa68b73}");
+ public static Guid Executable_returning_Work_Data__false_condition_for__Condition_Group { get; } = new Guid("{633af008-bf7f-4da1-94d6-67a9a80586d6}");
public static Guid Audit_Line__has__Instance { get; } = new Guid("{c91807ed-0d73-4729-990b-d90750764fb5}");
public static Guid Audit_Line__has__User { get; } = new Guid("{7c1e048d-3dcb-4473-9f2e-e21014a76aa5}");
@@ -298,5 +311,43 @@ namespace Mocha.Core
public static Guid Style__implements__Style { get; } = new Guid("{99b1c16a-f2cb-4cc5-a3bb-82a96335aa39}");
public static Guid Style__implemented_for__Style { get; } = new Guid("{271ef816-1e94-4f02-a805-4f9536c28dca}");
+
+ public static Guid Select_From_Instance_Set_Method__returns__Work_Set { get; } = new Guid("{e7805b49-0eb3-46ea-bc8a-a5ed676a7726}");
+ public static Guid Work_Set__returned_by__Select_from_Instance_Set_Method { get; } = new Guid("{df12608a-e157-4a1b-bae2-0224a18f5b94}");
+ public static Guid Select_from_Instance_Set_Method__uses__Executable_returning_Instance_Set { get; } = new Guid("{a907f814-b996-4294-b347-ca16ccaf1f5b}");
+ public static Guid Executable_returning_Instance_Set__used_by__Select_from_Instance_Set_Method { get; } = new Guid("{a3ec06f9-54e8-4279-a31d-d221f8697a6a}");
+ public static Guid Select_from_Instance_Set_Method__uses__Set_Function { get; } = new Guid("{abda76ae-a969-40e3-aed2-1a20fcec8b31}");
+ public static Guid Set_Function__used_by__Select_from_Instance_Set_Method { get; } = new Guid("{753f9f4f-3fe3-470a-890d-d799c24e47af}");
+ public static Guid Select_from_Instance_Set_Method__uses__Selection_Function { get; } = new Guid("{6498e72e-f321-4be2-acfd-dfd6f916ce54}");
+ public static Guid Selection_Function__used_by__Select_from_Instance_Set_Method { get; } = new Guid("{e5e6a392-a436-41f7-bc80-cb6603503be1}");
+ public static Guid Select_from_Instance_Set_Method__uses_function__Executable_returning_Attribute { get; } = new Guid("{30905c53-0d64-4332-9023-12a03e60cd09}");
+ public static Guid Executable_returning_Attribute__function_used_by__Select_from_Instance_Set_Method { get; } = new Guid("{79adb5ea-0257-445b-9f7c-e5f8508a59a2}");
+ public static Guid Select_from_Instance_Set_Method__uses_order__Executable_returning_Attribute { get; } = new Guid("{c7a5ef47-fce3-4e7c-87b8-f5cab93b1b10}");
+ public static Guid Executable_returning_Attribute__order_used_by__Select_from_Instance_Set_Method { get; } = new Guid("{48c984ea-f4da-4090-bdd0-fd659b9be13d}");
+ public static Guid Select_from_Instance_Set_Method__uses_subset_index__Executable_returning_Attribute { get; } = new Guid("{b5ef8d8b-683a-4cb9-9e6c-bc470324f4e3}");
+ public static Guid Executable_returning_Attribute__as_subset_index_for__Select_from_Instance_Set_Method { get; } = new Guid("{7d03574f-db28-4aff-a96c-8013832b8269}");
+ public static Guid Select_from_Instance_Set_Method__uses_comparator__Executable_returning_Work_Data { get; } = new Guid("{974c6e8b-b04f-4e3c-8719-298052afa9c7}");
+ public static Guid Executable_returning_Work_Data__comparator_for__Select_from_Instance_Set_Method { get; } = new Guid("{c877ea85-ee9f-4e22-bae7-4a0d7b9272e1}");
+
+ public static Guid Conditional_Select_From_Instance_Set_Method__returns__Work_Set { get; } = new Guid("{49396bd0-b5a9-4384-99f4-2126d80b3b66}");
+ public static Guid Work_Set__returned_by__Conditional_Select_from_Instance_Set_Method { get; } = new Guid("{221a23dd-1230-4690-a15a-26345b111b0d}");
+ public static Guid Conditional_Select_from_Instance_Set_Method__has__Conditional_Select_from_Instance_Set_Case { get; } = new Guid("{b6715132-b438-4073-b81d-3ecf19584b7d}");
+ public static Guid Conditional_Select_from_Instance_Set_Case__for__Conditional_Select_from_Instance_Set_Method { get; } = new Guid("{8fde1baa-ce2e-4245-a775-bc4c66eac7b5}");
+
+ public static Guid Conditional_Select_Attribute_Method__returns__Attribute { get; } = new Guid("{b2b9d9cc-c4dd-491b-853e-e3669ea4e66a}");
+ public static Guid Attribute__returned_by__Conditional_Select_Attribute_Method { get; } = new Guid("{e3e734ce-953b-49b8-b50d-b1826b519053}");
+ public static Guid Conditional_Select_Attribute_Method__has__Conditional_Select_Attribute_Case { get; } = new Guid("{49396bd0-b5a9-4384-99f4-2126d80b3b66}");
+ public static Guid Conditional_Select_Attribute_Case__for__Conditional_Select_Attribute_Method { get; } = new Guid("{38e2816e-ccb4-4e89-86ab-4981f5c2d7ac}");
+
+
+ public static Guid Evaluate_Boolean_Expression_Method__returns__Boolean_Attribute { get; } = new Guid("{53cf2cb6-f5f2-499f-9f18-26b86bf671c4}");
+ public static Guid Boolean_Attribute__returned_by__Evaluate_Boolean_Expression_Method { get; } = new Guid("{24397b98-65da-4f5a-93a3-e933bab1f59b}");
+ public static Guid Evaluate_Boolean_Expression_Method__has_source__Executable_returning_Work_Data { get; } = new Guid("{45d76d56-01ed-4641-9f68-cfe0c7d0d265}");
+ public static Guid Executable_returning_Work_Data__source_for__Evaluate_Boolean_Expression_Method { get; } = new Guid("{eef048af-179e-4375-8a85-2856bb14aea3}");
+ public static Guid Evaluate_Boolean_Expression_Method__has_target__Executable_returning_Work_Data { get; } = new Guid("{0646df91-7e3e-4d59-be71-b978a22ced8e}");
+ public static Guid Executable_returning_Work_Data__target_for__Evaluate_Boolean_Expression_Method { get; } = new Guid("{be7a6285-d700-40f3-868e-c0878a3e94a6}");
+ public static Guid Evaluate_Boolean_Expression_Method__uses__Boolean_Operator { get; } = new Guid("{aa9e17a2-e4d9-4598-bcfc-2d729031d11c}");
+ public static Guid Boolean_Operator__used_by__Evaluate_Boolean_Expression_Method { get; } = new Guid("{1e9915a9-3c91-4532-ab9c-82419660e31a}");
+
}
}
diff --git a/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/ConditionalSelectAttributeMethodImplementation.cs b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/ConditionalSelectAttributeMethodImplementation.cs
new file mode 100644
index 0000000..f4d0f30
--- /dev/null
+++ b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/ConditionalSelectAttributeMethodImplementation.cs
@@ -0,0 +1,60 @@
+
+namespace Mocha.Core.MethodImplementations;
+
+public class ConditionalSelectAttributeMethodImplementation : MethodImplementation
+{
+ public override Guid MethodClassGuid => KnownInstanceGuids.MethodClasses.ConditionalSelectAttributeMethod;
+
+ protected override InstanceHandle ExecuteInternal(Oms oms, OmsContext context, InstanceHandle method)
+ {
+ InstanceHandle returnsAttribute = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Conditional_Select_Attribute_Method__returns__Attribute));
+
+ IReadOnlyCollection cases = oms.GetRelatedInstances(method, oms.GetInstance(KnownRelationshipGuids.Conditional_Select_Attribute_Method__has__Conditional_Select_Attribute_Case));
+ foreach (InstanceHandle cas in cases)
+ {
+ bool value = false;
+
+ IEnumerable trueConditions = oms.GetRelatedInstances(cas, oms.GetInstance(KnownRelationshipGuids.Condition_Group__has_true_condition__Executable_returning_Work_Data));
+ IEnumerable falseConditions = oms.GetRelatedInstances(cas, oms.GetInstance(KnownRelationshipGuids.Condition_Group__has_false_condition__Executable_returning_Work_Data));
+ bool useAnyCondition = oms.GetAttributeValue(cas, oms.GetInstance(KnownAttributeGuids.Boolean.UseAnyCondition));
+ if (trueConditions != null)
+ {
+ foreach (InstanceHandle trueCondition in trueConditions)
+ {
+ InstanceHandle ret = oms.Execute(context, trueCondition);
+ object? retval = context.GetWorkData(ret);
+ if (retval is bool && ((bool)retval))
+ {
+ value = true;
+ break;
+ }
+ }
+ }
+ if (falseConditions != null)
+ {
+ foreach (InstanceHandle falseCondition in falseConditions)
+ {
+ InstanceHandle ret = oms.Execute(context, falseCondition);
+ object? retval = context.GetWorkData(ret);
+ if (retval is bool && (!(bool)retval))
+ {
+ value = true;
+ break;
+ }
+ }
+ }
+
+ if (value)
+ {
+ InstanceHandle execAttr = oms.GetRelatedInstance(cas, oms.GetInstance(KnownRelationshipGuids.Conditional_Select_Attribute_Case__invokes__Executable_returning_Attribute));
+ InstanceHandle hwd = oms.Execute(context, execAttr);
+ object? val = context.GetWorkData(hwd);
+
+ context.SetWorkData(returnsAttribute, val);
+ break; // we don't need to check another case do we?
+ }
+ }
+
+ return returnsAttribute;
+ }
+}
\ No newline at end of file
diff --git a/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/ConditionalSelectFromInstanceSetMethodImplementation.cs b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/ConditionalSelectFromInstanceSetMethodImplementation.cs
new file mode 100644
index 0000000..955ef27
--- /dev/null
+++ b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/ConditionalSelectFromInstanceSetMethodImplementation.cs
@@ -0,0 +1,12 @@
+
+namespace Mocha.Core.MethodImplementations;
+
+public class ConditionalSelectFromInstanceSetMethodImplementation : MethodImplementation
+{
+ public override Guid MethodClassGuid => KnownInstanceGuids.MethodClasses.ConditionalSelectFromInstanceSetMethod;
+
+ protected override InstanceHandle ExecuteInternal(Oms oms, OmsContext context, InstanceHandle method)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
diff --git a/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/EvaluateBooleanExpressionMethodImplementation.cs b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/EvaluateBooleanExpressionMethodImplementation.cs
new file mode 100644
index 0000000..acc78eb
--- /dev/null
+++ b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/EvaluateBooleanExpressionMethodImplementation.cs
@@ -0,0 +1,66 @@
+using System.Formats.Asn1;
+using MBS.Core.Collections;
+
+namespace Mocha.Core.MethodImplementations;
+
+public class EvaluateBooleanExpressionMethodImplementation : MethodImplementation
+{
+ public override Guid MethodClassGuid => KnownInstanceGuids.MethodClasses.EvaluateBooleanExpressionMethod;
+ protected override InstanceHandle ExecuteInternal(Oms oms, OmsContext context, InstanceHandle method)
+ {
+ InstanceHandle c_Class = oms.GetInstance(KnownInstanceGuids.Classes.Class);
+
+ InstanceHandle irForClass = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Method__for__Class));
+ InstanceHandle returnsAttribute = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__returns__Boolean_Attribute));
+
+ if (returnsAttribute == InstanceHandle.Empty)
+ {
+ throw new InvalidOperationException("no return Attribute specified for method");
+ }
+
+
+ /*
+ IEnumerable source = oms.GetRelatedInstances(method, oms.GetInstance(KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__has_source__Executable_returning_Work_Data));
+ InstanceHandle comparison = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__uses__Boolean_Operator));
+ IEnumerable target = oms.GetRelatedInstances(method, oms.GetInstance(KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__has_target__Executable_returning_Work_Data));
+ */
+
+ InstanceHandle source = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__has_source__Executable_returning_Work_Data));
+ InstanceHandle comparison = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__uses__Boolean_Operator));
+ InstanceHandle target = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__has_target__Executable_returning_Work_Data));
+
+ InstanceHandle[] rtarget_value = new InstanceHandle[0];
+
+ InstanceHandle rsource = oms.Execute(context, source);
+ object? rsource_valueraw = context.GetWorkData(rsource);
+
+ InstanceHandle[] rsource_value = new InstanceHandle[0];
+ if (rsource_valueraw is InstanceHandle[])
+ {
+ rsource_value = (InstanceHandle[])rsource_valueraw;
+ }
+
+ if (oms.IsInstanceOf(target, c_Class))
+ {
+ rtarget_value = new InstanceHandle[] { target };
+ }
+ else
+ {
+ InstanceHandle rtarget = oms.Execute(context, target);
+ object? rtarget_valueraw = context.GetWorkData(rtarget);
+ }
+
+ bool value = false;
+
+ if (comparison == oms.GetInstance(KnownInstanceGuids.RelationalOperators.InSelectionList))
+ {
+ if (rtarget_value.ContainsAny(rsource_value))
+ {
+ value = true;
+ }
+ }
+
+ context.SetWorkData(returnsAttribute, value);
+ return returnsAttribute;
+ }
+}
\ No newline at end of file
diff --git a/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetAttributeMethodImplementation.cs b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetAttributeMethodImplementation.cs
index 954600a..12be163 100644
--- a/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetAttributeMethodImplementation.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetAttributeMethodImplementation.cs
@@ -13,8 +13,13 @@ public class GetAttributeMethodImplementation : MethodImplementation
throw new InvalidOperationException("no Work Set specified for method");
}
- InstanceHandle forInstance = (InstanceHandle) context.GetWorkData(irForClass);
- object? value = oms.UnsafeGetAttributeValue(forInstance, returnsAttribute);
+ InstanceHandle? forInstance = (InstanceHandle?) context.GetWorkData(irForClass);
+ if (forInstance == null)
+ {
+ throw new NullReferenceException(String.Format("non-static method call without instance reference {0}", oms.GetGlobalIdentifier(irForClass)));
+ }
+
+ object? value = oms.UnsafeGetAttributeValue((InstanceHandle) forInstance, returnsAttribute);
context.SetWorkData(returnsAttribute, value);
return returnsAttribute;
}
diff --git a/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetReferencedAttributeMethodImplementation.cs b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetReferencedAttributeMethodImplementation.cs
new file mode 100644
index 0000000..4d3610a
--- /dev/null
+++ b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetReferencedAttributeMethodImplementation.cs
@@ -0,0 +1,80 @@
+namespace Mocha.Core.MethodImplementations;
+
+public class GetReferencedAttributeMethodImplementation : MethodImplementation
+{
+ public override Guid MethodClassGuid => KnownInstanceGuids.MethodClasses.GetReferencedAttributeMethod;
+ protected override InstanceHandle ExecuteInternal(Oms oms, OmsContext context, InstanceHandle method)
+ {
+ Guid methodId = oms.GetGlobalIdentifier(method);
+
+ InstanceHandle irForClass = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Method__for__Class));
+
+ InstanceHandle returnsAttribute = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Get_Referenced_Attribute_Method__returns__Attribute));
+ InstanceHandle referenceInstanceSet = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Get_Referenced_Attribute_Method__uses_reference__Executable_returning_Instance_Set));
+ InstanceHandle answerAttribute = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Get_Referenced_Attribute_Method__uses_answer__Executable_returning_Attribute));
+ InstanceHandle usesAccumulationFunction = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Get_Referenced_Attribute_Method__uses__Accumulation_Function));
+ InstanceHandle usesOrderAttribute = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Get_Referenced_Attribute_Method__uses_order__Executable_returning_Attribute));
+
+ if (returnsAttribute == InstanceHandle.Empty)
+ {
+ throw new InvalidOperationException(String.Format("no return Attribute specified for method {0}", methodId));
+ }
+
+ InstanceHandle referenceInstanceSetWS = oms.Execute(context, referenceInstanceSet);
+ object? referenceInstanceSetValue = context.GetWorkData(referenceInstanceSetWS);
+ if (referenceInstanceSetValue is IReadOnlyCollection)
+ {
+ IReadOnlyCollection list = (IReadOnlyCollection)referenceInstanceSetValue;
+ object? retval = null;
+ int avg_c = 0;
+
+ foreach (InstanceHandle inst in list)
+ {
+ InstanceHandle pclass = oms.GetParentClass(inst);
+ context.SetWorkData(pclass, inst);
+
+ InstanceHandle answerAttributeValueWD = oms.Execute(context, answerAttribute);
+ object? answerAttributeValue = context.GetWorkData(answerAttributeValueWD);
+
+ if (usesAccumulationFunction == oms.GetInstance(KnownInstanceGuids.AccumulationFunctions.Sum))
+ {
+ if (retval == null)
+ {
+ retval = 0M;
+ }
+ if (retval is decimal && answerAttributeValue is decimal)
+ {
+ retval = (decimal)retval + (decimal)answerAttributeValue;
+ }
+ }
+ else if (usesAccumulationFunction == oms.GetInstance(KnownInstanceGuids.AccumulationFunctions.Average))
+ {
+ if (retval == null)
+ {
+ retval = 0M;
+ }
+ if (retval is decimal && answerAttributeValue is decimal)
+ {
+ retval = (decimal)retval + (decimal)answerAttributeValue;
+ avg_c++;
+ }
+ }
+ else
+ {
+ retval = answerAttributeValue;
+ }
+ }
+
+ if (avg_c > 0)
+ {
+ retval = (decimal)retval / avg_c;
+ }
+ context.SetWorkData(returnsAttribute, retval);
+ }
+
+ // 1$12740 NIM - Native Instance Set Method
+ // 1$12741 NAM - Native Attribute Method
+ // 1$12742 NUM - Native Update Method
+ return returnsAttribute;
+ }
+}
\ No newline at end of file
diff --git a/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetRelationshipMethodImplementation.cs b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetRelationshipMethodImplementation.cs
new file mode 100644
index 0000000..a161604
--- /dev/null
+++ b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/GetRelationshipMethodImplementation.cs
@@ -0,0 +1,49 @@
+using System.ComponentModel.Design;
+
+namespace Mocha.Core.MethodImplementations;
+
+public class GetRelationshipMethodImplementation : MethodImplementation
+{
+ public override Guid MethodClassGuid => KnownInstanceGuids.MethodClasses.GetRelationshipMethod;
+ protected override InstanceHandle ExecuteInternal(Oms oms, OmsContext context, InstanceHandle method)
+ {
+ Guid methodId = oms.GetGlobalIdentifier(method);
+
+ InstanceHandle irForClass = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Method__for__Class));
+
+ InstanceHandle? forClassInstanceV = context.GetWorkData(irForClass);
+
+ bool singular = oms.GetAttributeValue(method, oms.GetInstance(KnownAttributeGuids.Boolean.Singular), false);
+
+ InstanceHandle returnsRelationship = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Get_Relationship_Method__returns__Relationship));
+ if (returnsRelationship == InstanceHandle.Empty)
+ {
+ throw new InvalidOperationException(String.Format("no return Relationship specified for method {0}", methodId));
+ }
+
+ IEnumerable ihs = new InstanceHandle[0];
+
+ // HACK: there is no `GR - Get Relationship Method.returns Work Set`
+ if (forClassInstanceV != null)
+ {
+ ihs = oms.GetRelatedInstances((InstanceHandle)forClassInstanceV, returnsRelationship);
+ }
+
+ if (singular)
+ {
+ if (ihs.Count() > 0)
+ {
+ context.SetWorkData(returnsRelationship, ihs.First());
+ }
+ else
+ {
+ context.SetWorkData(returnsRelationship, null);
+ }
+ }
+ else
+ {
+ context.SetWorkData(returnsRelationship, ihs);
+ }
+ return returnsRelationship;
+ }
+}
\ No newline at end of file
diff --git a/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/SelectFromInstanceSetMethodImplementation.cs b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/SelectFromInstanceSetMethodImplementation.cs
new file mode 100644
index 0000000..6b3bf93
--- /dev/null
+++ b/mocha-dotnet/src/lib/Mocha.Core/MethodImplementations/SelectFromInstanceSetMethodImplementation.cs
@@ -0,0 +1,79 @@
+using System.ComponentModel.Design;
+using Mocha.Core.Oop;
+
+namespace Mocha.Core.MethodImplementations;
+
+public class SelectFromInstanceSetMethodImplementation : MethodImplementation
+{
+ private struct OrderableData
+ {
+ public string Order;
+ public object Data;
+ }
+
+ public override Guid MethodClassGuid => KnownInstanceGuids.MethodClasses.SelectFromInstanceSetMethod;
+ protected override InstanceHandle ExecuteInternal(Oms oms, OmsContext context, InstanceHandle method)
+ {
+ Guid methodId = oms.GetGlobalIdentifier(method);
+
+ InstanceHandle irForClass = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Method__for__Class));
+ InstanceHandle? forClassInstanceV = context.GetWorkData(irForClass);
+
+ InstanceHandle returnsWorkSet = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Select_From_Instance_Set_Method__returns__Work_Set));
+ if (returnsWorkSet == InstanceHandle.Empty)
+ {
+ throw new InvalidOperationException(String.Format("no return Work Set specified for method {0}", methodId));
+ }
+
+ InstanceHandle usesInstanceSet = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Select_from_Instance_Set_Method__uses__Executable_returning_Instance_Set));
+ object? instanceSetValues = context.GetWorkData(usesInstanceSet);
+
+ InstanceHandle selectionFunction = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Select_from_Instance_Set_Method__uses__Selection_Function));
+ InstanceHandle setFunction = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Select_from_Instance_Set_Method__uses__Set_Function));
+ InstanceHandle orderAttribute = oms.GetRelatedInstance(method, oms.GetInstance(KnownRelationshipGuids.Select_from_Instance_Set_Method__uses_order__Executable_returning_Attribute));
+
+ List list = new List();
+
+ if (instanceSetValues is IEnumerable)
+ {
+
+ }
+ else if (instanceSetValues is IEnumerable)
+ {
+ IEnumerable vals = (IEnumerable)instanceSetValues;
+ foreach (InstanceWrapper inst in vals)
+ {
+ OrderableData od = new OrderableData();
+ od.Data = inst.Handle;
+ if (orderAttribute != InstanceHandle.Empty)
+ {
+ InstanceHandle ihWorkData = oms.Execute(context, orderAttribute, inst.Handle);
+ string order = context.GetWorkData(ihWorkData);
+
+ od.Order = order;
+ }
+ else
+ {
+ od.Order = String.Empty;
+ }
+ list.Add(od);
+ }
+
+ list.Sort((c, d) => c.Order.CompareTo(d.Order));
+ }
+
+ if (list.Count > 0)
+ {
+ // FIXME: this assumes a hardcoded singular work set
+ if (selectionFunction == oms.GetInstance(KnownInstanceGuids.SelectionFunctions.Minimum))
+ {
+ context.SetWorkData(returnsWorkSet, list[0].Data);
+ }
+ else if (selectionFunction == oms.GetInstance(KnownInstanceGuids.SelectionFunctions.Maximum))
+ {
+ context.SetWorkData(returnsWorkSet, list[list.Count - 1].Data);
+ }
+ }
+ return returnsWorkSet;
+ }
+}
\ No newline at end of file
diff --git a/mocha-dotnet/src/lib/Mocha.Core/Oms.cs b/mocha-dotnet/src/lib/Mocha.Core/Oms.cs
index 034151e..c7bc83f 100644
--- a/mocha-dotnet/src/lib/Mocha.Core/Oms.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/Oms.cs
@@ -15,6 +15,8 @@ using Mocha.Core.Oop;
public abstract class Oms
{
+ public static Oms DebugOms { get; private set; }
+
public Version RuntimeVersion { get; } = new Version(2, 0, 38762, 5);
///
@@ -33,6 +35,7 @@ public abstract class Oms
public void Initialize()
{
InitializeInternal();
+ DebugOms = this;
MethodImplementation[] methodImplementations = MBS.Core.Reflection.TypeLoader.GetAvailableTypes(new System.Reflection.Assembly[] { Assembly.GetExecutingAssembly() });
foreach (MethodImplementation impl in methodImplementations)
@@ -89,7 +92,10 @@ public abstract class Oms
{
return GetGlobalIdentifierInternal(instance);
}
-
+ public Guid GetGlobalIdentifier(InstanceWrapper wrapper)
+ {
+ return GetGlobalIdentifier(wrapper.Handle);
+ }
protected abstract void AssignRelationshipInternal(InstanceHandle source, InstanceHandle relationship, IEnumerable targets, DateTime effectiveDate);
public void AssignRelationship(InstanceHandle source, InstanceHandle relationship, IEnumerable targets, DateTime effectiveDate)
@@ -173,6 +179,36 @@ public abstract class Oms
throw new KeyNotFoundException();
}
+ public bool TryGetInstance(Guid globalIdentifier, out T instance) where T : ConcreteInstanceWrapper
+ {
+ if (TryGetInstance(globalIdentifier, out InstanceHandle ih))
+ {
+ InstanceHandle parentClass = GetParentClass(ih);
+
+ Type tType = typeof(T);
+ ConcreteInstanceWrapper ci = (ConcreteInstanceWrapper) tType.Assembly.CreateInstance(tType.FullName, false, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, new object[] { ih }, null, null);
+ if (ci != null)
+ {
+ if (ci.ClassId == GetGlobalIdentifier(parentClass))
+ {
+ instance = (T)ci;
+ return true;
+ }
+ }
+ }
+ instance = null;
+ return false;
+ }
+
+ public T GetInstance(Guid globalIdentifier) where T : ConcreteInstanceWrapper
+ {
+ if (TryGetInstance(globalIdentifier, out T ih))
+ {
+ return ih;
+ }
+ throw new KeyNotFoundException();
+ }
+
protected abstract IReadOnlyCollection GetRelatedInstancesInternal(InstanceHandle source, InstanceHandle relationship, DateTime effectiveDate);
public IReadOnlyCollection GetRelatedInstances(InstanceHandle source, InstanceHandle relationship, DateTime effectiveDate)
{
@@ -322,7 +358,8 @@ public abstract class Oms
if (!RecursiveClassHasAttribute(sourceParentClass, attribute))
{
string name = GetAttributeValue(attribute, GetInstance(KnownAttributeGuids.Text.Name));
- throw new ArgumentException(String.Format("Undefined attribute `{0}` on class {1}", name, GetGlobalIdentifier(sourceParentClass)));
+ string sourceParentClassName = GetAttributeValue(sourceParentClass, GetInstance(KnownAttributeGuids.Text.Name));
+ throw new ArgumentException(String.Format("Undefined attribute `{0}` on class `{1}`", name, sourceParentClassName));
}
if (IsInstanceOf(attribute, a_TextAttribute))
@@ -471,6 +508,11 @@ public abstract class Oms
return CreateRelationship(sourceClass, relationshipName, destinationClass, relationshipGuid, singular, null, Guid.Empty);
}
public InstanceHandle CreateRelationship(InstanceHandle sourceClass, string relationshipName, InstanceHandle destinationClass, Guid relationshipGuid, bool singular, string siblingRelationshipName, Guid siblingRelationshipGuid)
+ {
+ InstanceHandle relationshipInstance = CreateRelationship(sourceClass, relationshipName, destinationClass, relationshipGuid, singular, siblingRelationshipName, siblingRelationshipGuid, out InstanceHandle siblingRelationshipInstance);
+ return relationshipInstance;
+ }
+ public InstanceHandle CreateRelationship(InstanceHandle sourceClass, string relationshipName, InstanceHandle destinationClass, Guid relationshipGuid, bool singular, string siblingRelationshipName, Guid siblingRelationshipGuid, out InstanceHandle siblingRelationshipInstance)
{
InstanceHandle c_Relationship = GetInstance(KnownInstanceGuids.Classes.Relationship);
if (c_Relationship == InstanceHandle.Empty)
@@ -513,6 +555,7 @@ public abstract class Oms
SetAttributeValue(irRelationship, a_Singular, singular);
AssignRelationship(irRelationship, r_Relationship__has_destination__Class, destinationClass);
+ siblingRelationshipInstance = InstanceHandle.Empty;
if (siblingRelationshipName != null)
{
if (siblingRelationshipGuid == Guid.Empty)
@@ -520,13 +563,13 @@ public abstract class Oms
siblingRelationshipGuid = Guid.NewGuid();
}
- InstanceHandle irSiblingRelationship = CreateInstanceOf(c_Relationship, siblingRelationshipGuid);
- AssignRelationship(irSiblingRelationship, r_Relationship__has_source__Class, destinationClass);
- SetAttributeValue(irSiblingRelationship, a_RelationshipType, siblingRelationshipName);
- AssignRelationship(irSiblingRelationship, r_Relationship__has_destination__Class, sourceClass);
+ siblingRelationshipInstance = CreateInstanceOf(c_Relationship, siblingRelationshipGuid);
+ AssignRelationship(siblingRelationshipInstance, r_Relationship__has_source__Class, destinationClass);
+ SetAttributeValue(siblingRelationshipInstance, a_RelationshipType, siblingRelationshipName);
+ AssignRelationship(siblingRelationshipInstance, r_Relationship__has_destination__Class, sourceClass);
- AssignRelationship(irRelationship, r_Relationship__has_sibling__Relationship, irSiblingRelationship);
- AssignRelationship(irSiblingRelationship, r_Relationship__has_sibling__Relationship, irRelationship);
+ AssignRelationship(irRelationship, r_Relationship__has_sibling__Relationship, siblingRelationshipInstance);
+ AssignRelationship(siblingRelationshipInstance, r_Relationship__has_sibling__Relationship, irRelationship);
}
return irRelationship;
}
@@ -586,11 +629,15 @@ public abstract class Oms
implementation.Initialize(this);
}
+ public InstanceHandle Execute(OmsContext context, MethodBinding methodBinding, InstanceHandle? targetInstance = null)
+ {
+ return Execute(context, methodBinding.Handle, targetInstance);
+ }
public InstanceHandle Execute(OmsContext context, Method method, InstanceHandle? targetInstance = null)
{
return Execute(context, method.Handle, targetInstance);
}
- public InstanceHandle Execute(OmsContext context, ReturnInstanceSetMethodBinding methodBinding)
+ public InstanceHandle Execute(OmsContext context, MethodBinding methodBinding)
{
return Execute(context, methodBinding.Handle);
}
@@ -614,6 +661,18 @@ public abstract class Oms
if (IsInstanceOf(methodOrMethodBinding, GetInstance(KnownInstanceGuids.Classes.ReturnAttributeMethodBinding))
|| IsInstanceOf(methodOrMethodBinding, GetInstance(KnownInstanceGuids.Classes.ReturnInstanceSetMethodBinding)))
{
+ IEnumerable parameterAssignments = GetRelatedInstances(methodOrMethodBinding, GetInstance(KnownRelationshipGuids.Method_Binding__has__Parameter_Assignment));
+ foreach (InstanceHandle parm in parameterAssignments)
+ {
+ InstanceHandle assignsToParm = GetRelatedInstance(parm, GetInstance(KnownRelationshipGuids.Parameter_Assignment__assigns_to__Work_Data));
+
+ InstanceHandle assignsFromWorkData = GetRelatedInstance(parm, GetInstance(KnownRelationshipGuids.Parameter_Assignment__assigns_from__Executable_returning_Work_Data));
+ if (IsInstanceOf(assignsFromWorkData, GetInstance(KnownInstanceGuids.Classes.Class)))
+ {
+ assignsFromWorkData = context.GetWorkData(assignsFromWorkData);
+ }
+ context.SetWorkData(assignsToParm, assignsFromWorkData);
+ }
return ExecuteMethodBinding(context, methodOrMethodBinding);
}
else
@@ -666,15 +725,17 @@ public abstract class Oms
{
return CreateWorkSet(name, false, new InstanceHandle[0]);
}
- public WorkSet CreateWorkSet(string name, bool singular, ICollection validClasses)
+ public WorkSet CreateWorkSet(string name, bool singular, ICollection validClasses = null)
{
InstanceHandle workSet = CreateInstanceOf(GetInstance(KnownInstanceGuids.Classes.WorkSet));
SetAttributeValue(workSet, GetInstance(KnownAttributeGuids.Text.Name), name);
SetAttributeValue(workSet, GetInstance(KnownAttributeGuids.Boolean.Singular), singular);
-
- if (validClasses.Count > 0)
+ if (validClasses != null)
{
- AssignRelationship(workSet, GetInstance(KnownRelationshipGuids.Work_Set__has_valid__Class), validClasses);
+ if (validClasses.Count > 0)
+ {
+ AssignRelationship(workSet, GetInstance(KnownRelationshipGuids.Work_Set__has_valid__Class), validClasses);
+ }
}
return new WorkSet(workSet);
}
@@ -713,11 +774,10 @@ public abstract class Oms
InstanceHandle ramb = GetRelatedInstance(parentClass, ihLabeledByRAMB);
OmsContext context = CreateContext();
- object value = Execute(context, ramb);
- if (value is string)
- {
- return (string)value;
- }
+ InstanceHandle wd = Execute(context, ramb);
+
+ string value = context.GetWorkData(wd);
+ return value;
}
// FIXME: remove when we have Class@get Instance Text implemented
@@ -731,6 +791,25 @@ public abstract class Oms
string name = GetAttributeValue(inst, GetInstance(KnownAttributeGuids.Text.Name));
sb.Append(name);
}
+ else if (IsInstanceOf(inst, GetInstance(KnownInstanceGuids.Classes.Attribute)))
+ {
+ string name = GetAttributeValue(inst, GetInstance(KnownAttributeGuids.Text.Name));
+ sb.Append(name);
+ }
+ else if (IsInstanceOf(inst, GetInstance(KnownInstanceGuids.Classes.Relationship)))
+ {
+ InstanceHandle sourceClass = GetRelatedInstance(inst, GetInstance(KnownRelationshipGuids.Relationship__has_source__Class));
+ string relationshipType = GetAttributeValue(inst, GetInstance(KnownAttributeGuids.Text.RelationshipType));
+ InstanceHandle destinationClass = GetRelatedInstance(inst, GetInstance(KnownRelationshipGuids.Relationship__has_destination__Class));
+
+ string sourceClassName = GetInstanceText(sourceClass);
+ string destinationClassName = GetInstanceText(destinationClass);
+ sb.Append(sourceClassName);
+ sb.Append('.');
+ sb.Append(relationshipType);
+ sb.Append(' ');
+ sb.Append(destinationClassName);
+ }
else if (IsInstanceOf(inst, GetInstance(KnownInstanceGuids.Classes.Method)))
{
InstanceHandle forClass = GetRelatedInstance(inst, GetInstance(KnownRelationshipGuids.Method__for__Class));
@@ -796,9 +875,34 @@ public abstract class Oms
string _name = GetAttributeValue(method, a_Name);
if (_verb.Equals(verb) && _name.Equals(name))
{
- return Method.CreateFromInstance(this, method);
+ return (Method)ConcreteInstanceWrapper.Wrap(this, method);
}
}
return null;
}
+
+ ///
+ /// Convenience function to create an enumeration of instances based on global identifiers.
+ ///
+ /// The global identifier of the resulting enumeration class.
+ /// The global identifiers of the instances (members) of the enumeration class.
+ ///
+ public InstanceHandle CreateEnumeration(Guid globalIdentifier, Guid[] memberGlobalIdentifiers)
+ {
+ InstanceHandle c_Enum = CreateEnumeration(globalIdentifier, memberGlobalIdentifiers, out InstanceHandle[] memberInstanceHandles);
+ return c_Enum;
+ }
+ public InstanceHandle CreateEnumeration(Guid globalIdentifier, Guid[] memberGlobalIdentifiers, out InstanceHandle[] memberInstanceHandles)
+ {
+ if (!TryGetInstance(globalIdentifier, out InstanceHandle c_Enum))
+ {
+ c_Enum = CreateInstanceOf(GetInstance(KnownInstanceGuids.Classes.Class), globalIdentifier);
+ }
+ memberInstanceHandles = new InstanceHandle[memberGlobalIdentifiers.Length];
+ for (int i = 0; i < memberGlobalIdentifiers.Length; i++)
+ {
+ memberInstanceHandles[i] = CreateInstanceOf(c_Enum, memberGlobalIdentifiers[i]);
+ }
+ return c_Enum;
+ }
}
diff --git a/mocha-dotnet/src/lib/Mocha.Core/OmsContext.cs b/mocha-dotnet/src/lib/Mocha.Core/OmsContext.cs
index b7906f0..5f3d4ae 100644
--- a/mocha-dotnet/src/lib/Mocha.Core/OmsContext.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/OmsContext.cs
@@ -26,10 +26,24 @@ public class OmsContext
return null;
}
+ public T GetWorkData(InstanceHandle parm, T defaultValue = default(T))
+ {
+ object? val = GetWorkData(parm);
+ if (val is T)
+ {
+ return (T)val;
+ }
+ return defaultValue;
+ }
+
public void SetWorkData(WorkSet parm, object? value)
{
SetWorkData(parm.Handle, value);
}
+ public void SetWorkData(InstanceHandle parm, IInstanceWrapper value)
+ {
+ SetWorkData(parm, value.Handle);
+ }
public void SetWorkData(InstanceHandle parm, object? value)
{
if (oms.IsInstanceOf(parm, oms.GetInstance(KnownInstanceGuids.Classes.WorkSet)))
@@ -53,14 +67,14 @@ public class OmsContext
}
}
}
- else if (value is IReadOnlyCollection)
+ else if (value is IEnumerable)
{
- IReadOnlyCollection insts = (IReadOnlyCollection)value;
- if (singular && insts.Count > 1)
+ IEnumerable insts = (IEnumerable)value;
+ if (singular && insts.Count() > 1)
{
throw new InvalidOperationException("Singular Work Set must only contain a single InstanceReference or be an array of InstanceReference that contains exactly zero or one item.");
}
- IReadOnlyCollection irs = oms.GetRelatedInstances(parm, oms.GetInstance(KnownRelationshipGuids.Work_Set__has_valid__Class));
+ IEnumerable irs = oms.GetRelatedInstances(parm, oms.GetInstance(KnownRelationshipGuids.Work_Set__has_valid__Class));
if (irs != null)
{
foreach (InstanceHandle ir in insts)
@@ -73,9 +87,33 @@ public class OmsContext
}
}
}
+ else if (value is IEnumerable)
+ {
+ IEnumerable insts = (IEnumerable)value;
+ if (singular && insts.Count() > 1)
+ {
+ throw new InvalidOperationException("Singular Work Set must only contain a single InstanceReference or be an array of InstanceReference that contains exactly zero or one item.");
+ }
+ IEnumerable irs = oms.GetRelatedInstances(parm, oms.GetInstance(KnownRelationshipGuids.Work_Set__has_valid__Class));
+ if (irs != null)
+ {
+ if (irs.Count() > 0)
+ {
+ foreach (InstanceWrapper iw in insts)
+ {
+ InstanceHandle ir = iw.Handle;
+ InstanceHandle parentClass = oms.GetParentClass(ir);
+ if (!irs.Contains(parentClass))
+ {
+ throw new ArgumentException("instance reference must be an instance of appropriate class");
+ }
+ }
+ }
+ }
+ }
else
{
- throw new ArgumentException("cannot assign literal data to a Work Set");
+ throw new ArgumentException(String.Format("cannot assign literal data '{0}' to a Work Set", value));
}
}
_WorkData[parm] = value;
diff --git a/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/MiniOms.cs b/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/MiniOms.cs
index 02a3211..4d59145 100644
--- a/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/MiniOms.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/MiniOms.cs
@@ -68,6 +68,7 @@ public class MiniOms : MemoryOms
a_ContentType = CreateInstanceOf(c_TextAttribute, KnownAttributeGuids.Text.ContentType);
a_RelationshipType = CreateInstanceOf(c_TextAttribute, KnownAttributeGuids.Text.RelationshipType);
a_Singular = CreateInstanceOf(c_BooleanAttribute, KnownAttributeGuids.Boolean.Singular);
+ CreateInstanceOf(c_BooleanAttribute, KnownAttributeGuids.Boolean.MethodIsOfTypeSpecified);
a_MinimumLength = CreateInstanceOf(c_NumericAttribute, KnownAttributeGuids.Numeric.MinimumLength);
a_MaximumLength = CreateInstanceOf(c_NumericAttribute, KnownAttributeGuids.Numeric.MaximumLength);
@@ -140,6 +141,7 @@ public class MiniOms : MemoryOms
c_Instance = CreateClass("Instance", KnownInstanceGuids.Classes.Instance);
SetInstanceKey(c_Instance, new InstanceKey(1, 17));
+ CreateClass("Work Data", KnownInstanceGuids.Classes.WorkData);
c_OMS = CreateClass("OMS", KnownInstanceGuids.Classes.OMS);
// ?============ MODULES ============?
diff --git a/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/MiniOmsModule.cs b/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/MiniOmsModule.cs
index 2549ddb..098ab98 100644
--- a/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/MiniOmsModule.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/MiniOmsModule.cs
@@ -2,13 +2,14 @@ namespace Mocha.Core.OmsImplementations.Mini;
public abstract class MiniOmsModule
{
- protected InstanceHandle c_Class, c_Attribute, c_TextAttribute, c_BooleanAttribute, c_NumericAttribute, c_DateAttribute, c_WorkSet, c_Instance;
+ protected InstanceHandle c_Class, c_Attribute, c_Relationship, c_TextAttribute, c_BooleanAttribute, c_NumericAttribute, c_DateAttribute, c_WorkSet, c_Instance;
protected abstract void BuildInternal(Oms oms);
public void Build(Oms oms)
{
c_Class = oms.GetInstance(KnownInstanceGuids.Classes.Class);
c_Attribute = oms.GetInstance(KnownInstanceGuids.Classes.Attribute);
+ c_Relationship = oms.GetInstance(KnownInstanceGuids.Classes.Relationship);
c_TextAttribute = oms.GetInstance(KnownInstanceGuids.Classes.TextAttribute);
c_BooleanAttribute = oms.GetInstance(KnownInstanceGuids.Classes.BooleanAttribute);
c_NumericAttribute = oms.GetInstance(KnownInstanceGuids.Classes.NumericAttribute);
diff --git a/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/Modules/MethodsModule.cs b/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/Modules/MethodsModule.cs
index 62d6ec8..ba25f63 100644
--- a/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/Modules/MethodsModule.cs
+++ b/mocha-dotnet/src/lib/Mocha.Core/OmsImplementations/Mini/Modules/MethodsModule.cs
@@ -2,7 +2,9 @@ namespace Mocha.Core.OmsImplementations.Mini;
using System;
using MBS.Core;
+using Microsoft.VisualBasic;
using Mocha.Core.Oop;
+using Mocha.Core.Oop.Methods;
///
/// Builds additional support for Executables and Methods. These must be defined in order to call
@@ -10,30 +12,53 @@ using Mocha.Core.Oop;
///
public class MethodsModule : MiniOmsModule
{
- private InstanceHandle c_OMS;
- private InstanceHandle c_Method, c_MethodBinding;
- private InstanceHandle a_Name, a_Order, a_Verb, a_Static;
+ private InstanceHandle c_WorkData, c_OMS;
+ private InstanceHandle c_ParameterAssignment, c_Method, c_MethodBinding;
+ private InstanceHandle a_Name, a_Order, a_Singular, a_Verb, a_Static, a_UseAnyCondition, a_Value;
private InstanceHandle c_ReturnAttributeMethodBinding, c_ReturnInstanceSetMethodBinding;
- private InstanceHandle c_BuildAttributeMethod, c_GetAttributeMethod, c_GetSpecifiedInstancesMethod, c_GetAttributeBySystemRoutineMethod, c_AssignAttributeMethod;
+ private InstanceHandle c_ConditionGroup;
+ private InstanceHandle c_BuildAttributeMethod, c_GetAttributeMethod, c_GetSpecifiedInstancesMethod, c_GetAttributeBySystemRoutineMethod, c_AssignAttributeMethod, c_GetRelationshipMethod, c_GetReferencedAttributeMethod, c_SelectFromInstanceSetMethod, c_ConditionalSelectFromInstanceSetCase, c_ConditionalSelectFromInstanceSetMethod, c_ConditionalSelectAttributeMethod, c_ConditionalSelectAttributeCase, c_EvaluateBooleanExpressionMethod;
private InstanceHandle c_AccessModifier, i_AccessModifier_Private, i_AccessModifier_Protected, i_AccessModifier_Public, i_AccessModifier_RootA2;
private InstanceHandle c_SystemRoutine, c_SystemAttributeRoutine, c_SystemInstanceSetRoutine;
+ private InstanceHandle c_AccumulationFunction, c_SelectionFunction, c_SetFunction;
- protected override void BuildInternal(Oms oms)
- {
- c_Method = oms.CreateInstanceOf(c_Class, KnownInstanceGuids.Classes.Method);
+ protected override void BuildInternal(Oms oms)
+ {
+ c_WorkData = oms.GetInstance(KnownInstanceGuids.Classes.WorkData);
+ c_ParameterAssignment = oms.CreateClass("Parameter Assignment", KnownInstanceGuids.Classes.ParameterAssignment);
+ oms.CreateRelationship(c_ParameterAssignment, "assigns from", c_Instance, KnownRelationshipGuids.Parameter_Assignment__assigns_from__Executable_returning_Work_Data, true, "assigned from", KnownRelationshipGuids.Executable_returning_Work_Data__assigned_from__Parameter_Assignment);
+ oms.CreateRelationship(c_ParameterAssignment, "assigns to", c_WorkData, KnownRelationshipGuids.Parameter_Assignment__assigns_to__Work_Data, true, "assigned to", KnownRelationshipGuids.Work_Data__assigned_by__Parameter_Assignment);
+
+ c_Method = oms.CreateClass("Method", KnownInstanceGuids.Classes.Method);
c_MethodBinding = oms.CreateClass("Method Binding", KnownInstanceGuids.Classes.MethodBinding);
c_ReturnAttributeMethodBinding = oms.CreateClass("Return Attribute Method Binding", KnownInstanceGuids.Classes.ReturnAttributeMethodBinding);
c_ReturnInstanceSetMethodBinding = oms.CreateClass("Return Instance Set Method Binding", KnownInstanceGuids.Classes.ReturnInstanceSetMethodBinding);
+ c_AccumulationFunction = oms.CreateEnumeration(KnownInstanceGuids.Classes.AccumulationFunction, new Guid[]
+ {
+ KnownInstanceGuids.AccumulationFunctions.Sum,
+ KnownInstanceGuids.AccumulationFunctions.Average
+ });
+ c_SelectionFunction = oms.CreateEnumeration(KnownInstanceGuids.Classes.SelectionFunction, new Guid[]
+ {
+ KnownInstanceGuids.SelectionFunctions.Maximum,
+ KnownInstanceGuids.SelectionFunctions.Minimum
+ });
+
a_Name = oms.GetInstance(KnownAttributeGuids.Text.Name);
a_Order = oms.GetInstance(KnownAttributeGuids.Text.Order);
a_Verb = oms.CreateInstanceOf(c_TextAttribute, KnownAttributeGuids.Text.Verb);
a_Static = oms.CreateInstanceOf(c_BooleanAttribute, KnownAttributeGuids.Boolean.Static);
-
+ a_Singular = oms.GetInstance(KnownAttributeGuids.Boolean.Singular);
+ a_Value = oms.GetInstance(KnownAttributeGuids.Text.Value);
+
+ a_UseAnyCondition = oms.CreateInstanceOf(oms.GetInstance(KnownInstanceGuids.Classes.BooleanAttribute), KnownAttributeGuids.Boolean.UseAnyCondition);
+ oms.SetAttributeValue(a_UseAnyCondition, a_Name, "Use Any Condition");
+
c_AccessModifier = oms.CreateInstanceOf(c_Class, KnownInstanceGuids.Classes.AccessModifier);
oms.AddAttribute(c_AccessModifier, a_Name);
oms.AddAttribute(c_AccessModifier, a_Order);
-
+
i_AccessModifier_Private = oms.CreateInstanceOf(c_AccessModifier, KnownInstanceGuids.AccessModifiers.Private);
oms.SetAttributeValue(i_AccessModifier_Private, a_Name, "Private");
oms.SetAttributeValue(i_AccessModifier_Private, a_Order, "a");
@@ -41,11 +66,11 @@ public class MethodsModule : MiniOmsModule
i_AccessModifier_Protected = oms.CreateInstanceOf(c_AccessModifier, KnownInstanceGuids.AccessModifiers.Protected);
oms.SetAttributeValue(i_AccessModifier_Protected, a_Name, "Protected");
oms.SetAttributeValue(i_AccessModifier_Protected, a_Order, "b");
-
+
i_AccessModifier_Public = oms.CreateInstanceOf(c_AccessModifier, KnownInstanceGuids.AccessModifiers.Public);
oms.SetAttributeValue(i_AccessModifier_Public, a_Name, "Public");
oms.SetAttributeValue(i_AccessModifier_Public, a_Order, "c");
-
+
i_AccessModifier_RootA2 = oms.CreateInstanceOf(c_AccessModifier, KnownInstanceGuids.AccessModifiers.RootA2);
oms.SetAttributeValue(i_AccessModifier_RootA2, a_Name, "Root (A2)");
oms.SetAttributeValue(i_AccessModifier_RootA2, a_Order, "z");
@@ -54,9 +79,11 @@ public class MethodsModule : MiniOmsModule
AccessModifier.Protected = new AccessModifier(i_AccessModifier_Protected);
AccessModifier.Public = new AccessModifier(i_AccessModifier_Public);
AccessModifier.RootA2 = new AccessModifier(i_AccessModifier_RootA2);
-
+
oms.CreateRelationship(c_Class, "has", c_Method, KnownRelationshipGuids.Class__has__Method, false, "for", KnownRelationshipGuids.Method__for__Class);
+
oms.CreateRelationship(c_MethodBinding, "executes", c_Method, KnownRelationshipGuids.Method_Binding__executes__Method, true, "executed by", KnownRelationshipGuids.Method__executed_by__Method_Binding);
+ oms.CreateRelationship(c_MethodBinding, "has", c_ParameterAssignment, KnownRelationshipGuids.Method_Binding__has__Parameter_Assignment, false, "for", KnownRelationshipGuids.Parameter_Assignment__for__Method_Binding);
c_BuildAttributeMethod = oms.CreateClass("BA - Build Attribute Method", KnownInstanceGuids.MethodClasses.BuildAttributeMethod);
oms.AddAttribute(c_BuildAttributeMethod, oms.GetInstance(KnownAttributeGuids.Text.Value));
@@ -90,6 +117,76 @@ public class MethodsModule : MiniOmsModule
oms.CreateRelationship(c_AssignAttributeMethod, "assigns", c_Attribute, KnownRelationshipGuids.Assign_Attribute_Method__assigns__Attribute, false, "assigned by", KnownRelationshipGuids.Attribute__assigned_by__Assign_Attribute_Method);
oms.AddSuperClass(c_AssignAttributeMethod, c_Method);
+ c_GetRelationshipMethod = oms.CreateClass("GR - Get Relationship Method", KnownInstanceGuids.MethodClasses.GetRelationshipMethod);
+ oms.CreateRelationship(c_GetRelationshipMethod, "returns", c_Relationship, KnownRelationshipGuids.Get_Relationship_Method__returns__Relationship, true, "returned by", KnownRelationshipGuids.Relationship__returned_by__Get_Relationship_Method);
+ oms.AddSuperClass(c_GetRelationshipMethod, c_Method);
+ oms.AddAttribute(c_GetRelationshipMethod, a_Singular);
+
+ c_GetReferencedAttributeMethod = oms.CreateClass("GRA - Get Referenced Attribute Method", KnownInstanceGuids.MethodClasses.GetReferencedAttributeMethod);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "returns", c_Attribute, KnownRelationshipGuids.Get_Referenced_Attribute_Method__returns__Attribute, true, "returned by", KnownRelationshipGuids.Attribute__returned_by__Get_Referenced_Attribute_Method);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "uses reference", c_Instance, KnownRelationshipGuids.Get_Referenced_Attribute_Method__uses_reference__Executable_returning_Instance_Set, true, "reference used by", KnownRelationshipGuids.Executable_returning_Instance_Set__reference_used_by__Get_Referenced_Attribute_Method);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "uses answer", c_Instance, KnownRelationshipGuids.Get_Referenced_Attribute_Method__uses_answer__Executable_returning_Attribute, true, "reference used by", KnownRelationshipGuids.Executable_returning_Attribute__answer_used_by__Get_Referenced_Attribute_Method);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "uses", c_AccumulationFunction, KnownRelationshipGuids.Get_Referenced_Attribute_Method__uses__Accumulation_Function, true, "used by", KnownRelationshipGuids.Accumulation_Function__used_by__Get_Referenced_Attribute_Method);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "uses order", c_Attribute, KnownRelationshipGuids.Get_Referenced_Attribute_Method__uses_order__Executable_returning_Attribute, true, "order used by", KnownRelationshipGuids.Executable_returning_Attribute__order_used_by__Get_Referenced_Attribute_Method);
+ oms.AddSuperClass(c_GetReferencedAttributeMethod, c_Method);
+
+ c_SelectFromInstanceSetMethod = oms.CreateClass("SS - Select from Instance Set Method", KnownInstanceGuids.MethodClasses.SelectFromInstanceSetMethod);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "returns", c_Attribute, KnownRelationshipGuids.Select_From_Instance_Set_Method__returns__Work_Set, true, "returned by", KnownRelationshipGuids.Work_Set__returned_by__Select_from_Instance_Set_Method);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "uses", c_Instance, KnownRelationshipGuids.Select_from_Instance_Set_Method__uses__Executable_returning_Instance_Set, true, "used by", KnownRelationshipGuids.Executable_returning_Instance_Set__used_by__Select_from_Instance_Set_Method);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "uses", c_Instance, KnownRelationshipGuids.Select_from_Instance_Set_Method__uses__Selection_Function, true, "used by", KnownRelationshipGuids.Selection_Function__used_by__Select_from_Instance_Set_Method);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "uses", c_AccumulationFunction, KnownRelationshipGuids.Select_from_Instance_Set_Method__uses__Set_Function, true, "used by", KnownRelationshipGuids.Set_Function__used_by__Select_from_Instance_Set_Method);
+ oms.CreateRelationship(c_GetReferencedAttributeMethod, "uses order", c_Attribute, KnownRelationshipGuids.Select_from_Instance_Set_Method__uses_order__Executable_returning_Attribute, true, "order used by", KnownRelationshipGuids.Executable_returning_Attribute__order_used_by__Get_Referenced_Attribute_Method);
+ oms.AddSuperClass(c_SelectFromInstanceSetMethod, c_Method);
+
+ c_ConditionGroup = oms.CreateClass("Condition Group", KnownInstanceGuids.Classes.ConditionGroup);
+ oms.CreateRelationship(c_ConditionGroup, "has true condition", c_Instance, KnownRelationshipGuids.Condition_Group__has_true_condition__Executable_returning_Work_Data, false, "true condition for", KnownRelationshipGuids.Executable_returning_Work_Data__true_condition_for__Condition_Group);
+ oms.CreateRelationship(c_ConditionGroup, "has false condition", c_Instance, KnownRelationshipGuids.Condition_Group__has_false_condition__Executable_returning_Work_Data, false, "false condition for", KnownRelationshipGuids.Executable_returning_Work_Data__false_condition_for__Condition_Group);
+ oms.AddAttribute(c_ConditionGroup, a_UseAnyCondition);
+
+ c_ConditionalSelectFromInstanceSetCase = oms.CreateClass("Conditional Select from Instance Set Case", KnownInstanceGuids.Classes.ConditionalSelectFromInstanceSetCase);
+ oms.AddSuperClass(c_ConditionalSelectFromInstanceSetCase, c_ConditionGroup);
+
+ c_ConditionalSelectFromInstanceSetMethod = oms.CreateClass("SSC - Conditional Select from Instance Set Method", KnownInstanceGuids.MethodClasses.ConditionalSelectFromInstanceSetMethod);
+ oms.CreateRelationship(c_ConditionalSelectFromInstanceSetMethod, "returns", c_WorkSet, KnownRelationshipGuids.Conditional_Select_From_Instance_Set_Method__returns__Work_Set, true, "returned by", KnownRelationshipGuids.Work_Set__returned_by__Conditional_Select_from_Instance_Set_Method);
+ oms.CreateRelationship(c_ConditionalSelectFromInstanceSetMethod, "has", c_ConditionalSelectFromInstanceSetCase, KnownRelationshipGuids.Conditional_Select_from_Instance_Set_Method__has__Conditional_Select_from_Instance_Set_Case, false, "for", KnownRelationshipGuids.Conditional_Select_from_Instance_Set_Case__for__Conditional_Select_from_Instance_Set_Method);
+ oms.AddSuperClass(c_ConditionalSelectFromInstanceSetMethod, c_Method);
+
+ c_ConditionalSelectAttributeCase = oms.CreateClass("Conditional Select Attribute Case", KnownInstanceGuids.Classes.ConditionalSelectAttributeCase);
+ oms.CreateRelationship(c_ConditionalSelectAttributeCase, "invokes", c_Attribute, KnownRelationshipGuids.Conditional_Select_Attribute_Case__invokes__Executable_returning_Attribute, true, "invoked by", KnownRelationshipGuids.Executable_returning_Attribute__invoked_by__Conditional_Select_Attribute_Case);
+ oms.AddSuperClass(c_ConditionalSelectAttributeCase, c_ConditionGroup);
+
+ c_ConditionalSelectAttributeMethod = oms.CreateClass("SAC - Conditional Select Attribute Method", KnownInstanceGuids.MethodClasses.ConditionalSelectAttributeMethod);
+ oms.CreateRelationship(c_ConditionalSelectAttributeMethod, "returns", c_Attribute, KnownRelationshipGuids.Conditional_Select_Attribute_Method__returns__Attribute, true, "returned by", KnownRelationshipGuids.Attribute__returned_by__Conditional_Select_Attribute_Method);
+ oms.CreateRelationship(c_ConditionalSelectAttributeMethod, "has", c_ConditionalSelectAttributeCase, KnownRelationshipGuids.Conditional_Select_Attribute_Method__has__Conditional_Select_Attribute_Case, false, "for", KnownRelationshipGuids.Conditional_Select_Attribute_Case__for__Conditional_Select_Attribute_Method);
+ oms.AddSuperClass(c_ConditionalSelectAttributeMethod, c_Method);
+
+ InstanceHandle c_BooleanOperator = oms.CreateClass("Boolean Operator", KnownInstanceGuids.Classes.BooleanOperator);
+ InstanceHandle c_RelationalOperator = oms.CreateClass("Relational Operator", KnownInstanceGuids.Classes.RelationalOperator);
+
+ RelationalOperator.CountEqualTo = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.CountEqualTo));
+ RelationalOperator.CountGreaterThan = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.CountGreaterThan));
+ RelationalOperator.CountGreaterThanOrEqualTo = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.CountGreaterThanOrEqualTo));
+ RelationalOperator.CountLessThan = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.CountLessThan));
+ RelationalOperator.CountLessThanOrEqualTo = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.CountLessThanOrEqualTo));
+ RelationalOperator.CountNotEqualTo = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.CountNotEqualTo));
+ RelationalOperator.ExactMatchWithSelectionList = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.ExactMatchWithSelectionList));
+ RelationalOperator.InSelectionList = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.InSelectionList));
+ RelationalOperator.IsEmpty = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.IsEmpty));
+ RelationalOperator.IsNotEmpty = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.IsNotEmpty));
+ RelationalOperator.NotExactMatchWithSelectionList = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.NotExactMatchWithSelectionList));
+ RelationalOperator.NotInSelectionList = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.NotInSelectionList));
+ RelationalOperator.NotSubsetOfSelectionList = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.NotSubsetOfSelectionList));
+ RelationalOperator.NotSupersetOfSelectionList = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.NotSupersetOfSelectionList));
+ RelationalOperator.SubsetOfSelectionList = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.SubsetOfSelectionList));
+ RelationalOperator.SupersetOfSelectionList = new RelationalOperator(oms.CreateInstanceOf(c_RelationalOperator, KnownInstanceGuids.RelationalOperators.SupersetOfSelectionList));
+
+ c_EvaluateBooleanExpressionMethod = oms.CreateClass("EBE - Evaluate Boolean Expression Method", KnownInstanceGuids.MethodClasses.EvaluateBooleanExpressionMethod);
+ oms.CreateRelationship(c_EvaluateBooleanExpressionMethod, "returns", c_BooleanAttribute, KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__returns__Boolean_Attribute, true, "returned by", KnownRelationshipGuids.Boolean_Attribute__returned_by__Evaluate_Boolean_Expression_Method);
+ oms.CreateRelationship(c_EvaluateBooleanExpressionMethod, "has source", c_Instance, KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__has_source__Executable_returning_Work_Data, true, "source for", KnownRelationshipGuids.Executable_returning_Work_Data__source_for__Evaluate_Boolean_Expression_Method);
+ oms.CreateRelationship(c_EvaluateBooleanExpressionMethod, "uses", c_BooleanOperator, KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__uses__Boolean_Operator, true, "source for", KnownRelationshipGuids.Executable_returning_Work_Data__source_for__Evaluate_Boolean_Expression_Method);
+ oms.CreateRelationship(c_EvaluateBooleanExpressionMethod, "has target", c_Instance, KnownRelationshipGuids.Evaluate_Boolean_Expression_Method__has_target__Executable_returning_Work_Data, true, "target for", KnownRelationshipGuids.Executable_returning_Work_Data__target_for__Evaluate_Boolean_Expression_Method);
+ oms.AddSuperClass(c_EvaluateBooleanExpressionMethod, c_Method);
+
oms.AddAttribute(c_Method, a_Name);
oms.AddAttribute(c_Method, a_Verb);
oms.AddAttribute(c_Method, a_Static);
@@ -99,5 +196,70 @@ public class MethodsModule : MiniOmsModule
OmsSystemRoutineBuilder srb = new OmsSystemRoutineBuilder(oms);
SystemAttributeRoutine sr = srb.CreateSystemAttributeRoutine(KnownInstanceGuids.SystemAttributeRoutines.GetRuntimeVersion, new Func