Working with association criteria

Back to Entering shipment data


Procedures on this page:


Whether a certain configuration object in Lobster Data Platform / Orchestration is applicable or effective in a certain situation depends almost always on access in the login context (role, company/company shares). As we described in the previous step (Entering shipment data), however, many configuration objects must also be assigned Association criteria, which the system evaluates at runtime in order to distinguish 'situationally', whether or which configurations are considered suitable candidates for deployment.

For most of the configuration objects bound to Association criteria (including input forms), usability in a login context does not require read access for the configuration itself. The only decisive factor is whether there is read access for at least one association criterion whose rule applies in the login context. By means of a targeted company authorization for Association criteria, all configurations 'subject to assignment' can be 'made available' to other companies for functional use, or assigned as restrictions.

Association criteria are defined by rules (see Rule types), which are either 'passed' (true/true) or 'failed' (false/false) for the respective data context. The same is valid for the association criterion as a whole, which may or may not 'apply' as a result of logical connexions between several rules.

A check of all association criteria for which there is (at least) read access in a logon context against the background of a concrete data context (especially the reference object/entity type and, if applicable, the logon context) results in a logical 'situational picture' for the system.

  • If the circumstances require an exclusive selection decision (e.g. 'Which input form appears?'), the best-matching principle comes into play, in which only the applicable association criterion with the highest priority takes effect.

  • In other cases (e.g. 'Which menu functions appears?'), all candidates are considered according to the all-matching principle, to which at least one applicable association criterion is assigned, whereby the priority is generally irrelevant.

In the last section (Entering shipment data) the association criterion 'Global' was created, whose only condition – a Static rule – is always 'passed' (true):

images/download/attachments/62855580/image2020-12-11_12-59-46-version-1-modificationdate-1607687988433-api-v2.png

This association criterion can now be assigned to all configuration objects 'subject to association' that are to be taken into account as a default or in any unspecific situation.

  • In the context of the input of shipment details, the only form configured up to now is used on the basis of this criterion, provided there is read access for the association criterion in the logon context. This currently applies only to the company 'Smart Logistics AG', which is the owner of the 'Global' association criterion.

Create an alternative input form for shipment details

This rather trivial scenario will now be extended by an alternative input form for shipment details, which will only be used in one specific situation.

  • The new input form 'External shipment' is to be used if a company belonging to the 'Transport company' group is selected as the 'Shipping freight forwarder' for the respective shipment.


Create a new shipment details input form named 'External Shipment' as a copy of the existing one, and then add an additional Tab panel element as shown below!


The additional tab is labelled 'Additional data'.

In the Row layout of the tab, two input fields from the 'Text Attribute' category are to be added via drag & drop as shown below:

  • Delivery comment

  • EAN Number

images/download/attachments/62855580/image2020-12-11_13-20-16-version-1-modificationdate-1607689218002-api-v2.png

We can now temporarily assign the existing association criterion 'Global' to the new input form via Assign in the ribbon.

  • When creating a new shipment or editing an existing one, the new input form ('External shipment') is always displayed, which is easily recognizable by the third tab in the Tab panel element.

    images/download/attachments/62855580/image2020-12-11_13-21-56-version-1-modificationdate-1607689318242-api-v2.png

    Why is the previously created form ('Standard Shipment') which is assigned the same assignment criterion ('Global') not used?

Since both entry screens qualify as candidates using the same association criterion, there is no difference with regard to the Priority, which is defined in the association criterion. In this case, the system simply reaches for the 'newest' form, since candidates of the same rank are sorted in descending order by their internal IDs.

Instead of this rather 'random' assignment logic, a targeted case differentiation depending on the assigned 'Shipping freight forwarder' is now to be configured.

Create selector form

Since the selection of the shipping freight forwarder should set the course for the entry possibilities of other shipment data, it should be ensured that this choice is made at the beginning of the shipment entry process.

This can be easily achieved by creating another input form for shipment details, which will exclusively select the shipping freight forwarder and which will be 'assigned' with priority, as long as this is not yet defined.

  • The input forms already created should appear alternatively – depending on the selection made – and only when the selection is finalized.


Create a new (empty) input form for shipment details and assign the name 'Shipping freight forwarder selector' to it.


Next, configure the layout as follows:

  • To explain the purpose of the input form, add a Label (labelled 'Select shipping freight forwarder:') followed by a Horizontal rule as a delimiter for the headline area.


  • Drag & drop a selection field for the Shipping freight forwarder from the Companies category in the element bar.


  • With this element selected, click the Behaviour (1) tab in the properties bar (to the right), to add a behaviour by the images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg symbol (2). Assign 'Shipping freight forwarder selected' as the Behaviour name (3).


  • Select 'Changed' as the Triggering event (4) (with the default Change type 'Exclusively by user').


  • Select Behaviour type Static (with default value True) for the Behaviour (5), as the Actions on true (6) should be executed unconditionally.


images/download/attachments/62855580/image2020-12-11_14-8-27-version-1-modificationdate-1607692109857-api-v2.png


