For a project I need to use the MpUserXSignature functionality in combination with Mappview. I have read the help but it still not clear to me how to implement it correctly.
Does anyone have experience with this and maybe has an example?
Hi Martijn,
Welcome to the community!
The Signature function requires someone to input a username and password (as well as an optional comment) each time a value is changed. This differs from the more common approach of unlocking certain elements (and therefore allowing changes) when a particular user is logged in.
Using this functionality requires two function blocks - MpUserXSignature and MpUserXSignatureUI. The MpUserXSignatureUI ties to a “UI Connect” variable. This type of variable is used on some other mapp function blocks as well and was created for use with the older HMI system, Visual Components. The information in this data structure is still useful, but it you might find it formatted strangely if you’ve never worked with Visual Components.
First, you have to configure your users and roles, as well as add them to the MpUserX configuration. Then, add a MpUserXSign configuration to the mappServices folder:
In the MpUserXSign configuration, you have to configure ActionIDs which are tied to User Levels. For example, I’ve tied Action ID 20 to User Level 20. This means that if I trigger a signature action with ID 20, a user with level 20 or higher must be the one to sign the action:
User Levels are determined by the Roles configured in the MpUserX configuration:
To trigger a signature event, set MpUserXSignatureUI.SignAction to a valid Action ID. Then, use the UI Connect variable to enter your user information and confirm the action. If the change is accepted, MpUserXSignature.Released will go true. If it is rejected, MpUserXSignature.Rejected will go true.
I’ve created and attached a very simple sample project for you that shows how you can link the UI Connect variable to mappView and trigger Dialogs (popups) using eventbindings. Every time you change the value on the main screen, you’ll get a popup asking for credentials. Use the username “Admin” and the password “admin”, then click Confirm. The value will change. If you click “Cancel” instead, the value will revert to the previous value.
SignatureExample.zip (3.7 MB)
Thank you marcus for the example and explanation!