Skip to content

Commit

Permalink
Merge branch 'release/0.8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
alirizakeles committed Nov 14, 2017
2 parents 3cbea68 + c6ed016 commit f5f7998
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 8 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.8.1
v0.8.2
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='zengine',
version='0.8.1',
version='0.8.2',
url='https://github.com/zetaops/zengine',
license='GPL v3',
packages=find_packages(exclude=['tests', 'tests.*']),
Expand All @@ -13,7 +13,7 @@
'permissions and extensible CRUD features',
install_requires=['beaker', 'passlib', 'falcon', 'beaker_extensions', 'lazy_object_proxy',
'redis', 'enum34', 'werkzeug', 'celery', 'SpiffWorkflow', 'pyoko',
'tornado', 'pika==0.10.0', 'babel'],
'tornado', 'pika==0.10.0', 'babel', 'futures',],
dependency_links=[
'git+https://github.com/didip/beaker_extensions.git#egg=beaker_extensions',
'git+https://github.com/zetaops/SpiffWorkflow.git#egg=SpiffWorkflow',
Expand Down
56 changes: 56 additions & 0 deletions zengine/diagrams/not_found.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.5.1">
<bpmn:collaboration id="Collaboration_1ci5b49">
<bpmn:participant id="NotFound" name="Not Found" processRef="not_found" />
</bpmn:collaboration>
<bpmn:process id="not_found" isExecutable="false">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_050y5fr</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="SequenceFlow_050y5fr" sourceRef="StartEvent_1" targetRef="not_found" />
<bpmn:userTask id="not_found" name="Not Found" camunda:assignee="not_found.NotFound.show_not_found">
<bpmn:incoming>SequenceFlow_050y5fr</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0329pju</bpmn:outgoing>
</bpmn:userTask>
<bpmn:endEvent id="EndEvent_1l2l4fn">
<bpmn:incoming>SequenceFlow_0329pju</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_0329pju" sourceRef="not_found" targetRef="EndEvent_1l2l4fn" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1ci5b49">
<bpmndi:BPMNShape id="Participant_0cjkxh2_di" bpmnElement="NotFound">
<dc:Bounds x="123" y="82" width="600" height="250" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="191" y="186" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="209" y="222" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_050y5fr_di" bpmnElement="SequenceFlow_050y5fr">
<di:waypoint xsi:type="dc:Point" x="227" y="204" />
<di:waypoint xsi:type="dc:Point" x="301" y="204" />
<bpmndi:BPMNLabel>
<dc:Bounds x="264" y="189" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1ktjgln_di" bpmnElement="not_found">
<dc:Bounds x="301" y="164" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1l2l4fn_di" bpmnElement="EndEvent_1l2l4fn">
<dc:Bounds x="451" y="186" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="469" y="222" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0329pju_di" bpmnElement="SequenceFlow_0329pju">
<di:waypoint xsi:type="dc:Point" x="401" y="204" />
<di:waypoint xsi:type="dc:Point" x="451" y="204" />
<bpmndi:BPMNLabel>
<dc:Bounds x="426" y="179" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
9 changes: 7 additions & 2 deletions zengine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from zengine.lib.exceptions import HTTPError
from zengine.lib import translation
from zengine.log import log
from zengine.models import BPMNWorkflow
from zengine.models import BPMNWorkflow, ObjectDoesNotExist
from zengine.models.workflow_manager import TaskInvitation, WFCache


Expand Down Expand Up @@ -205,7 +205,12 @@ def get_worfklow_spec(self):
# spec_package = InMemoryPackager.package_in_memory(self.current.workflow_name, path)
# spec = BpmnSerializer().deserialize_workflow_spec(spec_package)

self.current.wf_object = BPMNWorkflow.objects.get(name=self.current.workflow_name)
try:
self.current.wf_object = BPMNWorkflow.objects.get(name=self.current.workflow_name)
except ObjectDoesNotExist:
self.current.wf_object = BPMNWorkflow.objects.get(name='not_found')
self.current.task_data['non-existent-wf'] = self.current.workflow_name
self.current.workflow_name = 'not_found'
xml_content = self.current.wf_object.xml.body
spec = ZopsSerializer().deserialize_workflow_spec(xml_content, self.current.workflow_name)

Expand Down
2 changes: 1 addition & 1 deletion zengine/models/workflow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def get_roles(self):
if self.abstract_role.exist and roles:
# apply abstract_role filtering on roles we got
if isinstance(roles, (list, types.GeneratorType)):
roles = [a for a in roles if a.abstract_role == self.abstract_role]
roles = [a for a in roles if a.abstract_role.key == self.abstract_role.key]
else:
roles = roles.filter(abstract_role=self.abstract_role)
else:
Expand Down
2 changes: 1 addition & 1 deletion zengine/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
DEFAULT_CACHE_EXPIRE_TIME = 99999999

#: Workflows that dosen't require logged in user.
ANONYMOUS_WORKFLOWS = ['login', 'reset_cache']
ANONYMOUS_WORKFLOWS = ['login', 'reset_cache', 'not_found', ]

#: Workflows which are available for all authenticated users.
COMMON_WORKFLOWS = ['role_switching']
Expand Down
3 changes: 2 additions & 1 deletion zengine/views/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,8 @@ def show(self):
if d['type'] == 'file' and d['value'] and d['value'][-3:] in ('jpg', 'png'):
continue # passing for now, needs client support

obj_data[key] = six.text_type(val) if val is not None else val
if not d['kwargs'].get('hidden', False):
obj_data[key] = six.text_type(val) if val is not None else val
self.output['object_title'] = "%s : %s" % (self.model_class.Meta.verbose_name, self.object)
self.output['object_key'] = self.object.key
self.output['object'] = obj_data
Expand Down
15 changes: 15 additions & 0 deletions zengine/views/not_found.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.

from zengine.lib.utils import gettext as _, gettext_lazy as __
from zengine.views.crud import CrudView


class NotFound(CrudView):
def show_not_found(self):
msg = _(u"Workflow %s is not found. It can be non existent or not ready "
u"yet.") % self.current.task_data.get('non-existent-wf')
self.current.msg_box(msg=msg, title=__(u"Not Found"))

0 comments on commit f5f7998

Please sign in to comment.