1.Get started

This tutorial will give you a clear explanation on how to run Myddleware.

Firstly, we will detail all the set up process necessary to run Myddleware. Then we will explain how to handle data transfer errors.

2.User Creation

An admin user is automatically created during the installation of Myddleware . You can create other users if other people need access to Myddleware . So you will know who created a rule for example.

At  the moment the creation of users is done by command line. However, it will soon be possible to do it directly in Myddleware by an admin user.

To create a user, run the following command through a command prompt:

Create the user profile to connect to Myddleware. Change myddleware_username , myddleware_user_email , myddleware_password to the user you want to create:

php app/console fos:user:create myddleware_username myddleware_user_email myddleware_password

If you want to add the administrator role to the user you just created, run this command:

php app/console fos:user:promote myddleware_username ROLE_ADMIN


3.Configuration envoi email

Myddleware peut vous envoyer des notifications et des alertes en fonction des tâches planifiées que vous avez mis en place (voir chapitre sur les tâche planifiées). En effet il est nécessaire d’avoir correctement configuré l’envoi d’email pour faire fonctionner la tâche “notification” correctement.


Il sera bientôt possible de configurer les paramètres d’envoi d’email directement dans Myddleware. Un envoi de test sera également disponible afin de valider les paramètres. Cette fonctionnalité n’étant pas encore développée, la configuration de l’envoi d’email se fait dans le fichier myddleware/app/config/parameters.yml :.

4.Gestion des erreurs

Les transferts de données sont parfois erronés pour diverses raisons. Voici quelques-uns :

  • La solution où les données sont envoyées n’est plus disponible,
  • Les données envoyées ne sont pas correctes (email invalide par exemple),
  • Un transfert de données parent est erroné (nous bloquons l’envoi d’une commande si le client n’a pas pu être créé)

Lorsqu’un transfert de données est en erreur, il peut être relancé automatiquement via le job rerunerror (voir tâche planifiée). Mais il peut aussi être relancé manuellement en cliquant sur «Reload»

Vous pouvez également annuler un transfert de données.

Il est également possible de modifier les données à envoyer directement dans Myddleware même s’il est recommandé de toujours modifier les données dans la solution source. Ainsi, lorsqu’un transfert de données est erroné, vous pouvez double-cliquer sur les données à envoyer et les modifier:


Il suffit ensuite de relancer le transfert de données pour envoyer les données modifiées.

5.Scheduled tasks

Myddleware can work with background tasks to sync your data, send notifications, clean data, and more.

If you wish to carry out this action, you will have to set up a background task using the crontab for Linux, or Widows task scheduler.

Before creating this task, make sure your configuration is correct, open a command shell and run the program check.php in the directory app : php app/check.php


Change your file permission or PHP configuration in case of permission error or missing PHP requirement :


All you have to do is set up the “jobScheduler” scheduled task that will launch all the other Myddleware tasks:

cd <mydelware directory>; php app/console myddleware:jobScheduler --env=background

This jobScheduler task will read the JobScheduler table and start the tasks according to the parameters of this table. You can manage this table directly in Myddleware

We draw your attention to the following columns:

  • Period: this is the time interval corresponding to the frequency of execution of this task. Caution: The frequency of the scheduled task must be greater than or equal to the frequency entered in the period field.
  • Order job: this is the order in which the tasks will be executed. The tasks with the smallest order will be executed first.
  • Active: Disables a scheduled task.

We will detail the different tasks in the following chapters that will enable you to fill the other columns.


5.1.Data Synchronization

The “synchro” program will allow you to synchronize your data by launching all active rules :

  • Command : synchro
  • Parameter 1 :Select all active rules or a specific rule.

Only active rules will be available in the list:

5.2.Reloading errors

The scheduled task “rerunerror” reloads transfers in error automatically.

  • Command : “rerunerror”
  • Parameter 1:  the maximum number of data transfers that the job will attempt to reload.
  • Parameter 2: the maximum number of times a transfer will be reloaded

In the above example, we have configured 2 tasks of reloading errors:

  • The first takes 100 maximum data transfers once per hour (60 minutes). This job will only take data transfers that have been reloaded at most 5 times.
  • The second takes 100 data transfers maximum once a day (1440 minutes). This job will only take data transfers that have been reloaded a maximum of 10 times.

5.3.Errors notification

The sheduled task “notification” allows you to send notifications and alerts or statistics by email.

  • Command : “notification”
  • Parameter 1 : alert or statistiques. If “alert” then the program will send alert if a scheduled task is blocked. If  “statistics”, the program will send the statistics (number of data transfer in error, number of data transfers successfully sent…)

In the above example, we have configured 2 tasks  :

  • The first checks every hour if a scheduled task is blocked. If yes, an email is sent to all administrators
  • The second one sends statistics every day.

5.4.Data clearing

The scheduled task “cleardata” deletes all the empty or expired data in Myddleware.

In the above example, we have configured a task that deletes empty or expired data in Myddleware :

  • Empty data corresponds to :
    • data transfer logs that carry no important information (all logs except error, new and send log) and are older than 7 days
    • tasks that have not performed any data transfer and are older than 7 days.
  • Expired data corresponds to the data transfers that have exceeded their validated date set in each rule.

  • Once the data has been cleaned up, all that remains are the IDs on the data transfers and the important logs (the log of creation, sending and possible errors) :

6.Myddleware shutdown

It can happen that your server stops or that your http service (apache for example) or MySQL encounters a problem. In these cases, Myddleware may be interrupted while it is running. Here’s how to make sure that Myddleware restarts properly once your server is restarted.

  • Check if Myddleware had a job in progress during the interruption
    • To do this, click on the list of tasks in Myddleware and check if a task is running and its start date is before the interruption:

  • Stop the task that could not be completed
  • If you have checked that a current job has a pre-interrupt start, this task will never stop automatically and will block the operation of Myddleware. It is therefore necessary to open this task and stop it:

Once the task is stopped, it will no longer block Myddleware, which will be able to function normally again.

Suggest Edit