File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -31,17 +31,19 @@ def get_template_names(self):
3131
3232class StartWorkflowMixin :
3333 """
34- Use this mixin to create a start workflow with a view. Example:
34+ View- mixin to create a start workflow.
3535
36- class MyStartWorkflowView(StartWorkflowMixin, TaskViewMixin, View):
37- def post(self, request, *args, **kwargs):
38- try:
39- data = json.loads(request.body)
40- workflow_id = self.start_workflow(data)
41- except Exception as e:
42- return HttpResponseBadRequest("Failed to start workflow")
36+ Example:
4337
44- return JsonResponse({'message': 'Workflow started successfully.', 'id': workflow_id}, status=201)
38+ class MyStartWorkflowView(StartWorkflowMixin, TaskViewMixin, View):
39+ def post(self, request, *args, **kwargs):
40+ try:
41+ data = json.loads(request.body)
42+ workflow_id = self.start_workflow(data)
43+ except Exception as e:
44+ return HttpResponseBadRequest("Failed to start workflow")
45+
46+ return JsonResponse({'message': 'Workflow started successfully.', 'id': workflow_id}, status=201)
4547 """
4648
4749
You can’t perform that action at this time.
0 commit comments