Microflows (Metamodel)

8 minutes to read Download PDF Edit

Overview

Microflows have parameters, a return type (the return value is defined in an object, see below), and allowed module roles. Rules are similar to microflows, but have rule parameters, and they do not have some Microflow-specific properties

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| The Microflows overview page | The microflows package Microflow, technical information on properties of a microflow | Microflow Rule | Rule Parameter | MicroflowParameter

Microflow & Rule structure

Microflows consist of a collection of objects connected by flows. The objects represent activities, such as Object manipulation & retrieval, microflow calls, web service calls, etc. (details follow below).

For example, a simple microflow could consist of a start event, a single activity, and an end event. The `Microflow would then have three MicroflowObjects in its MicroflowObjectCollection, and would have two SequenceFlows. The first sequence flow would have the start event as its origin and the activity as its destination. The second sequence flow would have the activity as its origin, and the end event as its destination.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Activities | MicroflowObjectCollection Sequence Flow | SequenceFlow

Microflow objects

There are several types of objects that can be added to a microflow. One type is Activity, which can either be a loop, or an action activity, which will execute a microflow action (see the next section for more details on different types of activities). Other microflow object types include start and end events, splits and merges, annotations and parameters.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Activities | MicroflowParameterObject, Activity Start and End events | StartEvent, EndEvent Loops, with Break and Continue events | LoopedActivity, BreakEvent, ContinueEvent Annotation | Annotation

Flows

A microflow consists of objects that are connected by flows, specifically, SequenceFlows. A flow has an origin and a destination, with which the order of objects in the microflow is defined.

An exclusive split on an enumeration has a sequence flow for each enumeration value. In the meta model, this is represented by the case value of the sequence flows. Each sequence flow has an enumeration case value with value set to the corresponding enumeration case. Boolean splits have two sequence flows, one for each of true and false, with each a corresponding case value.

Inheritance splits have sequence flows for each specialization of the entity type on which is split. Each sequence flow has an inheritance case value with as value the specialization entity.

Annotation flows are used to connect annotations to other microflow objects.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Sequence Flow | Flow Annotation flow | SequenceFlow |AnnotationFlow |Properties origin and destination of Flow |CaseValue and its inheritance hierarchy

Splits

The control flow in microflows is defined with splits of two types: exclusive splits (for boolean or enumeration splits) and inheritance splits (for control based on specialization entity types). Two paths of control can be merged with an exclusive merge.

An exclusive split conditionally splits on either an expression or a rule. In case of a rule, a call is made, similar to a microflow call, with a rule parameter mapping.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Exclusive Split |ExclusiveSplit Inheritance Split |InheritanceSplit Merge |ExclusiveMerge Rules |ExpressionSplitCondition |RuleSplitCondition |RuleCall |RuleCallParameterMapping

Microflow activities

Working with objects

Objects can be manipulated in microflows through several activities. New objects can be created. Existing objects can be retrieved (see the next subsection for details). All objects can be updated or deleted. All changes (including creation and deletion) can be committed or rolled back.

Object attributes can be updated with a change action, both in a create action and in an update action.These actions have a list of items that describe which attribute or association is set, to a certain value.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Create Object |CreateObjectAction and ChangeObjectAction (ChangeMembersAction, MemberChange) Change Object | DeleteAction Rollback Object |CommitAction and RollbackAction

Retrieving Objects

A retrieve action is either an association-based retrieve or a database-based retrieve. An association-based retrieve points to a specific association and retrieves the relevant objects over that association. A database-based retrieve directly accesses the database and provides control over the XPath constraint, sorting of the retrieved objects and the range of objects to retrieve.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Retrieve |RetrieveSource XPath constraints |AssocationRetrieveSource |DatabaseRetrieveSource |Range, ConstantRange and CustomRange |SortItemList and SortItem

Microflow Calls

Microflows can call other microflows by defining a mapping of expressions to parameters (of the called microflow).

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Microflow Call |MicroflowCallAction |MicroflowCall |MicroflowCallParameterMapping

Web Client activities

Microflows can trigger behavior in the browser: showing and closing pages, showing (popup) messages, providing validation feedback and triggering file downloads.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Show Page and Show Home Page |ShowPageAction and ShowHomePageAction Close Page |CloseFormAction Show Message |ShowMessageAction Validation Feedback |ValidationFeedbackAction Download File |DownloadFileAction

App service calls

An app service call action points to a specific app service action (which is part of a consumed app service). The action call has a list of parameter mappings of app service action parameters to expressions.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Consumed App Services |AppServiceCallAction |AppServiceAction |AppServiceCallParameterMapping |AppServiceActionParameter

Web service calls

A web service call to an imported web service has an HTTP configuration, and a request and response handling configuration to map the request and response parameters of the third-party web service operation to Mendix app concepts.

Graphical overview

See the following diagrams for details on the HTTP configuration, request handling, and response handling.

Mendix Modeler Reference Guide | Model SDK API docs -| Call Web Service |WebServiceCallAction |HttpConfiguration |RequestHandling and ResultHandling

Web service calls - Request HTTP configuration

An HTTP configuration has an optional custom endpoint location, authentication credentials, and optional HTTP headers.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Call Web Service |HttpConfiguration |HttpHeaderEntry

Web service calls - Request handling

A web service operation request needs to be mapped from Mendix app concepts to the specifics of the web service operation. There are four different ways in which request handling can be configured. Each has its own specific configuration options.

  1. Export Mapping - The recommended option whenever you are sending complex XML objects (non-primitives) to a third party.
  2. Simple Parameter Mapping - Use this option when you are just sending primitive values to a third party. The argument can be any MicroflowExpression producing a value compatible with the parameter type. The ElementPath is a string representing the place in the element tree of the parameter in the XML message.
  3. Advanced Parameter Mapping - This is a combination of the above two mappings, starting one level deeper in the XML hierarchy than a regular export mapping. Use a MicroflowExpression for a primitive value and an ExportMapping for a complex one.
  4. Custom mapping - Specify the XML to be sent manually. Powerful yet dangerous.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Call Web Service |RequestHandling |SimpleRequestHandling - WebServiceOperationSimpleParameterMapping |AdvancedRequestHandling - WebServiceOperationAdvancedParameterMapping |MappingRequestHandling |CustomRequestHandling

Web service calls - Response handling

The result of a web service operation needs to be mapped to Mendix app concepts with an import mapping call which uses an import mapping. The range of objects to map can also be controlled.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Call Web Service |ResultHandling |ImportMappingCall |ImportMapping |Range

Variables

Microflow variables can be created and changed with specific actions. A create variable action also has a data type to indicate the type of the newly created variable.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Create Variable |CreateVariableAction Change Variable |ChangeVariableAction

Lists

Lists can be created, changed and deleted with specific actions. List aggregation actions have a specific function (e.g. sum or average). List operations can also be executed, see the following sections for details.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Create List |CreateListAction Change List |ChangeListAction Aggregate List |DeleteAction List Operation |AggregateListAction |ListOperationAction and ListOperation

Lists - Operations

Lists can be manipulated with different types of operations. Lists can be sorted, with a list of sorting items. Head and tail provide the first and remainder of a list, respectively. Find and filter respectively pick one and all elements of a list that adhere to some condition.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| List Operation |ListOperation |Head and Tail |Sort, SortItemList and SortItem |Filter and Find

Lists - Binary operations

Lists can be manipulated with several binary operations, which take two lists as input.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| List Operation |BinaryListOperation |Contains |Intersect |ListEquals |Subtract |Union

Java action calls

Java action calls point to a specific Java action and have a parameter mapping with an expression for every parameter of the Java action.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Java Action Call |JavaAction |JavaActionParameter |JavaActionCallAction |JavaActionParameterMapping

Logging

Logging actions target a single log node on a specific log level. The log message is parameterized.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Log Message |LogMessageAction |LogLevel |StringTemplate |TemplateArgument

Importing & Exporting XML

XML import actions use an XML-to-domain mapping similar to web service response mappings.

XML export actions use a domain-to-XML mapping similar to web service request mappings.

Graphical overview

Model SDK API docs * ImportXmlAction * ResultHandling * ExportXmlAction * ExportMapping * FileDocumentExport * VariableExport

Document generation

Documents are generated from a document template. Such a template has parameters, which are mapped with a parameter mapping at each call site.

Graphical overview

Mendix Modeler Reference Guide | Model SDK API docs -| Generate Document |GenerateDocumentAction |DocumentTemplate |DocumentTemplateParameterMapping

Copyright © Mendix. All rights reserved. | Mendix.com | Terms of Use | Privacy Policy