With this configuration, the input form is now saved via Publish (in the ribbon) and is indicated as 'ready for use'. Assign the association criterion 'Global'!


How does the configuration within the input form work at runtime?

  • Any change of the selection in the selection field (that is different from the initial 'empty' state) triggers the 'Select shipping freight forwarder' behaviour.

  • The Behaviour (5) then executes the Kontext ungültig machen (6) action:

    • The current context (a shipment that recently contains a selection for the shipping freight forwarder) is not discarded as invalid, as the name of the action might suggest.

    • The action directs the system to discard the 'situational picture' created when opening the form as invalid, so that it re-evaluates the relevant Association criteria with the changed data.

    • By this action, the client gives the server the possibility to react to the changes that have not yet been saved and – as in our example – to check whether another input form is applicable for further processing on the basis of the Association criteria.

So now we have to set up Association criteria for the other input forms in such a way that they are accepted after selecting a shipping freight forwarder.

Define association criteria

Association criterion for standard shipments

For the assignment of the 'Standard shipment' input form, a new association criterion must be created, the rule of which includes the selection for the shipping freight forwarder.

The new Association criterion is assigned the Name 'Criterion standard shipment'.

For the Priority the default value (0) is applied.

NOTE◄ Since the 'Global' association criterion has been assigned a negative priority (-99999), it is ensured that any applicable criterion with the default value (0) overrides the 'Global' criterion.

images/download/attachments/62855580/image2020-12-14_9-29-39-version-1-modificationdate-1607934580494-api-v2.png

Since the association criterion is to be exclusively for the business object type 'Shipment', a rule of the Typprüfung (1) is first added by clicking on the images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg symbol:

  • Within the Typprüfung the Type (2) 'Shipment' must be selected so that this rule is only 'passed' if the data context is a shipment.

    This initial focus on the business object type on the one hand optimizes the runtime behaviour when evaluating the association criterion, because if the context does not contain a shipment, further AND-linked rules do not need to be evaluated either.

    On the other hand, the selection in the Typprüfung also affects the composition of the context menus in the rule editor (below), which are built up 'appropriately' for the type.



  • From the context menu opened for adding, the Company attribute rule (4) is now selected in the Attributes category.

    NOTE◄ The screenshot shows the context menu, which has been reopened after adding the Company attribute rule for the purpose of demonstration.

images/download/attachments/62855580/image2020-12-14_18-7-3-version-1-modificationdate-1607965625755-api-v2.png

Parameterization of the Company attribute rule (4):

  • 'Shipping freight forwarder' (SFW) is selected as the Company type (5), since the selection for the company attribute is to be examined with this Company type.


  • Under Companies (6), 'hand-picked' companies can be selected, which are to be considered as a positive list for 'Shipping freight forwarders' accepted by the rule. Here we select precisely one company, namely 'Smart Logistics AG'.


  • The option Cascade down (7) extends the positive list (implicitly) to all companies that are directly or indirectly subordinate to one of the previously explicitly named Companies (6), i.e. their entire 'hierarchy' (in a downward direction). We set this option (7), because it saves us the trouble to compile all companies from the company structure of 'Smart Logistics AG' explicitly as Companies (6). And, more importantly, in the case of changes to the corporate structure of 'Smart Logistics AG', these do not have to be explicitly tracked in our association criterion.

    NOTE◄ On the left in the screenshot on the right, the tree structure of the configured association criterion has been expanded here so that the details of the rules within the logical AND-link are visible. The tree visualizes the hierarchy of the logic, which is still relatively manageable here. For more complex logics the search function can be helpful. By clicking in the tree, elements can then also be 'made visible' in the graphical editor if they are initially hidden in collapsed links.

images/download/attachments/62855580/image2020-12-14_18-13-2-version-1-modificationdate-1607965984821-api-v2.png

Finally, the newly created association criterion must be saved and assigned to the 'Shipment details forms' overview of the 'Standard shipment' form. The existing assignment for the 'Global' association criterion must be removed in the process.

Association criterion for 'External shipments'

Now a specific association criterion must also be created for the input form for the shipment details of 'External shipments'.

NOTE◄ This association criterion can be conveniently used as a copy of the previous one, since it is identically structured.

As Name (1), 'Criterion external shipment' is assigned.

The Typprüfung can be kept unchanged.

The selection of Companies (2) within the Company attribute rule, on the other hand, needs to be adjusted: Only the group (company account) 'Transport companies' should be selected.

The option Company type 'Shipping freight forwarder' remains unchanged. The option Cascade down remains selected as well. After all, the criterion targets only the group members, i.e. the children to the group 'Transport companies'.

NOTE◄ The group itself would also be accepted by the criterion as a 'Shipping freight forwarder', but it is not available for selection in the form because the Company type 'Shipping freight forwarder' is not assigned in the group's company account.

images/download/attachments/62855580/image2020-12-14_18-43-22-version-1-modificationdate-1607967805288-api-v2.png

