src/Runtime/RuntimeService.php
public function startProcessInstanceByMessage($messageName, $businessKey = null, array $variables = [])
    {
        $query = $this->engine->getRepositoryService()->createProcessDefinitionQuery();
        $def = $query->messageEventSubscriptionName($messageName)->latestVersion()->findOne();
        $startNode = $def->findMessageStartEvent($messageName);
        
        $id = $this->engine->executeCommand(new StartProcessInstanceCommand($def, $startNode, $businessKey, $variables));
        
        return $this->engine->getHistoryService()->createHistoricProcessInstanceQuery()->processInstanceId($id)->findOne();
    }
public function startProcessInstanceByMessage($messageName, $businessKey = null, array $variables = [])
    {
        $query = $this->engine->getRepositoryService()->createProcessDefinitionQuery();
        $def = $query->messageEventSubscriptionName($messageName)->latestVersion()->findOne();
        $startNode = $def->findMessageStartEvent($messageName);
        
        $id = $this->engine->executeCommand(new StartProcessInstanceCommand($def, $startNode, $businessKey, $variables));
        
        return $this->engine->getHistoryService()->createHistoricProcessInstanceQuery()->processInstanceId($id)->findOne();
    }
public function startProcessInstanceByMessage ( $ messageName , $ businessKey = null , array $ variables = [ ] ) { $ query = $ this -> engine -> getRepositoryService ( ) -> createProcessDefinitionQuery ( ) ; $ def = $ query -> messageEventSubscriptionName ( $ messageName ) -> latestVersion ( ) -> findOne ( ) ; $ startNode = $ def -> findMessageStartEvent ( $ messageName ) ; $ id = $ this -> engine -> executeCommand ( new StartProcessInstanceCommand ( $ def , $ startNode , $ businessKey , $ variables ) ) ; return $ this -> engine -> getHistoryService ( ) -> createHistoricProcessInstanceQuery ( ) -> processInstanceId ( $ id ) -> findOne ( ) ; }
Start a process instance by message start event.

@param string $messageName
@param string $businessKey
@param array<string, mixed> $variables
@return HistoricProcessInstance
Start a process instance by message start event .