Difference between revisions of "Activity:CreateInstance (Activity)"
| Line 31: | Line 31: | ||
==Example== | ==Example== | ||
| + | Load the MetaClass named ''PUMP'', and create a new instance from it: | ||
| + | |||
| + | |||
| + | {| class="wikitable" | width = "50%" | ||
| + | |- | ||
| + | ! Argument!! Value | ||
| + | |- align="left" | ||
| + | | MetaClass|| <source lang = "vbnet">UBIKObject.Environment _ | ||
| + | .GetSystemMetaClass(SystemObjects.METACLASS) _ | ||
| + | .AllInstances("PUMP")</source> | ||
| + | |} | ||
==See also== | ==See also== | ||
Revision as of 14:09, 29 July 2013
| Create Instance | |
|---|---|
| Name | CreateInstance |
| Purpose | Create a new instance of a MetaClass |
| Category | Object Primitives |
| Returns | The created instance |
| Version | 2.1+ |
The CreateInstance Activity creates a new Instance of a specified MetaClass.
Contents
Arguments
| Argument | Type | Direction | Purpose |
|---|---|---|---|
| MetaClass | BaseClass | In | The MetaClass to create the instance from |
| Result | RelationalObject | Out | The created instance, null if creation failed |
Usage
This activity is used to create new UBIK® objects during the execution of a workflow. Since it only needs to know the MetaClass to create objects from, it can be used to create regular content objects as well as properties or anything else.
| This activity does not automatically save changes. If you want to persist the newly created instance, you need i.e. a subsequent SaveObject activity! |
Example
Load the MetaClass named PUMP, and create a new instance from it:
| Argument | Value |
|---|---|
| MetaClass | UBIKObject.Environment _ .GetSystemMetaClass(SystemObjects.METACLASS) _ .AllInstances("PUMP") |
