Difference between revisions of "Activity:CreateInstance (Activity)"
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | The CreateInstance Activity creates a new [[Instance|instance]] of a specified [[MetaClass]]. | ||
+ | |||
+ | =Description= | ||
{{ActivityInfoBox | {{ActivityInfoBox | ||
| title = Create Instance | | title = Create Instance | ||
Line 5: | Line 8: | ||
| imagecaption = Activity CreateInstance | | imagecaption = Activity CreateInstance | ||
| purpose = Create a new instance of a MetaClass | | purpose = Create a new instance of a MetaClass | ||
− | | category = Object Primitives | + | | category = UBIK Object Primitives |
| returns = The created instance | | returns = The created instance | ||
| version = 2.1+ | | version = 2.1+ | ||
}} | }} | ||
− | |||
− | + | ===Arguments=== | |
− | + | ||
− | ==Arguments== | + | |
{| class="wikitable sortable" | width = "50%" | {| class="wikitable sortable" | width = "50%" | ||
Line 19: | Line 19: | ||
! Argument !! Type !! Direction !! Purpose | ! Argument !! Type !! Direction !! Purpose | ||
|- align="left" | |- align="left" | ||
− | | MetaClass|| BaseClass || In || The MetaClass to create the instance from | + | | MetaClass|| [[BaseClass]] || In || The MetaClass to create the instance from |
|- align="left" | |- align="left" | ||
− | | Result|| RelationalObject|| Out || The created instance, null if creation failed | + | | Result|| [[RelationalObject]]|| Out || The created instance, null if creation failed |
|} | |} | ||
− | ==Usage== | + | ===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 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. | ||
− | {{Attention|This activity does not automatically save changes. If you want to persist the newly created instance, you need i.e. a subsequent [[Activity | + | {{Attention|This activity does not automatically save changes. If you want to persist the newly created instance, you need i.e. a subsequent [[Activity:SaveObject_(Activity)|SaveObject activity]]!}} |
− | + | =Example= | |
Load the MetaClass named ''PUMP'', and create a new instance from it: | Load the MetaClass named ''PUMP'', and create a new instance from it: | ||
− | |||
{| class="wikitable" | width = "50%" | {| class="wikitable" | width = "50%" | ||
Line 39: | Line 37: | ||
|- align="left" | |- align="left" | ||
| MetaClass|| <source lang = "vbnet">UBIKObject.Environment _ | | MetaClass|| <source lang = "vbnet">UBIKObject.Environment _ | ||
− | .GetSystemMetaClass(SystemObjects.METACLASS) _ | + | .GetSystemMetaClass(UBIK.Kernel.SystemObjects.METACLASS) _ |
.AllInstances("PUMP")</source> | .AllInstances("PUMP")</source> | ||
|} | |} | ||
+ | |||
+ | <headertabs /> | ||
==See also== | ==See also== | ||
* [[Workflow Designer]] | * [[Workflow Designer]] | ||
− | * [[SaveObject (Activity)]] | + | * [[Activity:SaveObject (Activity)]] |
− | + | [[Category:Activities]] |
Latest revision as of 17:10, 23 February 2015
The CreateInstance Activity creates a new Instance of a specified MetaClass.