====== MessageSelector ======
The jobstep MessageSelector selects messages, which property according to gem. Function arguments1).
^Name ^Meaning|
|Type|Type of the job step.|
|Name|Name of the job step that will appear in the job designer|
|Description|Optional description for the job step.|
|//Expression//|Function whose result returns true or false. All messages on which the function applies are selected from the incoming message box (Inbox, SelectionBase / InputMessages).The message structure (SelectionBase) is often required to formulate conditions.|
|//Log XPath calls//|If activated, the values evaluated by the "XPath expression" are output when the debug log is active.|
The outgoing connectors of the **MessageSelector** have different effects:
* **OnMessgeSelection** outputs the whole selection, so it is operated once
* **OnMessage** gives the individual message, i.e. it is served as often as there are messages in the selection.
{{:images:sign_warning.png?nolink|}}**Note:** see also [[en:kommunikation:nachrichten:start#auswertung_bzw_filterung_von_nachrichten_in_jobs|Evaluation or filtering of messages in jobs]]
{{:images:sign_warning.png?nolink|}}**Hinweis:** You can test the expression using Mapping Function [[en:transformation:mappings:funktionen:allgemein:getmessageasselectionbase|]].
===== Samples: =====
* Select Messages in message box **To.Partner**://SelectionBase/OutputMessages[@MessageBoxName = 'To.Partner']
* Select Messages without attachments.//SelectionBase/InputMessages[ count(Attachments) = 0]
* Messages containing 'desadv' in the subject.//SelectionBase/InputMessages[contains(@Subject,'desadv')]
* Messages with file Name Test.txt //SelectionBase/OutputMessages[Attachments/@Filename = 'Test.txt']
* Messages with documents of doc type Pricat.//SelectionBase/InputMessages[Documents/@DocType = 'PRICAT']
* Messages with documents of doc entity type Desadv D96A.//SelectionBase/InputMessages[Match(Documents/EntityType/@Name, '.*Desadv.*D96A')]
* Messages with entry date .//SelectionBase/InputMessages[CompareDateTime(@EntryDate, '2007-01-29T17:50:00') > 0]
* Messages with zip attachments.//SelectionBase/InputMessages[contains(Attachments/@Filename, '.ZIP')]
* Messages of trading partner containing 'Test' equals true.//SelectionBase/InputMessages[IsTrue(GetTradingPartnerLocationVariable("Test", @PartnerGLN))]
* **[[en:partnerverwaltung:lokation:variablen:partnervariable]]** auswerten:/SelectionBase/InputMessages[GetTradingPartnerVariable('No.EDI', @PartnerGLN) != 'True' ]
{{:images:sign_warning.png?nolink|}}**Note:** The most important distinction is the path / SelectionBase / InputMessages and / SelectionBase / OutputMessages. Messages that are generated within a job with the MessageCreator are selected in the same job with / SelectionBase / OutputMessages and all messages sent to a job with / SelectionBase / InputMessages. All message properties2) that contain the message object can be used within the function. You will get a list of these attributes if you create a new mapping using the map editor and select the eBiss.ClassLib.MessageSelector.Selectionbase3 as the source object.
===== Cascading of selectors =====
It is possible to use the messageselectors cascaded. A second selection stage is followed by a further MessageSelector.
The messages of the first selection are filtered again by a second selection.
**Important:** The cascaded MessageSelector (second selection stage) now has the / SelectionBase / SelectedMessages available as MessageListen selection.
===== The following JobSteps are usually connected to the MessageSelector =====
* [[en:prozessdefinition:jobs:jobsteps:allgemein:delegatorjob]]
* [[en:prozessdefinition:jobs:jobsteps:allgemein:EntitySelector]]
* [[en:prozessdefinition:jobs:jobsteps:allgemein:messageloader]]
* [[en:prozessdefinition:jobs:jobsteps:allgemein:MessageSelector]]
* [[en:prozessdefinition:jobs:jobsteps:allgemein:MessageStateSetter]]
* [[en:prozessdefinition:jobs:jobsteps:allgemein:TaskNotification]]
* [[en:prozessdefinition:jobs:jobsteps:allgemein:TaskNotificatorEx]]
* [[en:prozessdefinition:jobs:jobsteps:supplier:articlesubscriptionselectordirectsql]]