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