Skip to main content

Usage with Bigraph Builder

Note: This site is currently under construction.

Please also refer to the methods of org.bigraphs.framework.core.factory.BigraphFactory which shall primarily be used.

Loading Bigraph Metamodels via the Builder​

The user must supply the signature and the filename or instance of the meta-model to instantiate a builder class. Therefore, the PureBigraphBuilder provides the following static methods:

// Create a builder using only the meta-model
public static <S extends Signature> PureBigraphBuilder<S> create(@NonNull S signature, String metaModelFileName)
public static <S extends Signature> PureBigraphBuilder<S> create(@NonNull S signature, EMetaModelData metaModelData)

// In combination with the instance model
public static <S extends Signature> PureBigraphBuilder<S> create(@NonNull S signature, String metaModelFilePath, String instanceModelFilePath) throws BigraphMetaModelLoadingFailedException
public static <S extends Signature> PureBigraphBuilder<S> create(@NonNull S signature, EPackage metaModel, EObject instanceModel)

Then, the builder may produce a bigraph by using its available methods as normal.

It is still necessary to supply the signature information as separate object. The reason is that not all information are recorded in the metamodel of the bigraph concerning the signature. Some properties that are missing include the arity of the control, or whether it is active, passive or atomic; to mention a few.

PureBigraphBuilder#create(Signature, EMetaModelData)​

Create a builder with a given metamodel instance.

PureBigraphBuilder#create(Signature, String)​

Create a builder with a given metamodel file located on the filesystem.

Loading Bigraph Instance Models via the Builder​

Though, bigraphs are per-se immutable data structures in Bigraph Framework, one can use the builder to instantiate bigraphs. Persisted bigraphs can be loaded and supplied to a bigraph builder.

To prepare a bigraph builder:

Signature<DefaultDynamicControl> signature = ...;
PureBigraphBuilder builder = PureBigraphBuilder.create(signature, "meta-model.xmi", "instance-model.ecore");

Then, the builder can be used as normal. One can, however, do not alter the pre-defined structure but adding new elements is still possible.

PureBigraphBuilder#create(Signature, String, String)​

Provide a signature, and the filename of the metamodel and instance model to create a builder instance.

PureBigraphBuilder#create(Signature, EPackage, EObject)​

Provide a signature, and the loaded metamodel and instance model to create a builder instance.