LSPS documentation logo
LSPS Documentation
Models

To implement your business process in a model you will need to create a structure that will hold the model resources, allow their reuse, and keep them organized: All your resources must be created in or within a special directory called a GO-BPMN Project. Projects don't do much except holding the modules and some special resources (they are equivalent to Java Projects).

Projects hold modules and modules hold the logic and resources. Modules constitute your business models: They can contain processes, global variables, custom data types, queries, functions, etc. and are reusable: A module can import another module; once a module imports another modules, it can use its resources.

It is the modules that are uploaded to the server, while projects exist merely on design time in your workspace for your convenience.

Typically, at least one of the modules in your project is generally marked as executable: All resources of the module and its imported modules are referred to as a model. Once uploaded, you can create a model instance by running the module: A model instance then hold the context of the executable modules and all its module imports.

Let's create a GO-BPMN project with an executable module and create a model instance over it in Designer Embedded Server:

  1. In the GO-BPMN Explorer, right-click into empty space and go to New > GO-BPMN Project.
    1. In the GO-BPMN Explorer, right-click into empty space and go to New > GO-BPMN Project. In the displayed dialog below the Location field is the list of libraries that will be imported into the project. Only the Standard Library is required.
      newProject.png
    2. Name the project and click Finish.

      Note: If you created a new project to organize your resource, the project is not able to access resources from another project: to allow a project to use resources of another project, reference it from the project..

  2. Create a module:
    1. Right-click the project, go to New > GO-BPMN Module.
    2. In the dialog box, enter the module name main and click Finish.
  3. Install and connect to Designer Embedded Server:
    1. Click the Start Embedded Server button in the main toolbar: This will generate and start a local server with LSPS Application and connect your Designer to it.
    2. Switch to the Management perspective: click the Open Perspective button in the upper-right corner and select Management in the popup.
      intro-openingManagementPerspective.png
      The Management perspective contains information about the resources on the LSPS server, to which your Designer is connected, in our case, the local Designer Embedded Server.
  4. Upload main to the server:
    1. In Module Management, click the Upload button
      intro-uploadingModule.png
    2. In the Module Upload popup, select Select modules from workspace and select mainModule.
      intro-moduleUploadPopup.png
    3. Click OK.
    4. In the Module Management view, click the Modules tab.
      intro-uploadedModules.png
  5. Create a model instance of main:
    1. In the Model Instances view, click the Create button.
    2. In the Model Instance Creation popup, select the module and click OK.

Note that the Model Instances view now contains an entry with the model instance we have just created: double-click it to display its details. There is not much to see, since the underlying module did not contain anything.

Though not much really happened, the server still created a model instance and in the model instance, it created an instance of the module. The underlying module is empty so there was nothing to do so the module instance finished and then the model instance finished.

intro-emptyModelDetails.png
Let's add some content to our module–a BPMN process–to execute some logic:

  1. Open the Modeling perspective.
  2. Right-click main and go to New > Process Definition
  3. In the popup, enter the process name and select BPMN-based process.
  4. Design a process with a None Start Event, a Log task, and a Simple End Event.
  5. Set the Log task properties.
    intro-logprocess.png
  6. Upload the main module and create its model instance: you can do so as we did before from the Management perspective or you can right-click the module and go to Run As> Model.
    intro-quickmodelrun.png
  7. Switch to the Management perspective, refresh the Model Instances view (click the Refresh button in the view toolbar) and check the detail of the new model instance.
intro-modelInstanceDetailWithLog.png
Note the process instance in the details and the log entry in the Logs view.

Module Reuse

You have designed an executable module with a simple process and instantiated it on Designer Embedded Server: the server created a model instance with the module instance and, in the module instance, the process instance, which got executed and logged a message.

When you uploaded the module for the first time, the modules of the Standard Library have been uploaded as well: these modules were imported into your module when you created it. Module imports appear as part of the module so you can use their content. This allows you to reuse what you or other users have already created, and potential reuse is what you should have in mind when structuring your model.

intro-stdlibmoduleimports.png
Let's create and import a module:

  1. Create a common module in the project.
  2. Create in a global variable in the module:
    1. Right-click the module.
    2. Go to New > Variable Definition and then click OK.
    3. In the open editor, click Add and on the right, define a variable.
      intro-common-var.png
  3. In the process in main, try to use the variable from commonModule (for example, in the message of the Log task): you will get a validation error saying that no such entity is available.
    variableNA.png
  4. Now import common into main:
    1. In the GO-BPMN Explorer, double-click the Module Imports node in main.
    2. In the dialog box, click Add and double-click common.
      importingModule.png
    3. Watch your reference problem go away.
  5. Switch to the Management Perspective.
  6. Upload and run main
  7. Refresh the views and check the details of the new model instance.
    intro-moduleImportDemo.png
    Note the following:
  • The module common has been uploaded as part of main.
  • The model instance of main now contains two module instances (visible in the Model Instances Explorer on the right).
  • The global variable value in the common module instance is new log message and so is the new log entry value in the Log view.

Note: Only if a module is marked as executable can the server create a model instance over the module: this is convenient if you are using a module as a resource for other modules and don't want to use it as a base for model instances by itself: Non-executable modules just sit in the module repository on the server and are used by model instances created based on executable modules. An executable module resembles to marking a method as main: It signalizes that this module is where your execution starts. Unlike with main, you can have multiple executable modules in one module. However, the other executable modules do not have any impact on the model instance.

Proceed to Business Data