Esempio n. 1
0
 def getFromJobId(cls, jobId):
     """
     create a JobFacade to access an existing job.
     @param jobId: the job identifier
     @type jobId: string
     @return: the appropriate job facade
     @rtype: JobFacade
     """
     jobState = JobState(jobId)
     jfargs = {'jobId': jobState.getID(),'programUrl':None,'workflowUrl':None}
     if jobState.isWorkflow():
         jfargs['workflowUrl'] = jobState.getName()
     else:
         jfargs['programUrl']= jobState.getName()
     # this id is identical to the one in parameter, 
     # except it has been normalized (may have removed
     # trailing index.xml from the id)
     if jobState.isLocal():
         return(LocalJobFacade(**jfargs))
     else:
         return(RemoteJobFacade(**jfargs))