SetProperty
|
||
Revision history:
Introduced in QPR 8.0
Last changed in QPR 8.1 SP3
Sets a value of an element's attribute or custom attribute defined by Extended property name.
Synopsis:
PGModel.SetProperty(FullId, ExtendedPropertyName, Value)
Parameters:
FullId: Integer | String. FullId of the element or element instance. Mandatory. No Default value.
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
ScoreCardSymbol, string
MeasureSymbol, string
InterfaceElement, boolean
Symbol, string
Common properties for instances:
Note that these can be used only if instance parameter is set.
InstanceProcessLevel, int
InstanceSCModel, string
InstanceSCSymbol, 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 subprocess type process steps.
VersionNumber, string. This property is supported only for subprocess type process steps.
Status, enumerated. This property is supported only for subprocess type process steps.
Author, string. This property is supported only for subprocess type process steps.
Comment, string. This property is supported only for subprocess type process steps.
FullId refers to a flow:
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 process level 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. Process level definition (third column) is needed to flows that go through multiple process levels, 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. |
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 flow 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 process level 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. Process level definition (third column) is needed to flows that go through multiple process levels, 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.
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)
FullId refers to a group:
ElementTypeId, id
Name, string
Description, string
FullId refers to an information item:
ModelObjects, array
Flows, array
Links, array
IsEmbedded, boolean
EmbeddedInformation, blob
DocumentType, int
ChildInformationItems, array
ParentInformationItems, array
FlowCompositions, array
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.
+ 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
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
Example Procedure:
iResult = PGModel.SetProperty(12345, "Description", "Description text")