|
1 | | -/// v1.1 <br> |
| 1 | +/// v1.2 <br> |
2 | 2 | /// Creates a MTConnect Datatype based on a <CLASS>MTConnect.MSG.CreateDataTypeRequest</CLASS>. |
3 | 3 | /// Currently only works with %String and %Double. |
4 | 4 | Class MTConnect.BO.DataTypesBuilderOperation Extends Ens.BusinessOperation |
@@ -86,10 +86,10 @@ Method Execute(pRequest As MTConnect.MSG.CreateDataTypeRequest, Output pResponse |
86 | 86 | Set pResponse = ##class(Ens.StringResponse).%New() |
87 | 87 |
|
88 | 88 | If tSc{ |
89 | | - Set pResponse.StringValue = className_" created" |
| 89 | + Set pResponse.StringValue = className_" created!" |
90 | 90 | } |
91 | 91 | Else{ |
92 | | - Set pResponse.StringValue = className_" could not be created" |
| 92 | + Set pResponse.StringValue = className_" could not be created!" |
93 | 93 | } |
94 | 94 | Return tSc |
95 | 95 | } |
@@ -133,6 +133,23 @@ Method InsertIsValid(cdef As %Dictionary.ClassDefinition, className As %String, |
133 | 133 | } |
134 | 134 | Do mdef.Implementation.WriteLine(" Return $$$OK") |
135 | 135 | } |
| 136 | + ElseIf pRequest.DataType = "%Integer"{ |
| 137 | + Set mdef.Implementation.LineTerminator = $C(13,10) |
| 138 | + Do mdef.Implementation.WriteLine(" If '$ISVALIDNUM(%val){") |
| 139 | + Do mdef.Implementation.WriteLine(" Return $$$ERROR(%val_"" is not a valid Integer!"")") |
| 140 | + Do mdef.Implementation.WriteLine(" }") |
| 141 | + If pRequest.AllowedNumericMaxValue '= ""{ |
| 142 | + Do mdef.Implementation.WriteLine(" If %val > "_pRequest.AllowedNumericMaxValue_"{") |
| 143 | + Do mdef.Implementation.WriteLine(" Return $$$ERROR(%val_"" is higher than allowed: "_pRequest.AllowedNumericMaxValue_""")") |
| 144 | + Do mdef.Implementation.WriteLine(" }") |
| 145 | + } |
| 146 | + If pRequest.AllowedNumericMinValue '= ""{ |
| 147 | + Do mdef.Implementation.WriteLine(" If %val < "_pRequest.AllowedNumericMinValue_"{") |
| 148 | + Do mdef.Implementation.WriteLine(" Return $$$ERROR(%val_"" is lower than allowed: "_pRequest.AllowedNumericMinValue_""")") |
| 149 | + Do mdef.Implementation.WriteLine(" }") |
| 150 | + } |
| 151 | + Do mdef.Implementation.WriteLine(" Return $$$OK") |
| 152 | + } |
136 | 153 | ElseIf pRequest.DataType = "%String"{ |
137 | 154 | Set mdef.Implementation.LineTerminator = $C(13,10) |
138 | 155 | If pRequest.AllowedStringValues = ""{ |
@@ -196,7 +213,7 @@ Method InsertDisplayToLogical(cdef As %Dictionary.ClassDefinition, className As |
196 | 213 | //Add parameter |
197 | 214 | Do mdef.FormalSpecSet("%val:%String") |
198 | 215 | //Add returntype |
199 | | - If pRequest.DataType = "%Double"{ |
| 216 | + If pRequest.DataType = "%Double" || pRequest.DataType = "%Integer"{ |
200 | 217 | Set mdef.ReturnType = pRequest.DataType |
201 | 218 | } |
202 | 219 | Else{ |
|
0 commit comments