I have a standar viewflow flow process, in one of the states id want to split my proccess based on the text value that is introduced in one of the fields. I have defined my field of interest this way in models.py
estado_de_aprobacion= models.CharField(max_length=15, choices=REVIEW_CHOICES)
my choices:
REVIEW_CHOICES = (
('APROBACION_FINAL', 'Aprobar definitivamente'),
('APROBACION_NUEVO_REVISOR', 'Enviar a otro revisor'),
('DEVOLVER_EJECUTOR','Devolver al ejecutor')
)
so basically what happens is that a drop list is displayed so the user can choose one of the options, and based on that I appliy the followinf split in the flow:
split =(
#If(lambda activation: activation.process.aprobacion_final)
flow.Switch()
.Case(this.end, cond=((lambda act: act.process.estado_de_aprobacion)=='APROBACION_FINAL'))
.Case(this.revisor_check, cond=((lambda act: act.process.estado_de_aprobacion)=='APROBACION_NUEVO_REVISOR'))
.Case(this.ejecutar, cond=((lambda act: act.process.estado_de_aprobacion)=='DEVOLVER_EJECUTOR'))
)
I assume that the lamba expression returns the value contained in the specified proccess atributes but since the comparisson isn't working im thinking its wrong.