示例#1
0
文件: __init__.py 项目: triicst/JMS
 def RunWorkflowJob(self, job, stages, files):
     stage_levels = {}
     executed_stages = {}
     
     #create job stages
     for i, s in enumerate(stages):
         stage = Stages.GetStage(self.user, s["StageID"])
         
         if not stage_levels.get(stage.StageLevel):
             stage_levels[stage.StageLevel] = []
         
         stage_obj = { "stage": stage, "parameters": s["Parameters"] }
         stage_levels[stage.StageLevel].append(stage_obj)
     
     for stages in sorted(stage_levels):
         for s in stage_levels[stages]:
             stage = s["stage"]
             parameters = s["parameters"]
             
             jobstage = self.RunToolJob(job, parameters, files.get("stage_%d" % stage.StageID, []), stage, i)
             
             executed_stages[stage.StageID] = jobstage.JobStageID
         
             for dep in jobstage.Stage.StageDependencies.all():
                 JobStageDependency.objects.create(
                     JobStageOI=jobstage,
                     DependantOn_id=executed_stages[dep.DependantOn.StageID],
                     Condition_id=dep.Condition.ConditionID,
                     ExitCodeValue=dep.ExitCodeValue
                 )
示例#2
0
文件: __init__.py 项目: triicst/JMS
 def DeleteStageDependency(self, dependency_id):
     with transaction.atomic():
         dep = StageDependencies.GetStageDependency(self.user, dependency_id)
         StageDependencies.DeleteStageDependency(self.user, dep)
         
         Stages.UpdateStageLevel(dep.StageOI)
     
     return self.GetStages(dep.StageOI.WorkflowVersion.Workflow.WorkflowID, 
         "dev")
示例#3
0
文件: __init__.py 项目: triicst/JMS
 def AddStage(self, workflow_id, stage):
     workflow = self.GetWorkflow(workflow_id)
     version = self.GetWorkflowVersion(workflow, "dev")
     
     tool = self.GetTool(stage["ID"])
     tool_version = self.GetToolVersion(tool, stage["VersionNum"])
     
     return Stages.AddStage(self.user, version, tool_version, None, False,
         stage["Left"], stage["Top"])
示例#4
0
文件: __init__.py 项目: triicst/JMS
 def AddStageDependency(self, stage_id, dependency):
     with transaction.atomic():
         stage = self.GetStage(stage_id)
     
         stage_dependency = StageDependencies.AddStageDependency(self.user, 
             stage, dependency['DependantOn'], dependency['Condition'], 
             dependency['ExitCodeValue'])
         
         Stages.UpdateStageLevel(stage)
     
     return stage_dependency
示例#5
0
文件: __init__.py 项目: triicst/JMS
 def UpdateStage(self, stage_id, stage_details):
     with transaction.atomic():
         stage = self.GetStage(stage_id)
         tool = stage.ToolVersion.Tool
         version = self.GetToolVersion(tool, stage_details["VersionNum"])
         
         stage = Stages.UpdateStage(self.user, stage, version, None,
             stage_details["Checkpoint"])
         
         StageParameters.UpdateStageParameters(self.user, stage,
             stage_details["StageParameters"])
         
     return stage
示例#6
0
文件: __init__.py 项目: triicst/JMS
 def DeleteStage(self, stage_id):
     stage = self.GetStage(stage_id)
     Stages.DeleteStage(self.user, stage)
示例#7
0
文件: __init__.py 项目: triicst/JMS
 def MoveStage(self, stage_id, stage_pos):
     stage = self.GetStage(stage_id)
     
     return Stages.MoveStage(self.user, stage, stage_pos['Left'], 
         stage_pos['Top'])
示例#8
0
文件: __init__.py 项目: triicst/JMS
 def GetStage(self, stage_id):
     return Stages.GetStage(self.user, stage_id)
示例#9
0
文件: __init__.py 项目: triicst/JMS
 def GetStages(self, workflow_id, version_num):
     workflow = self.GetWorkflow(workflow_id)
     version = self.GetWorkflowVersion(workflow, version_num)
     return Stages.GetStages(version)