Finally, the newly created association criterion must be saved and assigned to the 'Shipment details forms' overview of the 'External shipment' form. The existing assignment for the association criterion 'Global' must be removed in the process.

Verify configuration

Now that the association criteria have been assigned to the relevant input forms, the correct interaction of the association criteria with the forms should be verified.

Create standard shipment

When clicking on 'New' in the shipment overview, the 'Selector form' appears, in which the Shipping freight forwarder must be selected for the shipment before the actual shipment entry is made.

images/download/attachments/62855580/image2020-12-15_13-36-53-version-1-modificationdate-1608035815148-api-v2.png

  • Scrolling through the options in the dropdown of the selection field for the Shipping freight forwarder, it is possible to see that all the companies from the 'Smart Logistics AG' company structure are selectable there, which qualify as the 'Shipping freight forwarder' Company type according to their account.

  • By contrast, the dropdown menu does not offer any of the companies defined as members of the 'Transport companies' group, which also qualify as 'Shipping freight forwarders'.

Background: Assigning a company as a 'participant' for a business object via a company attribute is tied to an independent authorization that must be granted individually for each business object type. For this authorization, a corresponding company authorization must be issued for the companies of the 'Transport companies' group as already shown (see Creating company authorizations or the chapter Company authorizations in the manual). Within the company structure of 'Smart Logistics AG', authorization is already given because a blanket release to parent companies has been issued for all authorizations (see Creating company authorizations).

The permission set up in the work step Companies as groups as groups for read access to the company accounts of the 'Transport company' group must therefore be extended by the missing permission ('Business objects/Shipments/Use as involved') as shown below:

images/download/attachments/62855580/image2020-12-15_17-22-47-version-1-modificationdate-1608049369429-api-v2.png

  • The header data of this company authorization remains unchanged.

images/download/attachments/62855580/image2020-12-15_17-24-2-version-1-modificationdate-1608049444283-api-v2.png

  • In the Permissions tab, the Use as involved permission must also be selected for the business object.

Now all companies of 'Smart Logistics AG' are allowed to use the members of the group 'Transport companies' as 'Shipping freight forwarder' in their shipments.

NOTE◄ In the example, the same authorization is used to grant 'Read' (for company accounts) on the one hand and 'Use as involved party' (for shipments) on the other hand. This has the effect that when logging in with a company from the 'Smart Logistics AG' company structure, the companies that can be selected as 'Shipping freight forwarder' are also listed in the company overview. However, the 'Use as involved' would also work without the read access for the company accounts in question. Then only 'Smart Logistics AG' (as owner) could access the 'Transport companies' via the company overview, while the child companies could select the 'Transport companies' as 'Shipping freight forwarder' (for shipments), but could not view them in the company overview.

Back to the 'Test':

If the selector form for creating a new shipment is now called up again, all 'Transport companies' are also available for selection:

images/download/attachments/62855580/image2020-12-15_17-28-29-version-1-modificationdate-1608049712129-api-v2.png

If a company from the 'Transport companies' group (e.g. DPD) is selected, the shipment is automatically interpreted as an 'External shipment', since the 'External shipment criterion' association criterion then applies. The action Kontext ungültig machen therefore causes the corresponding input form to appear:

images/download/attachments/62855580/image2020-12-15_17-29-33-version-1-modificationdate-1608049776113-api-v2.png

NOTE◄ At runtime, only the 'Additional data' tab indicates that this is the 'External shipment' input form. For a 'configurator' who knows the layouts of the two available forms, this is a clear differentiator. From the point of view of an end user who wants to enter a shipment, it is only relevant that he should enter 'Shipment details'. Whether different forms are involved, according to which criteria they are assigned and which form is currently displayed, does not necessarily have to be transparent for the end user. However, there is a function that can be used to uniquely identify the displayed input form at runtime:


Hold the Ctrl + Alt keys while clicking anywhere in the display area of the displayed input form!


A message like the following names the 'ID' (here: '10001') and the 'name' (here: 'External shipment') of the template used, as the designs of input forms are also called.

images/download/attachments/62855580/image2020-12-15_17-32-23-version-1-modificationdate-1608049945472-api-v2.png

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svg CAUTIONimages/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svg This function is available to every user who is allowed to open a form. This should be taken into account when selecting the name for an input form, which is otherwise only relevant for the configurator!

Conclusion: This was only the beginning of a long story...

The examples of association criteria rules presented in this tutorial are deliberately chosen to be simple and show only a small part of the range of rules described in the Rule types section of the manual. The possibilities to build complex logical connections from these 'building blocks' are almost unlimited. In this respect, this section is also intended to encourage independent experimentation in order to explore the given set of tools with an increasing degree of difficulty.

In general, the following applies in Lobster Data Platform / Orchestration: As soon as the 'Assign' images/download/attachments/62855580/image2015-12-16_15_0_15-version-1-modificationdate-1605255799912-api-v2.png button is available in a dialog, corresponding association criteria can be assigned.



► Continue with Weiteres Beispiel für Zuordnungskriterien