Variables Tab
Variables are used in workflow expressions. Variables can be either global (applicable to the process itself) or local (applicable to an assigned activity or a subprocess). If the variable is a Windchill business object, the attributes of that business object can be referenced through standard get APIs.
You can declare any Java type or Windchill class as a variable.
The variable must be serializable (persistable).
Variables can be declared as follows:
Visible or invisible
Required or optional
Read-only or read/write
Resettable or static
For information on creating a variable, see Defining Workflow Variables.
Recommendations for declaring variables
Although you can declare any Java type or Windchill class (provided it is serializable), PTC recommends the following guidelines:
A ProcessData object holds the workflow variables, and the composite object is persisted in the Oracle database in a BLOB column. If the persistent signature of a BLOB object changes after it is stored in the database, an error can be thrown at the time it is retrieved from the database and de-serialized. Therefore, workflow variable types should be restricted to the following:
Java primitives
Evolvables
Persistables
Evolvables provide methods to handle changes in their persistent signatures. Persistables are stored in workflow variables as object references.
Persistables should not be composed within another class, as this can lead to data inconsistency or corruption. Doing this also leads to a wt.pds.NotEvolvableException error during migration.
Persistables can be an element in a java.util.Vector (this is because the Vector class receives special handling by the WfVariable class), but this should be avoided if possible. Use of a CachedObjectReference or ObjectReference pointing to a persistable is the preferred practice.
A workflow variable can contain, compose, or otherwise encapsulate an ObjectReference to a persistable as necessary.
Variable Properties
The Variables tab lists the following values:
Name
The variable name.
If declaring a Java class, the name must be a proper Java variable name.
Display Name
If defined, the display name for the variable.
Type Name
The class type of the variable.
Visible
The variable is visible to users.
Required
The variable must have a value.
Read Only
The variable is read-only.
Read-only URL variables are displayed as hyperlinks.
Resetable
The variable is reset to its default value each time the workflow process or node is started.
This also applies to a node started as part of a workflow process loop.
Initialize From
The variable value is initialized from the parent template variable when the node starts.
Copy Into
The variable value is copied into the parent template variable when the node completes.
Default Value
If the variable class allows default values, you can specify one when creating the variable.
Was this helpful?