public function create($data)
 {
     $workflow = new WorkflowDto();
     $workflow->populate($data);
     $this->getWorkflowFacade()->create($workflow);
     return new JsonModel($workflow->getArrayCopy());
 }
 /**
  * Get list of all workflows.
  * 
  * @return WorkflowDto[]
  */
 public function listAll()
 {
     $list = $this->workflowRepository->listAll();
     $workflowCollection = array();
     foreach ($list as $workflowData) {
         $workflow = new WorkflowDto();
         $workflow->populate($workflowData->getData());
         $workflow->setId($workflowData->getResourceId()->getValue());
         $workflowCollection[] = $workflow;
     }
     return $workflowCollection;
 }