process4.biz 7.x Documentation

features description for Process4.biz

Property Type: Formula

With the property type “formula”, you can use scripts that allow you to display values of other objects, diagrams etc. in this property. In the repository, the value of the property will be filled automatically.

Formulas are written in VB (Visual Basic) and you can use all p4b API functions. In addition, the formula text uses corresponding VB syntax highlighting. Note that the keywords reserved for Visual Basic cannot be used as DbName of the object in the formula; the list of the Visual Basic Reserved Keywords can be found here: 
http://msdn.microsoft.com/en-us/library/ksh7h19t%28v=vs.90%29.aspx
  
If you have already chosen a DbName that matches exactly a VB keyword, please change this DbName.

If the result of a formula property is a hyperlink, then the property “result is a hyperlink” is set to “true”. You can use the property type “formula” for Shape-specific properties too.

If a formula cannot be calculated, you are informed by an info message about possible errors. The display of this information message can be managed on the Client Settings.

Creating a Formula

To create the formula, the “DbName” (= the unique database name) of an item is used and referenced as This.DbName.

Examples

Example

Formula

Display of the property value of a linked object:

  • For an object of the class "A", there is a property with the DbName "Property".
  • For an object of the class "B", there is a property with the type "formula".

Goal: in the formula property of the object of the class "B", should appear the value of the property "Property" of the linked object (from the class "A").

There are two possible variants:

  1. "Property" is an Enum property: however, names (not numbers) of the set enum value of this property are displayed.
  2. "Property" is a string property.

Display the property value of the linked diagram

In the System class "diagram" (or in another class diagram), there is a property with the DbName "Property".

Goal: For an object of class "A", the value of the property "Property" of the first (second, third ...) linked diagram will now be displayed in a formula property.

("1" is the order number of the diagram where the object is used)

Display a property value of the diagram on which the object is used

In the System class "diagram" (or in another class diagram), there is a property with the DbName "Property".

Target: For an object of the class "A", the value of the property "Property" of the first (second, third ...) diagram where the object is used, will now be displayed in a formula property.

("1" is the order number of the diagram on which the object is used)

Display the sum of values of several properties

In class "A", there are three properties with the DbName "Price1", "Price2" and "Price3" and the property type "Double" or "integer".

Goal: The sum should be displayed in another property with the type "formula" in the same class.


Display the property value of a linked object on a diagram

In the class "Process", there is a property with the DbName "Owner".

Create in the system class "Diagram" (or in the diagram class to which the diagram belongs), a property "Diagram Owner" of the type "formula".

Goal: When an object of the class "Process" is linked to a diagram, the value of the property "Owner" of the linked object should be displayed on the diagram property "Diagram owner".

 

Display a property value from the parent diagram on a diagram

In the system class "Diagram" (or in the diagram class to which the diagram belongs), there is a property named "Property" and another property named "Parent property" with the type "formula".

Goal: In the property "Parent property", the "Property" value of the respective parent diagram should be displayed.


Display the name of the parent diagram(s)

  1. In the system class "Diagram" there is a property with the type "formula", where the names of all the parent diagrams of a diagram should be displayed. If there are several parent diagrams, they are displayed in a list.
  2. In the system class "Diagram" there is a property with the type "formula", where names of a parent diagram with a specific index (1, 2, 3, etc.) should be displayed.
    The index of the parent diagram corresponds to the order in which the Parent diagrams are listed in the upper formula.
  3. In the system class "Diagram" there is a property with the type "formula", where the name of only one parent diagram should be displayed. If there are several parent diagrams, the result "[multiple parent diagrams]" appears.

Display the property value from the Child diagram on a diagram

In the system class "Diagram" (or in the class to which the diagram belongs), there is the property "Property" and another property "Child property", each with the type "formula".

Goal: In the property "Child property", the "Property" value of the child diagram should be displayed.


The list of ENUM items of the objects of a class should depend on the property value of an object of another class

  • In the class "A", there is a property "X" with the Enum items "X0", "X1", "X2".
  • In the class "B", there is a property "Y" with the Enum items "Y0", "Y1", "Y2".

Goal: When the property value is set to "X1" for an object of class "A" and it is linked to an object of class "B", the enum item "Y1" in the object "B" in the Enumerator list should neither be visible nor selectable.

Open the Enum items of the property "Y" of class "B", select the Enum item "Y1" and write in the conditions field:

("1" is the order number of the ENUM item "X1")

Mark diagrams dependent on time via the formula

Goal: Mark diagrams at a particular time to be checked

  1. Add a new property of the type "datetime" for the system class "Diagram" and name it "Check at".

  2. Add Another property of the type "formula" for the system class "Diagram" and name it "Needs Check". This property is then set to "True", when the diagram should be checked.

Process4.biz can compare the current date with the date that is specified in the property "Check at"; if the current date is equal to or greater than the date in the property, then the property "Needs check" should be set to the value "true".

Note: The property "Needs check" can also be used on diagrams to display the value via Visio Data Graphics.

Sum specific property values of the objects of a diagram

The class "Action" has the property "Rate". Objects of this class are used in diagrams of the class "Diagram".

Goal: A formula property "Sum" for diagrams of the class "Diagram" summing the values of the property "rate" of the objects on the diagrams of this class.

Warning: the property "rate" must have the property type "Integer" or "Double" for such a calculation.

Show linked file name in case it exists. If not, show custom message

Comment: Ubound(...) operator cannot be used with p4b objects, since p4b uses its own collections (P4B.EntityCollection) and not vb arrays. Use .Count instead.

Use of shape-specific properties

Example Formula

The name of the diagram on which the shape is.

ShapeDiagramName

The ID of the diagram on which the shape is.

ShapeDiagramId

The ID of the shape.

ShapeID

Display a list of objects/diagrams

Example

Formula

The list of linked objects.

This.LinkedObjects.Name

The list of diagram names, on which the particular object is used.

This.Diagrams.Name

The list of linked diagrams.

This.LinkedDiagrams.Name

The property list of all the diagrams linked to the object.

This.LinkedDiagrams.Property

Geerbte Attribute

Es ist auch möglich ein Attribut zu definieren, dessen Wert geerbt wird durch den Diagrammbaum. Zum Beispiel haben wir eine (Parent) Klasse mit dem Attribut Temperatur.

Wir platzieren ein Objekt dieser Klasse in ein Diagramm. Eine andere (Child) Klasse (welche in einem verknüpftem Diagram sein wird) sollte den Wert der Property ausblenden. Deshalb, kreieren wire in neues Attribut für die Klasse im Designer und setzen des Attributtyp Formel.

0

Dieses geerbte Attribut („“) Da (in diesem Beispiel) der Wert den wir vererben wollen den DbName „temp“ hat, sollten wir schreiben: ThisInheritedAttribute(„temp“).

1

Immer wenn die Klasse B benutzt wird in irgendeinem Diagramm welches mit der Klasse A verlinkt ist, dann zeigt die Klasse B den Wert der Klasse A an.

2