# Path: django_workflow/workflow.py
# def get_workflow(name):
# def get_available_transitions(workflow_name, user, object_id):
# def get_object_state(workflow_name: str, object_id: str) -> State:
# def execute_transition(workflow_name, transition_name, user, object_id, execute_async=False):
# def is_transition_available(workflow_name, transition_name, user, object_id):
# def is_object_in_workflow(workflow_name, object_id):
# def export_workflow(workflow_name):
# def import_workflow(data):
# def execute_automatic_transitions(workflow_name=None, object_state_id=None, object_id=None):


from django.core.management import BaseCommand
from django_workflow import workflow


__author__ = 'Daniele Bernardini'


class Command(BaseCommand):
    help = 'trigger automatic transitions in django_workflow'

    def handle(self, *args, **options):
        workflow_name = None
        if len(args) > 0:
            workflow_name = args[0]

# Path: django_workflow/workflow.py
# def get_workflow(name):
# def get_available_transitions(workflow_name, user, object_id):
# def get_object_state(workflow_name: str, object_id: str) -> State:
# def execute_transition(workflow_name, transition_name, user, object_id, execute_async=False):
# def is_transition_available(workflow_name, transition_name, user, object_id):
# def is_object_in_workflow(workflow_name, object_id):
# def export_workflow(workflow_name):
# def import_workflow(data):
# def execute_automatic_transitions(workflow_name=None, object_state_id=None, object_id=None):


# Path: django_workflow/management/commands/autotransitions.py
from django.core.management import BaseCommand
from django_workflow import workflow



__author__ = 'Daniele Bernardini'


class Command(BaseCommand):
    help = 'trigger automatic transitions in django_workflow'

    def handle(self, *args, **options):
        workflow_name = None
        if len(args) > 0:
            workflow_name = args[0]

        workflow.execute_automatic_transitions(workflow_name=workflow_name)