@Override
 public List<WorkflowImpl> listWorkflowImpls(String templateId) throws WorkflowException {
   Map<String, AbstractWorkflow> abstractWorkflowMap =
       WorkflowServiceDataHolder.getInstance().getWorkflowImpls().get(templateId);
   List<WorkflowImpl> workflowList = new ArrayList<WorkflowImpl>();
   if (abstractWorkflowMap != null) {
     List<AbstractWorkflow> abstractWorkflowList = new ArrayList<>(abstractWorkflowMap.values());
     for (AbstractWorkflow abstractWorkflow : abstractWorkflowList) {
       WorkflowImpl workflow = new WorkflowImpl();
       workflow.setWorkflowImplId(abstractWorkflow.getWorkflowImplId());
       workflow.setWorkflowImplName(abstractWorkflow.getWorkflowImplName());
       workflow.setParametersMetaData(abstractWorkflow.getParametersMetaData());
       workflow.setTemplateId(abstractWorkflow.getTemplateId());
       workflowList.add(workflow);
     }
   }
   return workflowList;
 }
  @Override
  public WorkflowImpl getWorkflowImpl(String templateId, String workflowImplId)
      throws WorkflowException {

    WorkflowImpl workflowImpl = null;
    Map<String, AbstractWorkflow> abstractWorkflowMap =
        WorkflowServiceDataHolder.getInstance().getWorkflowImpls().get(templateId);
    if (abstractWorkflowMap != null) {
      AbstractWorkflow tmp = abstractWorkflowMap.get(workflowImplId);
      if (tmp != null) {
        workflowImpl = new WorkflowImpl();
        workflowImpl.setWorkflowImplId(tmp.getWorkflowImplId());
        workflowImpl.setWorkflowImplName(tmp.getWorkflowImplName());
        workflowImpl.setParametersMetaData(tmp.getParametersMetaData());
        workflowImpl.setTemplateId(tmp.getTemplateId());
      }
    }
    return workflowImpl;
  }