Hi,
string errMsg = null
string td = "AT SUIVI"
string defaut = "en rédaction"
string names[] = {"en rédaction", "A vérifier", "A modifier", "Pris en compte", "Validé"}
int values[] = {3,4,0,1,2}
int colors[] = {21, 39, 13, 31, 25}
AttrType at = create (td, names, values, colors, errMsg) // create my enumerated type
AttrDef ad = create (default "en rédaction") object type at attribute ad // create my enumerated type attribute
Estebell - Fri Sep 28 10:12:43 EDT 2012 |
Re: Create an enumerated type attribute with default value create type "enumeration name" (default "value1") attribute "attribute name" You are using the attribute type and attribute defition variables instead of using the type and definition names.
|
Re: Create an enumerated type attribute with default value SystemAdmin - Fri Sep 28 10:22:09 EDT 2012
I tried to create my attribute like that : AttrDef ad = create (default "value 1") object type at attribute ad
|
Re: Create an enumerated type attribute with default value Estebell - Mon Oct 01 02:52:28 EDT 2012
I tried to create my attribute like that : AttrDef ad = create (default "value 1") object type at attribute ad
The "type" and "attribute" functions take a string argument. From you code piece it looks like you are trying to pass AttrDef and AttrType? Try AttrDef ad = create (default "value 1") object type "Text" attribute "MyAttributeName"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Create an enumerated type attribute with default value Mathias Mamsch - Mon Oct 01 06:42:56 EDT 2012
The "type" and "attribute" functions take a string argument. From you code piece it looks like you are trying to pass AttrDef and AttrType? Try AttrDef ad = create (default "value 1") object type "Text" attribute "MyAttributeName"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
I use at and ad which are arguments of my function create.
//create attribute definition
void createAttr(string ad, string at) {
AttrDef ad2 = create (default "value 1") object type at attribute ad
}
//create attribute type
void createTypeSu(string td) {
string errMsg = null
string defaut = "en rédaction"
string names[] = {"en rédaction", "A vérifier", "A modifier", "Pris en compte", "Validé"}
int values[] = {3,4,0,1,2}
int colors[] = {21, 39, 13, 31, 25}
AttrType at = create (td, names, values, colors, errMsg) // on crée le type AT Suivi
}
//main
Module m = current
attType = find(m, "AT Suivi")
if (null (attType)){
createTypeSu("AT Suivi")
}
AttrDef attDef = find(m, "AS Exigence")
if (null (attDef)){
createAttr ("AS Exigence", "AT Exigence")
}
attDef = find(m, "AS Suivi")
if (null (attDef)){
createAttr ("AS Suivi", "AT Suivi")
}
|
Re: Create an enumerated type attribute with default value Estebell - Mon Oct 01 08:37:58 EDT 2012
I use at and ad which are arguments of my function create.
//create attribute definition
void createAttr(string ad, string at) {
AttrDef ad2 = create (default "value 1") object type at attribute ad
}
//create attribute type
void createTypeSu(string td) {
string errMsg = null
string defaut = "en rédaction"
string names[] = {"en rédaction", "A vérifier", "A modifier", "Pris en compte", "Validé"}
int values[] = {3,4,0,1,2}
int colors[] = {21, 39, 13, 31, 25}
AttrType at = create (td, names, values, colors, errMsg) // on crée le type AT Suivi
}
//main
Module m = current
attType = find(m, "AT Suivi")
if (null (attType)){
createTypeSu("AT Suivi")
}
AttrDef attDef = find(m, "AS Exigence")
if (null (attDef)){
createAttr ("AS Exigence", "AT Exigence")
}
attDef = find(m, "AS Suivi")
if (null (attDef)){
createAttr ("AS Suivi", "AT Suivi")
}
-Louie |
Re: Create an enumerated type attribute with default value llandale - Mon Oct 01 13:43:59 EDT 2012
-Louie
Folks need to read the DXL manual quite a bit more precisely then is intuitively apparent.
create(attribute definition)
Syntax
AttrDef create([module|object]
[property value]...
[(default defVal)]
attribute(string attrName))
create(attribute definition)
Syntax
AttrDef create(
[module|object] // Clearly this phrase is first
[property value]... // various properties, any order, including "type"
[(default defVal)] // specify Default value after the properties
attribute(string attrName)) // specify attribute name last
|
Re: Create an enumerated type attribute with default value llandale - Mon Oct 01 13:48:12 EDT 2012
Folks need to read the DXL manual quite a bit more precisely then is intuitively apparent.
create(attribute definition)
Syntax
AttrDef create([module|object]
[property value]...
[(default defVal)]
attribute(string attrName))
create(attribute definition)
Syntax
AttrDef create(
[module|object] // Clearly this phrase is first
[property value]... // various properties, any order, including "type"
[(default defVal)] // specify Default value after the properties
attribute(string attrName)) // specify attribute name last
Order is completely unimportant for the execution, only for the syntax (And the DXL manual is not a holy book). From the perm definitions all the modifiers (inherit, date, dxl, locale, description, hidden, history, type, multi, values, default, changeBars) can either go to the left or to the right side of the attribute tag which must be present. An exception are object and module which can only be on the left side of attribute, if specified. However since the DOORS parser is sometimes stupid, it does not understand all variants. Here for example you need some extra () for the parser to eat the statement print null create (object (attribute "XYYY") (inherit true) (type "Text")) (changeBars true) // works print null create object (attribute "XYYY") (inherit true) (type "Text") (changeBars true) // fails
... AttrType at = create (td, names, values, colors, errMsg) // HERE AT is an AttrType! AttrDef ad = create (default "en rédaction") object type at attribute ad // Here DXL expects a string! ...
//create attribute definition
void createAttr(string ad, string at) {
AttrDef ad2 = create (default "en rédaction") object type at attribute ad
}
//create attribute type
void createTypeSu(string td) {
string errMsg = null
string defaut = "en rédaction"
string names[] = {"en rédaction", "A vérifier", "A modifier", "Pris en compte", "Validé"}
int values[] = {3,4,0,1,2}
int colors[] = {21, 39, 13, 31, 25}
AttrType at = create (td, names, values, colors, errMsg) // on crée le type AT Suivi
}
//main
Module m = current
AttrType attType = find(m, "AT Suivi")
if (null (attType)){
createTypeSu("AT Suivi")
}
AttrDef attDef = find(m, "AS Suivi")
if (null (attDef)){
createAttr ("AS Suivi", "AT Suivi")
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Create an enumerated type attribute with default value Mathias Mamsch - Mon Oct 01 15:24:06 EDT 2012
Order is completely unimportant for the execution, only for the syntax (And the DXL manual is not a holy book). From the perm definitions all the modifiers (inherit, date, dxl, locale, description, hidden, history, type, multi, values, default, changeBars) can either go to the left or to the right side of the attribute tag which must be present. An exception are object and module which can only be on the left side of attribute, if specified. However since the DOORS parser is sometimes stupid, it does not understand all variants. Here for example you need some extra () for the parser to eat the statement print null create (object (attribute "XYYY") (inherit true) (type "Text")) (changeBars true) // works print null create object (attribute "XYYY") (inherit true) (type "Text") (changeBars true) // fails
... AttrType at = create (td, names, values, colors, errMsg) // HERE AT is an AttrType! AttrDef ad = create (default "en rédaction") object type at attribute ad // Here DXL expects a string! ...
//create attribute definition
void createAttr(string ad, string at) {
AttrDef ad2 = create (default "en rédaction") object type at attribute ad
}
//create attribute type
void createTypeSu(string td) {
string errMsg = null
string defaut = "en rédaction"
string names[] = {"en rédaction", "A vérifier", "A modifier", "Pris en compte", "Validé"}
int values[] = {3,4,0,1,2}
int colors[] = {21, 39, 13, 31, 25}
AttrType at = create (td, names, values, colors, errMsg) // on crée le type AT Suivi
}
//main
Module m = current
AttrType attType = find(m, "AT Suivi")
if (null (attType)){
createTypeSu("AT Suivi")
}
AttrDef attDef = find(m, "AS Suivi")
if (null (attDef)){
createAttr ("AS Suivi", "AT Suivi")
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
These are far easier to read, and we see in this thread it keeps certain evil paranormal forces at bay; which turn the first line into this non-comprehensible one: -print null create object ( (attribute "XYYY") (inherit true) (type "Text") (changeBars true)) Which is trying to create an object "after" the one defined by those 4 parameters. -Louie |
Re: Create an enumerated type attribute with default value llandale - Tue Oct 02 17:18:58 EDT 2012
These are far easier to read, and we see in this thread it keeps certain evil paranormal forces at bay; which turn the first line into this non-comprehensible one: -print null create object ( (attribute "XYYY") (inherit true) (type "Text") (changeBars true)) Which is trying to create an object "after" the one defined by those 4 parameters. -Louie
Just to be clear - null, inherit, object, type, changeBars are also functions that take one parameter so you would need to write:
print (null (create (object ((attribute ("XYYY")) (inherit (true)) (type ("Text")) (changeBars (true))))))
print null create object ( (attribute "XYYY") (inherit true) (type "Text") (changeBars true))
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Create an enumerated type attribute with default value Mathias Mamsch - Tue Oct 02 18:46:41 EDT 2012
Just to be clear - null, inherit, object, type, changeBars are also functions that take one parameter so you would need to write:
print (null (create (object ((attribute ("XYYY")) (inherit (true)) (type ("Text")) (changeBars (true))))))
print null create object ( (attribute "XYYY") (inherit true) (type "Text") (changeBars true))
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Didn't realize it but I guess I had perceived a difference between actual user "functions" and system things that are actually functions. "changeBars" is yes technically a function but it is not used that way; it's used as some kind of descripter.
ad = create(module object //-
type NameType history DoHistory changeBars DoBars //-
date DoDate inherit DoInherit attribute NameAttr
)
I'm a little confused with precedence, but I'm guessing the right-most (changeBars true) phrase of type "AttrBarsVal__" cannot concatenate with the next (type "text") phrase of type AttrType__. You need a full right-most phrase of type "AttrDef__" for that to work; putting (attribute "XYYY") at the right acomplishes that; and you end up with the Syntax sequence in the DXL manual.
|
Re: Create an enumerated type attribute with default value llandale - Wed Oct 03 17:07:49 EDT 2012
Didn't realize it but I guess I had perceived a difference between actual user "functions" and system things that are actually functions. "changeBars" is yes technically a function but it is not used that way; it's used as some kind of descripter.
ad = create(module object //-
type NameType history DoHistory changeBars DoBars //-
date DoDate inherit DoInherit attribute NameAttr
)
I'm a little confused with precedence, but I'm guessing the right-most (changeBars true) phrase of type "AttrBarsVal__" cannot concatenate with the next (type "text") phrase of type AttrType__. You need a full right-most phrase of type "AttrDef__" for that to work; putting (attribute "XYYY") at the right acomplishes that; and you end up with the Syntax sequence in the DXL manual.
Yeah it is confusing. Technically The following perms are defined to concatenate those "predicates" to either the left OR the right side of the attribute function. Left Side Right Side AttrDef__ ::.. (AttrDef__, AttrBarsVal__) AttrDef__ ::.. (AttrBarsVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrDateVal__) AttrDef__ ::.. (AttrDateVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrDefVal__) AttrDef__ ::.. (AttrDefVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrDescVal__) AttrDef__ ::.. (AttrDescVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrDxlVal__) AttrDef__ ::.. (AttrDxlVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrHideVal__) AttrDef__ ::.. (AttrHideVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrHistVal__) AttrDef__ ::.. (AttrHistVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrInhVal__) AttrDef__ ::.. (AttrInhVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrLocaleVal__) AttrDef__ ::.. (AttrLocaleVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrMultiVal__) AttrDef__ ::.. (AttrMultiVal__, AttrDef__) AttrDef__ ::.. (AttrDef__, AttrType__) AttrDef__ ::.. (AttrType__, AttrDef__)
print null create object ((attribute "XYYY") (inherit true) (type "Text")) (changeBars true)
AttrDef createAttr (string sName, string sType, bool bModule, bool bObject /* , ... other predicates ... */) {
AttrDef__ def = (type sType) /* ... other predicates ... */ attribute sName
if (bModule) def = module def
if (bObject) def = object def
// ...
AttrDef result = create (def)
return result
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|