Olfa, messaging through API is possible by calling runtimeService.messageEventReceived(…) allowing you to specify which execution and which message was received.
iceman20, you could use a service-task that uses the DelegateExpression's EngineServices to trigger a message-event through the API, although this might not work in all circumstances (state of current execution is not yet persisted, this can be overcome by making the service-task asynchronous). If you need to have the "messageName" configurable, take a look at field injection in JavaDelegates (see userguide), which allows you to specify a value in the BPMN-xml which can be used in your service-task.