public static DeploymentWithDefinitionsDto fromDeployment(DeploymentWithDefinitions deployment) { DeploymentWithDefinitionsDto dto = new DeploymentWithDefinitionsDto(); dto.id = deployment.Id; dto.name = deployment.Name; dto.source = deployment.Source; dto.deploymentTime = deployment.DeploymentTime; dto.tenantId = deployment.TenantId; initDeployedResourceLists(deployment, dto); return(dto); }
private static void initDeployedResourceLists(DeploymentWithDefinitions deployment, DeploymentWithDefinitionsDto dto) { IList <ProcessDefinition> deployedProcessDefinitions = deployment.DeployedProcessDefinitions; if (deployedProcessDefinitions != null) { dto.deployedProcessDefinitions = new Dictionary <string, ProcessDefinitionDto>(); foreach (ProcessDefinition processDefinition in deployedProcessDefinitions) { dto.deployedProcessDefinitions[processDefinition.Id] = ProcessDefinitionDto.fromProcessDefinition(processDefinition); } } IList <CaseDefinition> deployedCaseDefinitions = deployment.DeployedCaseDefinitions; if (deployedCaseDefinitions != null) { dto.deployedCaseDefinitions = new Dictionary <string, CaseDefinitionDto>(); foreach (CaseDefinition caseDefinition in deployedCaseDefinitions) { dto.deployedCaseDefinitions[caseDefinition.Id] = CaseDefinitionDto.fromCaseDefinition(caseDefinition); } } IList <DecisionDefinition> deployedDecisionDefinitions = deployment.DeployedDecisionDefinitions; if (deployedDecisionDefinitions != null) { dto.deployedDecisionDefinitions = new Dictionary <string, DecisionDefinitionDto>(); foreach (DecisionDefinition decisionDefinition in deployedDecisionDefinitions) { dto.deployedDecisionDefinitions[decisionDefinition.Id] = DecisionDefinitionDto.fromDecisionDefinition(decisionDefinition); } } IList <DecisionRequirementsDefinition> deployedDecisionRequirementsDefinitions = deployment.DeployedDecisionRequirementsDefinitions; if (deployedDecisionRequirementsDefinitions != null) { dto.deployedDecisionRequirementsDefinitions = new Dictionary <string, DecisionRequirementsDefinitionDto>(); foreach (DecisionRequirementsDefinition drd in deployedDecisionRequirementsDefinitions) { dto.deployedDecisionRequirementsDefinitions[drd.Id] = DecisionRequirementsDefinitionDto.fromDecisionRequirementsDefinition(drd); } } }