def mapfind(self, obj, prefix): result = self.objectToName.get(obj, None) if result is not None: return result if isinstance(obj, ProcedureValue) \ and obj == self.procedureInstance.procedure(): result = "t%s" % self.baseId elif isinstance(obj, DoTaskExpr): for event in self.executedSubevents: if isinstance(event, DoEvent) \ and event.taskexpr()[0] == obj[0]: # was obj.actexpr result = "%s%s" % (prefix, objectId(event)) elif isinstance(obj, DoEvent): result = "%s%s" % (prefix, objectId(obj)) if result is None: result = "%s%s-%s" % (prefix, self.baseId, self.getNewId()) self.objectToName[obj] = result return result
def mapfind(self, obj, prefix): result = self.objectToName.get(obj, None) if result is not None: return result if isinstance(obj, ProcedureValue) \ and obj == self.procedureInstance.procedure(): result = "t%s" % self.baseId elif isinstance(obj, DoTaskExpr): for event in self.executedSubevents: if isinstance(event, DoEvent) \ and event.taskexpr()[0] == obj[0]: # was obj.actexpr result = "%s%s" % (prefix, objectId(event)) elif isinstance(obj, DoEvent): result = "%s%s" % (prefix, objectId(obj)) if result is None: result = "%s%s-%s" % (prefix, self.baseId, self.getNewId()) self.objectToName[obj] = result return result
def __init__(self, procedureInstance, commonMap): self.commonMap = commonMap self.procedureInstance = procedureInstance self.objectToName = {} #self.nameToObject = {} self.counter = 0 self.executedSubevents = [] self.addExecutedSubevents(procedureInstance) # Because KM does not distinguish between a procedure instance # and a task instance, we must identify the procedure instance # with the task it achieves. self.baseId = objectId(self.procedureInstance.event())
def __init__(self, procedureInstance, commonMap): self.commonMap = commonMap self.procedureInstance = procedureInstance self.objectToName = {} #self.nameToObject = {} self.counter = 0 self.executedSubevents = [] self.addExecutedSubevents(procedureInstance) # Because KM does not distinguish between a procedure instance # and a task instance, we must identify the procedure instance # with the task it achieves. self.baseId = objectId(self.procedureInstance.event())