moddle_types
Type declarations for Moodle plugins.
| CLASS | DESCRIPTION |
|---|---|
LiteralValue |
A Moddle literal value. |
ModdleEnumeration |
A Moddle enumeration. |
ModdlePackage |
A Moddle package that extends BPMN. |
ModdleType |
A Moddle type that is part of a Moddle package. |
ModdleTypeMeta |
Metadata about a Moddle type. |
TypeProperty |
The definition of a Moddle type property. |
XMLSerialization |
Defines XML serialization details. |
| FUNCTION | DESCRIPTION |
|---|---|
lower_first_char |
Lower the first character of a string. |
Classes¶
LiteralValue
pydantic-model
¶
Bases: BaseModel
A Moddle literal value.
Show JSON schema:
{
"description": "A Moddle literal value.",
"properties": {
"name": {
"description": "Value of the literal.",
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"title": "LiteralValue",
"type": "object"
}
Fields:
ModdleEnumeration
pydantic-model
¶
Bases: BaseModel
A Moddle enumeration.
Show JSON schema:
{
"$defs": {
"LiteralValue": {
"description": "A Moddle literal value.",
"properties": {
"name": {
"description": "Value of the literal.",
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"title": "LiteralValue",
"type": "object"
}
},
"description": "A Moddle enumeration.",
"properties": {
"name": {
"description": "Name of the enumeration.",
"title": "Name",
"type": "string"
},
"literalValues": {
"description": "Values of the enumeration.",
"items": {
"$ref": "#/$defs/LiteralValue"
},
"title": "Literalvalues",
"type": "array"
}
},
"required": [
"name",
"literalValues"
],
"title": "ModdleEnumeration",
"type": "object"
}
Fields:
ModdlePackage
pydantic-model
¶
Bases: BaseModel
A Moddle package that extends BPMN.
Show JSON schema:
{
"$defs": {
"LiteralValue": {
"description": "A Moddle literal value.",
"properties": {
"name": {
"description": "Value of the literal.",
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"title": "LiteralValue",
"type": "object"
},
"ModdleEnumeration": {
"description": "A Moddle enumeration.",
"properties": {
"name": {
"description": "Name of the enumeration.",
"title": "Name",
"type": "string"
},
"literalValues": {
"description": "Values of the enumeration.",
"items": {
"$ref": "#/$defs/LiteralValue"
},
"title": "Literalvalues",
"type": "array"
}
},
"required": [
"name",
"literalValues"
],
"title": "ModdleEnumeration",
"type": "object"
},
"ModdlePackage": {
"description": "A Moddle package that extends BPMN.",
"properties": {
"name": {
"description": "Name of the package.",
"title": "Name",
"type": "string"
},
"prefix": {
"description": "The prefix uniquely identifies elements in a package if more multiple packages are in place.",
"title": "Prefix",
"type": "string"
},
"uri": {
"description": "The associated XML namespace URI.",
"title": "Uri",
"type": "string"
},
"xml": {
"anyOf": [
{
"$ref": "#/$defs/XMLSerialization"
},
{
"type": "null"
}
],
"default": null,
"description": "Defines XML serialization details."
},
"types": {
"description": "Types contained in the package.",
"items": {
"$ref": "#/$defs/ModdleType"
},
"title": "Types",
"type": "array"
},
"enumerations": {
"description": "Enumerations contained in the package.",
"items": {
"$ref": "#/$defs/ModdleEnumeration"
},
"title": "Enumerations",
"type": "array"
},
"enums": {
"anyOf": [
{
"additionalProperties": {
"description": "Enum where members are also (and must be) strings",
"enum": []
},
"type": "object"
},
{
"type": "null"
}
],
"description": "Python StrEnums from enumerations defined in the package.",
"title": "Enums"
}
},
"required": [
"name",
"prefix",
"uri",
"types"
],
"title": "ModdlePackage",
"type": "object"
},
"ModdleType": {
"description": "A Moddle type that is part of a Moddle package.",
"properties": {
"name": {
"description": "Name of the type.",
"title": "Name",
"type": "string"
},
"tag": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "XML tag name to parse.",
"title": "Tag"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Description of the type.",
"title": "Description"
},
"superClass": {
"description": "Names of the super classes.",
"items": {
"type": "string"
},
"title": "Superclass",
"type": "array"
},
"extends": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Name of the type to extend.",
"title": "Extends"
},
"isAbstract": {
"default": false,
"description": "Is the type abstract?",
"title": "Isabstract",
"type": "boolean"
},
"meta": {
"anyOf": [
{
"$ref": "#/$defs/ModdleTypeMeta"
},
{
"type": "null"
}
],
"default": null,
"description": "Metadata about this plugin type."
},
"properties": {
"type": "array",
"items": {
"$ref": "#/$defs/TypeProperty"
},
"description": "Properties contained in the type.",
"title": "Properties"
},
"normalized_name": {
"anyOf": [
{
"$ref": "#/$defs/QName"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized name of the type. Set during type registration."
},
"traits": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/QName"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Traits described by other type's extends property.",
"title": "Traits"
},
"package": {
"anyOf": [
{
"$ref": "#/$defs/ModdlePackage"
},
{
"type": "null"
}
],
"default": null,
"description": "The package this type belongs to. Set during registration."
},
"normalized_extends": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/QName"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized extends of the type. Set during registration.",
"title": "Normalized Extends"
},
"normalized_superclass": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/QName"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized superclass of the type. Set during registration.",
"title": "Normalized Superclass"
}
},
"required": [
"name"
],
"title": "ModdleType",
"type": "object"
},
"ModdleTypeMeta": {
"description": "Metadata about a Moddle type.",
"properties": {
"allowedIn": {
"description": "List of elements this plugin type is allowed in.",
"items": {
"type": "string"
},
"title": "Allowedin",
"type": "array"
}
},
"required": [
"allowedIn"
],
"title": "ModdleTypeMeta",
"type": "object"
},
"QName": {
"properties": {
"local": {
"title": "Local",
"type": "string"
},
"uri": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uri"
}
},
"required": [
"local"
],
"title": "QName",
"type": "object"
},
"TypeProperty": {
"description": "The definition of a Moddle type property.",
"properties": {
"name": {
"description": "Name of the property.",
"title": "Name",
"type": "string"
},
"type": {
"description": "Type of the property.",
"title": "Type",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Description of the property.",
"title": "Description"
},
"isAttr": {
"default": false,
"description": "Is the property serialized as XML attribute?.",
"title": "Isattr",
"type": "boolean"
},
"isId": {
"default": false,
"description": "Is current property map to XML node id?",
"title": "Isid",
"type": "boolean"
},
"isMany": {
"default": false,
"description": "Is the property an array or a single?",
"title": "Ismany",
"type": "boolean"
},
"isBody": {
"default": false,
"description": "Is the property serialized as body element?",
"title": "Isbody",
"type": "boolean"
},
"isReference": {
"default": false,
"description": "Is the property referencing to another element?",
"title": "Isreference",
"type": "boolean"
},
"isVirtual": {
"default": false,
"description": "Is the property a virtual property (not serialized)?",
"title": "Isvirtual",
"type": "boolean"
},
"default": {
"default": null,
"description": "Default value of the property.",
"title": "Default"
},
"redefines": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the property to redefine.",
"title": "Redefines"
},
"replaces": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the property to replace.",
"title": "Replaces"
},
"xml": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Defines XML serialization details.",
"title": "Xml"
},
"normalized_name": {
"anyOf": [
{
"$ref": "#/$defs/QName"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized name of the property. Set during property registration."
},
"normalized_type": {
"anyOf": [
{
"$ref": "#/$defs/QName"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized type of the property. Set during property registration."
}
},
"required": [
"name",
"type"
],
"title": "TypeProperty",
"type": "object"
},
"XMLSerialization": {
"description": "Defines XML serialization details.",
"properties": {
"tagAlias": {
"default": "lowerCase",
"title": "Tagalias",
"type": "string"
},
"typePrefix": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Typeprefix"
}
},
"title": "XMLSerialization",
"type": "object"
}
},
"$ref": "#/$defs/ModdlePackage"
}
Fields:
-
name(str) -
prefix(str) -
uri(str) -
xml(Optional[XMLSerialization]) -
types(list[ModdleType]) -
enumerations(list[ModdleEnumeration]) -
enums(Optional[dict[str, StrEnum]])
Attributes¶
enumerations
pydantic-field
¶
enumerations: list[ModdleEnumeration]
Enumerations contained in the package.
enums
pydantic-field
¶
Python StrEnums from enumerations defined in the package.
prefix
pydantic-field
¶
prefix: str
The prefix uniquely identifies elements in a package if more multiple packages are in place.
Functions¶
finalize_type
¶
finalize_type(moddle_type: ModdleType, nsmap: dict[str, str]) -> None
Finish setting up a Moddle type.
get_type_by_name
¶
get_type_by_name(name: str) -> Optional[ModdleType | StrEnum]
Get a Moddle plugin by name.
model_post_init
¶
model_post_init(context: Any) -> None
Finish initialization of the types and their properties.
package_dependencies
¶
Return the package URIs this package depends on.
type_dependencies
¶
A dictionary of type names and their dependencies.
ModdleType
pydantic-model
¶
Bases: BaseModel
A Moddle type that is part of a Moddle package.
Show JSON schema:
{
"$defs": {
"LiteralValue": {
"description": "A Moddle literal value.",
"properties": {
"name": {
"description": "Value of the literal.",
"title": "Name",
"type": "string"
}
},
"required": [
"name"
],
"title": "LiteralValue",
"type": "object"
},
"ModdleEnumeration": {
"description": "A Moddle enumeration.",
"properties": {
"name": {
"description": "Name of the enumeration.",
"title": "Name",
"type": "string"
},
"literalValues": {
"description": "Values of the enumeration.",
"items": {
"$ref": "#/$defs/LiteralValue"
},
"title": "Literalvalues",
"type": "array"
}
},
"required": [
"name",
"literalValues"
],
"title": "ModdleEnumeration",
"type": "object"
},
"ModdlePackage": {
"description": "A Moddle package that extends BPMN.",
"properties": {
"name": {
"description": "Name of the package.",
"title": "Name",
"type": "string"
},
"prefix": {
"description": "The prefix uniquely identifies elements in a package if more multiple packages are in place.",
"title": "Prefix",
"type": "string"
},
"uri": {
"description": "The associated XML namespace URI.",
"title": "Uri",
"type": "string"
},
"xml": {
"anyOf": [
{
"$ref": "#/$defs/XMLSerialization"
},
{
"type": "null"
}
],
"default": null,
"description": "Defines XML serialization details."
},
"types": {
"description": "Types contained in the package.",
"items": {
"$ref": "#/$defs/ModdleType"
},
"title": "Types",
"type": "array"
},
"enumerations": {
"description": "Enumerations contained in the package.",
"items": {
"$ref": "#/$defs/ModdleEnumeration"
},
"title": "Enumerations",
"type": "array"
},
"enums": {
"anyOf": [
{
"additionalProperties": {
"description": "Enum where members are also (and must be) strings",
"enum": []
},
"type": "object"
},
{
"type": "null"
}
],
"description": "Python StrEnums from enumerations defined in the package.",
"title": "Enums"
}
},
"required": [
"name",
"prefix",
"uri",
"types"
],
"title": "ModdlePackage",
"type": "object"
},
"ModdleType": {
"description": "A Moddle type that is part of a Moddle package.",
"properties": {
"name": {
"description": "Name of the type.",
"title": "Name",
"type": "string"
},
"tag": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "XML tag name to parse.",
"title": "Tag"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Description of the type.",
"title": "Description"
},
"superClass": {
"description": "Names of the super classes.",
"items": {
"type": "string"
},
"title": "Superclass",
"type": "array"
},
"extends": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Name of the type to extend.",
"title": "Extends"
},
"isAbstract": {
"default": false,
"description": "Is the type abstract?",
"title": "Isabstract",
"type": "boolean"
},
"meta": {
"anyOf": [
{
"$ref": "#/$defs/ModdleTypeMeta"
},
{
"type": "null"
}
],
"default": null,
"description": "Metadata about this plugin type."
},
"properties": {
"type": "array",
"items": {
"$ref": "#/$defs/TypeProperty"
},
"description": "Properties contained in the type.",
"title": "Properties"
},
"normalized_name": {
"anyOf": [
{
"$ref": "#/$defs/QName"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized name of the type. Set during type registration."
},
"traits": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/QName"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Traits described by other type's extends property.",
"title": "Traits"
},
"package": {
"anyOf": [
{
"$ref": "#/$defs/ModdlePackage"
},
{
"type": "null"
}
],
"default": null,
"description": "The package this type belongs to. Set during registration."
},
"normalized_extends": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/QName"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized extends of the type. Set during registration.",
"title": "Normalized Extends"
},
"normalized_superclass": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/QName"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized superclass of the type. Set during registration.",
"title": "Normalized Superclass"
}
},
"required": [
"name"
],
"title": "ModdleType",
"type": "object"
},
"ModdleTypeMeta": {
"description": "Metadata about a Moddle type.",
"properties": {
"allowedIn": {
"description": "List of elements this plugin type is allowed in.",
"items": {
"type": "string"
},
"title": "Allowedin",
"type": "array"
}
},
"required": [
"allowedIn"
],
"title": "ModdleTypeMeta",
"type": "object"
},
"QName": {
"properties": {
"local": {
"title": "Local",
"type": "string"
},
"uri": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uri"
}
},
"required": [
"local"
],
"title": "QName",
"type": "object"
},
"TypeProperty": {
"description": "The definition of a Moddle type property.",
"properties": {
"name": {
"description": "Name of the property.",
"title": "Name",
"type": "string"
},
"type": {
"description": "Type of the property.",
"title": "Type",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Description of the property.",
"title": "Description"
},
"isAttr": {
"default": false,
"description": "Is the property serialized as XML attribute?.",
"title": "Isattr",
"type": "boolean"
},
"isId": {
"default": false,
"description": "Is current property map to XML node id?",
"title": "Isid",
"type": "boolean"
},
"isMany": {
"default": false,
"description": "Is the property an array or a single?",
"title": "Ismany",
"type": "boolean"
},
"isBody": {
"default": false,
"description": "Is the property serialized as body element?",
"title": "Isbody",
"type": "boolean"
},
"isReference": {
"default": false,
"description": "Is the property referencing to another element?",
"title": "Isreference",
"type": "boolean"
},
"isVirtual": {
"default": false,
"description": "Is the property a virtual property (not serialized)?",
"title": "Isvirtual",
"type": "boolean"
},
"default": {
"default": null,
"description": "Default value of the property.",
"title": "Default"
},
"redefines": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the property to redefine.",
"title": "Redefines"
},
"replaces": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the property to replace.",
"title": "Replaces"
},
"xml": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Defines XML serialization details.",
"title": "Xml"
},
"normalized_name": {
"anyOf": [
{
"$ref": "#/$defs/QName"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized name of the property. Set during property registration."
},
"normalized_type": {
"anyOf": [
{
"$ref": "#/$defs/QName"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized type of the property. Set during property registration."
}
},
"required": [
"name",
"type"
],
"title": "TypeProperty",
"type": "object"
},
"XMLSerialization": {
"description": "Defines XML serialization details.",
"properties": {
"tagAlias": {
"default": "lowerCase",
"title": "Tagalias",
"type": "string"
},
"typePrefix": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Typeprefix"
}
},
"title": "XMLSerialization",
"type": "object"
}
},
"$ref": "#/$defs/ModdleType"
}
Fields:
-
name(str) -
tag(Optional[str]) -
description(Optional[str]) -
superClass(list[str]) -
extends(Optional[list[str]]) -
isAbstract(bool) -
meta(Optional[ModdleTypeMeta]) -
properties(list[TypeProperty]) -
normalized_name(Optional[QName]) -
traits(Optional[list[QName]]) -
package(Optional[ModdlePackage]) -
normalized_extends(Optional[list[QName]]) -
normalized_superclass(Optional[list[QName]])
Attributes¶
normalized_extends
pydantic-field
¶
Normalized extends of the type. Set during registration.
normalized_name
pydantic-field
¶
Normalized name of the type. Set during type registration.
normalized_superclass
pydantic-field
¶
Normalized superclass of the type. Set during registration.
package
pydantic-field
¶
package: Optional[ModdlePackage] = None
The package this type belongs to. Set during registration.
ModdleTypeMeta
pydantic-model
¶
Bases: BaseModel
Metadata about a Moddle type.
Show JSON schema:
{
"description": "Metadata about a Moddle type.",
"properties": {
"allowedIn": {
"description": "List of elements this plugin type is allowed in.",
"items": {
"type": "string"
},
"title": "Allowedin",
"type": "array"
}
},
"required": [
"allowedIn"
],
"title": "ModdleTypeMeta",
"type": "object"
}
Fields:
-
allowed_in(list[str])
TypeProperty
pydantic-model
¶
Bases: BaseModel
The definition of a Moddle type property.
Show JSON schema:
{
"$defs": {
"QName": {
"properties": {
"local": {
"title": "Local",
"type": "string"
},
"uri": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Uri"
}
},
"required": [
"local"
],
"title": "QName",
"type": "object"
}
},
"description": "The definition of a Moddle type property.",
"properties": {
"name": {
"description": "Name of the property.",
"title": "Name",
"type": "string"
},
"type": {
"description": "Type of the property.",
"title": "Type",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Description of the property.",
"title": "Description"
},
"isAttr": {
"default": false,
"description": "Is the property serialized as XML attribute?.",
"title": "Isattr",
"type": "boolean"
},
"isId": {
"default": false,
"description": "Is current property map to XML node id?",
"title": "Isid",
"type": "boolean"
},
"isMany": {
"default": false,
"description": "Is the property an array or a single?",
"title": "Ismany",
"type": "boolean"
},
"isBody": {
"default": false,
"description": "Is the property serialized as body element?",
"title": "Isbody",
"type": "boolean"
},
"isReference": {
"default": false,
"description": "Is the property referencing to another element?",
"title": "Isreference",
"type": "boolean"
},
"isVirtual": {
"default": false,
"description": "Is the property a virtual property (not serialized)?",
"title": "Isvirtual",
"type": "boolean"
},
"default": {
"default": null,
"description": "Default value of the property.",
"title": "Default"
},
"redefines": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the property to redefine.",
"title": "Redefines"
},
"replaces": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name of the property to replace.",
"title": "Replaces"
},
"xml": {
"anyOf": [
{
"additionalProperties": {
"type": "string"
},
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Defines XML serialization details.",
"title": "Xml"
},
"normalized_name": {
"anyOf": [
{
"$ref": "#/$defs/QName"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized name of the property. Set during property registration."
},
"normalized_type": {
"anyOf": [
{
"$ref": "#/$defs/QName"
},
{
"type": "null"
}
],
"default": null,
"description": "Normalized type of the property. Set during property registration."
}
},
"required": [
"name",
"type"
],
"title": "TypeProperty",
"type": "object"
}
Config:
arbitrary_types_allowed:True
Fields:
-
name(str) -
type(str) -
description(Optional[str]) -
is_attr(bool) -
is_id(bool) -
is_many(bool) -
is_body(bool) -
is_reference(bool) -
is_virtual(bool) -
default(Any) -
redefines(Optional[str]) -
replaces(Optional[str]) -
xml(Optional[Mapping[str, str]]) -
normalized_name(Optional[QName]) -
normalized_type(Optional[QName])
Attributes¶
is_reference
pydantic-field
¶
is_reference: bool = False
Is the property referencing to another element?
is_virtual
pydantic-field
¶
is_virtual: bool = False
Is the property a virtual property (not serialized)?
normalized_name
pydantic-field
¶
Normalized name of the property. Set during property registration.
normalized_type
pydantic-field
¶
Normalized type of the property. Set during property registration.
XMLSerialization
pydantic-model
¶
Bases: BaseModel
Defines XML serialization details.
Show JSON schema:
{
"description": "Defines XML serialization details.",
"properties": {
"tagAlias": {
"default": "lowerCase",
"title": "Tagalias",
"type": "string"
},
"typePrefix": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Typeprefix"
}
},
"title": "XMLSerialization",
"type": "object"
}
Fields: