Exemplo n.º 1
0
    def validate_rule(self, identifier):
        """Validates the rule for the current
        transition"""
        transitions = transition_config(
            self.module_label, self.task.activity_ref)

        return transitions[identifier](self)
Exemplo n.º 2
0
    def validate_rule(self, identifier):
        """Validates the rule for the current
        transition"""
        transitions = transition_config(
            self.module_label, self.task.activity_ref)

        return transitions[identifier](self)
Exemplo n.º 3
0
    def next_activity(self):
        """Compute the next possible activities"""
        transitions = transition_config(
            self.module_label, self.task.activity_ref)

        return [transition for transition in
                transitions if transitions[transition](
                    self)] if transitions else None
Exemplo n.º 4
0
    def next_activity(self):
        """Compute the next possible activities"""
        transitions = transition_config(
            self.module_label, self.task.activity_ref)

        return [transition for transition in
                transitions if transitions[transition](
                    self)] if transitions else None
Exemplo n.º 5
0
    def submit(self, module, user, next_activity=None):
        """Submits the task"""
        config = flow_config(module)
        transitions = transition_config(module, self.activity_ref)
        role = Group.objects.get(name=config.FLOW[next_activity]['role'])

        self.status = 'Completed'
        self.save()

        if transitions is not None:
            Task.objects.create(request=self.request,
                                assignee=role,
                                updated_by=user,
                                activity_ref=next_activity,
                                status='Not Started')
        else:
            self.request.status = 'Completed'
            self.request.save()
Exemplo n.º 6
0
    def submit(self, module, user, next_activity=None):
        """Submits the task"""
        config = flow_config(module)
        transitions = transition_config(module, self.activity_ref)
        role = Group.objects.get(
            name=config.FLOW[next_activity]['role'])

        self.status = 'Completed'
        self.save()

        if transitions is not None:
            Task.objects.create(
                request=self.request,
                assignee=role,
                updated_by=user,
                activity_ref=next_activity,
                status='Not Started')
        else:
            self.request.status = 'Completed'
            self.request.save()
Exemplo n.º 7
0
    def is_final(self):
        """Checks if the current task is final / end task"""
        transitions = transition_config(
            self.request.module_ref, self.activity_ref)

        return not transitions
Exemplo n.º 8
0
    def is_final(self):
        """Checks if the current task is final / end task"""
        transitions = transition_config(
            self.request.module_ref, self.activity_ref)

        return not transitions