django-logic icon indicating copy to clipboard operation
django-logic copied to clipboard

Draw method enhancements

Open emil-balashov opened this issue 5 years ago • 4 comments

  • [x] support in progress states
  • [ ] highlight begin
  • [x] fix bug with process name
  • [ ] fix bug which duplicated condition on the graph, e.g. has_no_sales_invoices duplicated.
  • [ ] cover by tests
class InvoiceProcess(Process):
    transitions = [
        Transition(action_name='approve',
                   sources=[states.draft],
                   target=states.approved),
        Transition(action_name='void',
                   sources=[states.draft, states.approved],
                   target=states.void,
                   conditions=[has_no_sales_invoices],
                   ),
    ]
Screenshot 2019-12-09 at 10 28 13 PM

emil-balashov avatar Dec 09 '19 14:12 emil-balashov

@emil-balashov , Would mind sharing the command you used to come up with the graphical presentation above.

Thanks

huxaiphaer avatar Apr 29 '21 13:04 huxaiphaer

@huxaiphaer

Sure. That's actually available in the Readme file by this link.

Here is an example for a quick reference

from django_logic.display import * 
from demo.process import LockerProcess
display_process(LockerProcess, state='open', skip_main_process=True)

emil-balashov avatar Apr 29 '21 13:04 emil-balashov

@emil-balashov Well, I thought it could a be command ran in the terminal, does that mean I need to do it myself ? I configure it using that code ?

huxaiphaer avatar Apr 29 '21 13:04 huxaiphaer

@huxaiphaer yes, at this moment you need to write a script by yourself if you want to run it in the terminal.

emil-balashov avatar Apr 29 '21 14:04 emil-balashov