|
||
Revision history:
Introduced in QPR 8.0
Last changed in QPR 2016.1
Sets a value of an element's attribute or custom attribute defined by Extended property name.
Synopsis:
PGModel.SetProperty(FullId, ExtendedPropertyName, Value)
Parameters:
FullId: ID of the element or element instance. Mandatory. No Default value. Supported formats for defining the element:
ElementId: Integer. ID of the element.
ElementId[.InstanceId]: String. ID and an optional instance ID of the element.
ElementSymbol[.InstanceId]: String. The symbol and an optional instance ID of the element.
ExtendedPropertyName: String. Defines the attribute or custom attribute name. Note that cardinality N attributes contain the attribute index extension '(<index>)'. See the listing below for supported properties for different element types:
Common properties for model objects:
ElementTypeId, id
Name, string
Description, string
InformationItems, array
Notes, array
Resources, array
Priority, double
CanBeSuspended, boolean
ScoreCardModel, string. Requires using InstanceId to set the property.
ScorecardIdentifier, string. Requires using InstanceId to set the property.
MeasureIdentifier, string. Requires using InstanceId to set the property.
InterfaceElement, boolean
Symbol, string
Common properties for instances:
Note that these can be used only if instance parameter is set.
InstanceProcessLevel, int
InstanceSCModel, string
InstanceSCIdentifier, string
InstanceSCMeasure, string
IncomingFlows, array
OutgoingFlows, array
FullId refers to a process step:
Owner, id
SimulationEntryRule, int
EntryRules, array
EntryRuleCaseMatching, boolean
SimulationExitRule, int
ExitRules, array
ProcessingTimeType, int
ProcessingTimes, array
InputFrequencyType, int
InputFrequencies, array
IsStartingProcessStep, boolean
MaxInputs, int
ModelingDirection, int
IsUseDefaultModelingDirection, boolean.
ChildProcessSteps, array
ChildGroups, array
ChildFlows, array
ChildStores, array
FlowCompositions, array
LineGraphicalProperties, array with the following columns:
•Width, integer
•Color, integer
•Transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Dash style, integer (0 = solid, 1 = dash, 2 = dot, 3 = dash dot, 4 = dash dot dot, 5 = custom)
•Custom dash pattern, string. Valid when dash style = 5. A valid definition contains an even amount of space-separated values ranging from 0 to 99. The first value in a value pair defines the amount of pixels that are drawn and the second one the amount of pixels that are left empty in the line.
FillGraphicalProperties, array with the following columns:
•Style, integer (0 = transparent, 1 = solid, 2 = gradient, 3 = texture, 4 = hatch)
•Primary color, integer
•Primary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Secondary color, integer
•Secondary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Gradient type, integer (1 = linear, 2 = rectangle)
•Gradient mode, integer (0 = horizontal, 1 = vertical, 2 = forward diagonal, 3 = backward diagonal)
•Texture wrap mode, integer (0 = tile, 1 = tile flip X, 2 = tile flip Y, 3 = tile flip XY, 4 = clamp)
•Hatch style, integer (0-52)
Contents of the FillGraphicalProperties array depends on the style. For transparent fills, only primary transparency is included. For solid fills, both primary color settings are included. For gradients the array contains both primary and secondary color settings as well as gradient settings. For textures there are primary color settings and texture wrap mode included, but the actual texture is not available. For hatch fill style there are both primary and secondary color settings as well as hatch style setting. In case the value is below the accepted range, the minimum value is use. Similarly the maximum value is used for values above the accepted range.
Instance related properties: ElementHeight (int), ElementWidth(int), ElementPosX(int), ElementPosY(int)
IsUseVersionInformation, boolean. This property is supported only for diagram type process steps.
VersionNumber, string. This property is supported only for diagram type process steps.
Status, enumerated. This property is supported only for diagram type process steps.
Author, string. This property is supported only for diagram type process steps.
Comment, string. This property is supported only for diagram type process steps.
ProcessStepsOnProcessLevel, array with two columns: object id and instance id
Elements, array with two columns: object ID and instance ID. This property is valid for all objects that have a child level.
MappedConnectors, array of connector ids. For input or output interfaces, returns the connectors mapped to the interface.
InGroups, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
InstancesInGroup, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
FullId refers to a connector:
From, id
To, id
Owner, id
Document, id
ProcessingTimeType, int
ProcessingTimes, array
InputFrequencyType, int
InputFrequencies, array
IsStartingFlow, boolean
FlowPoints, two-dimensional array containing integer X and Y pairs in the first two columns and diagram ID in the third column. The first row contains the starting coordinates for a flow's path and the last row contains the ending coordinates. Diagram definition (third column) is needed to flows that go through multiple diagrams, with single-level flows the third column can be left empty. Note that the FlowPoints property cannot be used to connect or disconnect a flow from elements.
MaxInputs, int
LineGraphicalProperties, array with the following columns:
•Width, integer
•Color, integer
•Transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Dash style, integer (0 = solid, 1 = dash, 2 = dot, 3 = dash dot, 4 = dash dot dot, 5 = custom)
•Custom dash pattern, string. Valid when dash style = 5. A valid definition contains an even amount of space-separated values ranging from 0 to 99. The first value in a value pair defines the amount of pixels that are drawn and the second one the amount of pixels that are left empty in the line.
MappedSourceInterface, id. The interface element that is mapped to the connector start.
MappedDestinationInterface, id. The interface element that is mapped to the connector end.
FullId refers to an organization item:
ParentOrganizationUnit, id
ChildOrganizationUnits, array
ProcessSteps, array
Persons, array
OrganizationType, int
LineGraphicalProperties, array with the following columns:
•Width, integer
•Color, integer
•Transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Dash style, integer (0 = solid, 1 = dash, 2 = dot, 3 = dash dot, 4 = dash dot dot, 5 = custom)
•Custom dash pattern, string. Valid when dash style = 5. A valid definition contains an even amount of space-separated values ranging from 0 to 99. The first value in a value pair defines the amount of pixels that are drawn and the second one the amount of pixels that are left empty in the line.
FillGraphicalProperties, array with the following columns:
•Style, integer (0 = transparent, 1 = solid, 2 = gradient, 3 = texture, 4 = hatch)
•Primary color, integer
•Primary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Secondary color, integer
•Secondary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Gradient type, integer (1 = linear, 2 = rectangle)
•Gradient mode, integer (0 = horizontal, 1 = vertical, 2 = forward diagonal, 3 = backward diagonal)
•Texture wrap mode, integer (0 = tile, 1 = tile flip X, 2 = tile flip Y, 3 = tile flip XY, 4 = clamp)
•Hatch style, integer (0-52)
Contents of the FillGraphicalProperties array depends on the style. For transparent fills, only primary transparency is included. For solid fills, both primary color settings are included. For gradients the array contains both primary and secondary color settings as well as gradient settings. For textures there are primary color settings and texture wrap mode included, but the actual texture is not available. For hatch fill style there are both primary and secondary color settings as well as hatch style setting. In case the value is below the accepted range, the minimum value is use. Similarly the maximum value is used for values above the accepted range.
FullId refers to a case:
SimulationStarted, date
SimulationEnded, date
FullId refers to a connector composition:
Document, id
ProcessLevel, id
ParentComposition, id
ChildCompositions, array
FlowPoints, two-dimensional array containing integer X and Y pairs in the first two columns and diagram ID in the third column. The first row contains the starting coordinates for a flow's path and the last row contains the ending coordinates. Diagram definition (third column) is needed to flows that go through multiple diagrams, with single-level flows the third column can be left empty. Note that the FlowPoints property cannot be used to connect or disconnect a flow from elements.
LineGraphicalProperties, array with the following columns:
•Width, integer
•Color, integer
•Transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Dash style, integer (0 = solid, 1 = dash, 2 = dot, 3 = dash dot, 4 = dash dot dot, 5 = custom)
•Custom dash pattern, string. Valid when dash style = 5. A valid definition contains an even amount of space-separated values ranging from 0 to 99. The first value in a value pair defines the amount of pixels that are drawn and the second one the amount of pixels that are left empty in the line.
FullId refers to a measure:
MeasureValueType, int
MeasureSubprocessCalculationType, int
MeasureUnitType, int
UnitNames, array
LinkedMeasureDatas, array
FullId refers to measure data:
MeasureDataList, array in two dimensions, indexes in 2nd dimension: 0-CaseId, 1-StartTime(datetime), 2-EndTime(datetime), 3-StartValue(double), EndValue(double)
Measure, id
ModelObject, id
FullId refers to a note:
ParentNote, id
ChildNotes, array
ModelObject, id
LineGraphicalProperties, array with the following columns:
•Width, integer
•Color, integer
•Transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Dash style, integer (0 = solid, 1 = dash, 2 = dot, 3 = dash dot, 4 = dash dot dot, 5 = custom)
•Custom dash pattern, string. Valid when dash style = 5. A valid definition contains an even amount of space-separated values ranging from 0 to 99. The first value in a value pair defines the amount of pixels that are drawn and the second one the amount of pixels that are left empty in the line.
FillGraphicalProperties, array with the following columns:
•Style, integer (0 = transparent, 1 = solid, 2 = gradient, 3 = texture, 4 = hatch)
•Primary color, integer
•Primary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Secondary color, integer
•Secondary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Gradient type, integer (1 = linear, 2 = rectangle)
•Gradient mode, integer (0 = horizontal, 1 = vertical, 2 = forward diagonal, 3 = backward diagonal)
•Texture wrap mode, integer (0 = tile, 1 = tile flip X, 2 = tile flip Y, 3 = tile flip XY, 4 = clamp)
•Hatch style, integer (0-52)
Contents of the FillGraphicalProperties array depends on the style. For transparent fills, only primary transparency is included. For solid fills, both primary color settings are included. For gradients the array contains both primary and secondary color settings as well as gradient settings. For textures there are primary color settings and texture wrap mode included, but the actual texture is not available. For hatch fill style there are both primary and secondary color settings as well as hatch style setting. In case the value is below the accepted range, the minimum value is use. Similarly the maximum value is used for values above the accepted range.
InGroups, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
InstancesInGroup, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
FullId refers to the model (the ID can be fetched e.g. by calling PGModel.GetActive with the PROCESSMODEL parameter):
FeedbackEmailAddress, string
IsUseLog, boolean
IsForceExclusive, boolean
ModelingOptions, blob
IsPublished, boolean
AutomaticInformationItemRefresh, int
FullId refers to a resource:
ResourceType, int
AmountOfresourceAvailable, double
UnitCost, double
UnitName, string
MaximumAmountInStore, double
OrderingLimit, double
IncrementPerRegularOrder, double
RegularOrderInterval, date
IncrementPerOrder, double
OrderingCost, double
OrderingTime, date
TimeUnit, int
ObjectsUsing, array
OrganizationUnit, id
ResponsibleOfFlows, array
ProcessLevel, array
FullId refers to a store:
StoreType, int
SimulationRules, array
LineGraphicalProperties, array with the following columns:
•Width, integer
•Color, integer
•Transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Dash style, integer (0 = solid, 1 = dash, 2 = dot, 3 = dash dot, 4 = dash dot dot, 5 = custom)
•Custom dash pattern, string. Valid when dash style = 5. A valid definition contains an even amount of space-separated values ranging from 0 to 99. The first value in a value pair defines the amount of pixels that are drawn and the second one the amount of pixels that are left empty in the line.
FillGraphicalProperties, array with the following columns:
•Style, integer (0 = transparent, 1 = solid, 2 = gradient, 3 = texture, 4 = hatch)
•Primary color, integer
•Primary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Secondary color, integer
•Secondary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Gradient type, integer (1 = linear, 2 = rectangle)
•Gradient mode, integer (0 = horizontal, 1 = vertical, 2 = forward diagonal, 3 = backward diagonal)
•Texture wrap mode, integer (0 = tile, 1 = tile flip X, 2 = tile flip Y, 3 = tile flip XY, 4 = clamp)
•Hatch style, integer (0-52)
Contents of the FillGraphicalProperties array depends on the style. For transparent fills, only primary transparency is included. For solid fills, both primary color settings are included. For gradients the array contains both primary and secondary color settings as well as gradient settings. For textures there are primary color settings and texture wrap mode included, but the actual texture is not available. For hatch fill style there are both primary and secondary color settings as well as hatch style setting. In case the value is below the accepted range, the minimum value is use. Similarly the maximum value is used for values above the accepted range.
Instance related properties: ElementHeight (int), ElementWidth(int), ElementPosX(int), ElementPosY(int)
InGroups, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
InstancesInGroup, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
FullId refers to a group:
ElementTypeId, id
Name, string
Description, string
InGroups, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
InstancesInGroup, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
FullId refers to an information item:
ModelObjects, array
Flows, array
Links, array
IsEmbedded, boolean
EmbeddedInformation, blob
DocumentType, int
ChildInformationItems, array
ParentInformationItems, array
FlowCompositions, array
ElementID refers to a checkpoint:
Id, id
ProcessLevel, id
Name, string
InstanceGraphicalProperties, array
ElementID refers to a text item:
Id, id
ProcessLevel, id
Name, string
InstanceGraphicalProperties, array
ElementID refers to a picture:
Id, id
ProcessLevel, id
Name, string
InstanceGraphicalProperties, array
PictureFileName, string. Path to the image to use with the picture element.
FullId refers to a custom element:
Owner, id
SimulationEntryRule, int
SimulationExitRule, int
ProcessingTimeType, int
InputFrequencyType, int
MaxInputs, int
ModelingDirection, int
LineGraphicalProperties, array with the following columns:
•Width, integer
•Color, integer
•Transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Dash style, integer (0 = solid, 1 = dash, 2 = dot, 3 = dash dot, 4 = dash dot dot, 5 = custom)
•Custom dash pattern, string. Valid when dash style = 5. A valid definition contains an even amount of space-separated values ranging from 0 to 99. The first value in a value pair defines the amount of pixels that are drawn and the second one the amount of pixels that are left empty in the line.
FillGraphicalProperties, array with the following columns:
•Style, integer (0 = transparent, 1 = solid, 2 = gradient, 3 = texture, 4 = hatch)
•Primary color, integer
•Primary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Secondary color, integer
•Secondary color transparency, integer (0-255, 0 = fully transparent, 255 = opaque)
•Gradient type, integer (1 = linear, 2 = rectangle)
•Gradient mode, integer (0 = horizontal, 1 = vertical, 2 = forward diagonal, 3 = backward diagonal)
•Texture wrap mode, integer (0 = tile, 1 = tile flip X, 2 = tile flip Y, 3 = tile flip XY, 4 = clamp)
•Hatch style, integer (0-52)
Contents of the FillGraphicalProperties array depends on the style. For transparent fills, only primary transparency is included. For solid fills, both primary color settings are included. For gradients the array contains both primary and secondary color settings as well as gradient settings. For textures there are primary color settings and texture wrap mode included, but the actual texture is not available. For hatch fill style there are both primary and secondary color settings as well as hatch style setting. In case the value is below the accepted range, the minimum value is use. Similarly the maximum value is used for values above the accepted range.
InGroups, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
InstancesInGroup, array with two columns: object ID and instance ID. Setting this property doesn't force graphical presentation, i.e. if the elements are not overlapping on a diagram so that group properties would be valid, SetProperty will set the relation but it will be cleared by model validation. However, if there are group relations that are set by grouping, those values are set as expected and will not be cleared by model validation.
+ all custom attribute types defined for each type. To refer to member attributes in attribute sets or enumerations, use the extended naming with the following syntax: <attribute set / enumeration>, for example EventType.Start
The value for an External model type custom attribute pointing to a server model should be a string following this syntax: 8000:<ModelId>:<ProcessLevelId>:<Path>:<ProcessLevelPath (can be left empty)>/ (for example: 8000:1265506417:0:\\localhost\Demo Models\2:/). To have the External model type custom attribute point to a file, use the path to the file, e.g. C:\Path\To\Some\File.foo.
Value: Variant. Value to be set to the attribute. Note that if ExtendedPropertyName refers to an enumerated custom attribute, a valid enumerated string must be passed as the Value parameter.
When setting array values (usually relations to other objects), do not set the whole array at once. Check which values must be added and removed from the original values and use the Add/Remove methods to set the values. However, some array values must be set as whole arrays (the order of the values is important). These include:
•EntryRules and ExitRules in Process Steps and Stores
•ProcessingTimes and InputFrequencies in Proces Steps and Flows
Required Rights:
Administrator or model administrator.
Return Values:
Below are listed the return values that this function can return:
RV_SUCCESS
RV_INVALID_PARAMETER
RV_PROPERTY_NOT_FOUND
RV_CANNOT_SET_PROPERTY
RV_APPLICATION_QUIT_CALLED
RV_MODEL_NOT_OPEN
RV_ELEMENT_NOT_FOUND
RV_INVALID_SYMBOL
RV_ACCESS_DENIED
RV_UNKNOWN_ERROR
RV_FUNCTION_CANNOT_BE_USED_IN_VALIDATION_SCRIPT
Example Procedure:
iResult = PGModel.SetProperty(12345, "Description", "Description text")