Example #1
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         eg1=ExclusiveGatewayDefinition(),
         pg1=ParallelGatewayDefinition(),
         eg2=ExclusiveGatewayDefinition(),
         correct=ActivityDefinition(contexts=[CorrectProposal],
                                    description=_("Improve the proposal"),
                                    title=_("Improve"),
                                    groups=[]),
         correctitem=ActivityDefinition(contexts=[CorrectItem],
                                        description=_("Correct item"),
                                        title=_("Correct"),
                                        groups=[]),
         close_work=ActivityDefinition(contexts=[CloseWork],
                                       description=_("Close the work"),
                                       title=_("Close the work"),
                                       groups=[]),
         timer=IntermediateCatchEventDefinition(
             TimerEventDefinition(
                 time_date=calculate_improvement_cycle_date)),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg1'),
         TransitionDefinition('pg1', 'correct'),
         TransitionDefinition('pg1', 'correctitem'),
         TransitionDefinition('pg1', 'timer'),
         TransitionDefinition('timer', 'close_work'),
         TransitionDefinition('close_work', 'end'),
     )
Example #2
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         #First loop
         pgblock1=ParallelGatewayDefinition(),
         pgblock1sync=ParallelGatewayDefinition(),
         egblock1=ExclusiveGatewayDefinition(),
         archiveculturalevent=ActivityDefinition(
             contexts=[ArchiveCulturalEvent],
             description=_("Archive cultural events"),
             title=_("Archive cultural events"),
             groups=[]),
         send_newsletters=ActivityDefinition(
             contexts=[SendNewsletters],
             description=_("Send newsletters"),
             title=_("Send newsletters"),
             groups=[]),
         alert_users=ActivityDefinition(contexts=[AlertUsers],
                                        description=_("Alert users"),
                                        title=_("Alert users"),
                                        groups=[]),
         timerblock1=IntermediateCatchEventDefinition(
             TimerEventDefinition(time_date=calculate_next_date_block1)),
         #Second loop
         pgblock2=ParallelGatewayDefinition(),
         pgblock2sync=ParallelGatewayDefinition(),
         egblock2=ExclusiveGatewayDefinition(),
         synchronizepublishsettings=ActivityDefinition(
             contexts=[SynchronizePublishSettings],
             description=_("Synchronize publish settings"),
             title=_("Synchronize publish settings"),
             groups=[]),
         timerblock2=IntermediateCatchEventDefinition(
             TimerEventDefinition(time_date=calculate_next_date_block2)),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         #First loop
         TransitionDefinition('pg', 'egblock1'),
         TransitionDefinition('egblock1', 'pgblock1'),
         TransitionDefinition('pgblock1', 'archiveculturalevent'),
         TransitionDefinition('archiveculturalevent', 'pgblock1sync'),
         TransitionDefinition('pgblock1', 'send_newsletters'),
         TransitionDefinition('send_newsletters', 'pgblock1sync'),
         TransitionDefinition('pgblock1', 'alert_users'),
         TransitionDefinition('alert_users', 'pgblock1sync'),
         TransitionDefinition('pgblock1sync', 'timerblock1'),
         TransitionDefinition('timerblock1', 'egblock1'),
         #Second loop
         TransitionDefinition('pg', 'egblock2'),
         TransitionDefinition('egblock2', 'pgblock2'),
         TransitionDefinition('pgblock2', 'synchronizepublishsettings'),
         TransitionDefinition('synchronizepublishsettings', 'pgblock2sync'),
         TransitionDefinition('pgblock2sync', 'timerblock2'),
         TransitionDefinition('timerblock2', 'egblock2'),
     )
Example #3
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         eg=ExclusiveGatewayDefinition(),
         eg1=ExclusiveGatewayDefinition(),
         eg2=ExclusiveGatewayDefinition(),
         pg=ParallelGatewayDefinition(),
         votingpublication=SubProcessDefinition(
             pd='ballotprocess',
             contexts=[VotingPublication],
             description=_("Start voting for publication"),
             title=_("Start voting for publication"),
             groups=[]),
         timer_alert=IntermediateCatchEventDefinition(
             TimerEventDefinition(time_date=alert_end_cycle_duration)),
         alert_end=ActivityDefinition(
             contexts=[AlertEnd],
             description=_("Alert for the end of an improvement cycle"),
             title=_("Alert for the end of an improvement cycle"),
             groups=[]),
         work=WorkSubProcessDefinition(pd='None',
                                       contexts=[Work],
                                       description=_("Start work"),
                                       title=_("Start work"),
                                       groups=[]),
         submit=ActivityDefinition(
             contexts=[SubmitProposal],
             description=_("Submit the proposal as is"),
             title=_("Submit"),
             groups=[]),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'eg'),
         TransitionDefinition('eg', 'votingpublication', sync=True),
         TransitionDefinition('votingpublication', 'eg1'),
         TransitionDefinition('eg1', 'pg', amendable_condition, sync=True),
         TransitionDefinition('pg', 'eg2'),
         TransitionDefinition('eg2', 'timer_alert'),
         TransitionDefinition('timer_alert', 'alert_end'),
         TransitionDefinition('alert_end',
                              'eg2',
                              has_alert_condition,
                              sync=True),
         TransitionDefinition('pg', 'work'),
         TransitionDefinition('eg1', 'submit', publish_condition,
                              sync=True),
         TransitionDefinition('submit', 'end'),
         TransitionDefinition('work', 'eg'),
     )
Example #4
0
    def _process_valid_actions(self):
        """
        S: start event
        E: end event
        G1,3(x): XOR Gateway
        P2,4(+): Parallel Gateway
        X, Y, Z: activities
                                       -----
                                    -->| X |------------\
                                   /   -----             \
    -----   ---------   --------- /                       \   ---------   -----
    | S |-->| G1(x) |-->| P2(+) |-                         -->| P4(+) |-->| E |
    -----   --------- \ --------- \    ---------   -----   /  ---------   -----
                       \           \-->| G3(x) |-->| Y |--/
                        \              /--------   -----
                         \    -----   /
                          \-->| Z |--/
                              -----
        """
        pd = ProcessDefinition(**{'id':u'sample'})
        self.app['sample'] = pd
        y = ActivityDefinition()
        pd.defineNodes(
                s = StartEventDefinition(),
                x = ActivityDefinition(contexts=[ActionX]),
                y = y,
                z = ActivityDefinition(contexts=[ActionZ]),
                g1 = ExclusiveGatewayDefinition(),
                g2 = ParallelGatewayDefinition(),
                g3 = ExclusiveGatewayDefinition(),
                g4 = ParallelGatewayDefinition(),
                e = EndEventDefinition(),
        )
        pd.defineTransitions(
                TransitionDefinition('s', 'g1'),
                TransitionDefinition('g1', 'g2'),
                TransitionDefinition('g1', 'z'),
                TransitionDefinition('g2', 'x'),
                TransitionDefinition('g2', 'g3'),
                TransitionDefinition('z', 'g3'),
                TransitionDefinition('g3', 'y'),
                TransitionDefinition('y', 'g4'),
                TransitionDefinition('x', 'g4'),
                TransitionDefinition('g4', 'e'),
        )

        self.config.scan(example)
        return y, pd
Example #5
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         edit=ActivityDefinition(contexts=[EditCulturalEvent],
                                 description=_("Edit the cultural event"),
                                 title=_("Edit"),
                                 groups=[]),
         reject=ActivityDefinition(
             contexts=[RejectCulturalEvent],
             description=_("Reject the cultural event"),
             title=_("Reject"),
             groups=[]),
         publish=ActivityDefinition(
             contexts=[PublishCulturalEvent],
             description=_("Publish the cultural event"),
             title=_("Publish"),
             groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'reject'),
         TransitionDefinition('reject', 'eg'),
         TransitionDefinition('pg', 'publish'),
         TransitionDefinition('publish', 'eg'),
         TransitionDefinition('pg', 'edit'),
         TransitionDefinition('edit', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #6
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         see_service=ActivityDefinition(contexts=[SeeServiceDefinition],
                                        description=_("Details"),
                                        title=_("Details"),
                                        groups=[]),
         edit=ActivityDefinition(
             contexts=[EditServiceDefinition],
             description=_("Edit the service definition"),
             title=_("Edit"),
             groups=[]),
         sees=ActivityDefinition(contexts=[SeeServicesDefinition],
                                 description=_("See definitions"),
                                 title=_("Service definitions"),
                                 groups=[_('See')]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'edit'),
         TransitionDefinition('edit', 'eg'),
         TransitionDefinition('pg', 'see_service'),
         TransitionDefinition('see_service', 'eg'),
         TransitionDefinition('pg', 'sees'),
         TransitionDefinition('sees', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #7
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         eg=ExclusiveGatewayDefinition(),
         pg=ParallelGatewayDefinition(),
         see=ActivityDefinition(contexts=[SeeWorkspace],
                                description=_("Workspace"),
                                title=_("Workspace"),
                                groups=[]),
         remove_file=ActivityDefinition(contexts=[RemoveFile],
                                        description=_("Remove the file"),
                                        title=_("Remove"),
                                        groups=[]),
         add_files=ActivityDefinition(contexts=[AddFiles],
                                      description=_("Add files"),
                                      title=_("Add files"),
                                      groups=[]),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'see'),
         TransitionDefinition('pg', 'remove_file'),
         TransitionDefinition('pg', 'add_files'),
         TransitionDefinition('see', 'eg'),
         TransitionDefinition('remove_file', 'eg'),
         TransitionDefinition('add_files', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #8
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         creat=ActivityDefinition(contexts=[CreateFile],
                                  description=_("Create a file"),
                                  title=_("Create a file"),
                                  groups=[_('Add')]),
         editfile=ActivityDefinition(contexts=[EditFile],
                                     description=_("Edit the file"),
                                     title=_("Edit"),
                                     groups=[]),
         seefile=ActivityDefinition(contexts=[SeeFile],
                                    description=_("Details"),
                                    title=_("Details"),
                                    groups=[]),
         seefiles=ActivityDefinition(contexts=[SeeFiles],
                                     description=_("Files"),
                                     title=_("Files"),
                                     groups=[_('See')]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'creat'),
         TransitionDefinition('creat', 'eg'),
         TransitionDefinition('pg', 'seefile'),
         TransitionDefinition('seefile', 'eg'),
         TransitionDefinition('pg', 'editfile'),
         TransitionDefinition('editfile', 'eg'),
         TransitionDefinition('pg', 'seefiles'),
         TransitionDefinition('seefiles', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #9
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         subscribe=ActivityDefinition(
             contexts=[Subscribe],
             description=_("Subscribe to the discussion"),
             title=_("Subscribe"),
             groups=[]),
         unsubscribe=ActivityDefinition(
             contexts=[Unsubscribe],
             description=_("Unsubscribe from the discussion"),
             title=_("Unsubscribe", context="channel"),
             groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'subscribe'),
         TransitionDefinition('subscribe', 'eg'),
         TransitionDefinition('pg', 'unsubscribe'),
         TransitionDefinition('unsubscribe', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #10
0
 def _init_definition(self):
     self.defineNodes(
             start = StartEventDefinition(),
             pg = ParallelGatewayDefinition(),
             respond = ActivityDefinition(contexts=[Respond],
                                    description=_("Answer"),
                                    title=_("Answer"),
                                    groups=[]),
             edit = ActivityDefinition(contexts=[Edit],
                                    description=_("Edit"),
                                    title=_("Edit"),
                                    groups=[]),
             remove = ActivityDefinition(contexts=[Remove],
                                    description=_("Remove"),
                                    title=_("Remove"),
                                    groups=[]),
             pin = ActivityDefinition(contexts=[Pin],
                                    description=_("Pin"),
                                    title=_("Pin"),
                                    groups=[]),
             unpin = ActivityDefinition(contexts=[Unpin],
                                    description=_("Unpin"),
                                    title=_("Unpin"),
                                    groups=[]),
             transformtoidea = ActivityDefinition(contexts=[TransformToIdea],
                                    description=_("Transform the comment into an idea"),
                                    title=_("Transform into an idea"),
                                    groups=[]),
             transformtoquestion = ActivityDefinition(contexts=[TransformToQuestion],
                                    description=_("Transform the comment into a question"),
                                    title=_("Transform into a question"),
                                    groups=[]),
             see = ActivityDefinition(contexts=[SeeComment],
                                    description=_("Details"),
                                    title=_("Details"),
                                    groups=[]),
             eg = ExclusiveGatewayDefinition(),
             end = EndEventDefinition(),
     )
     self.defineTransitions(
             TransitionDefinition('start', 'pg'),
             TransitionDefinition('pg', 'respond'),
             TransitionDefinition('respond', 'eg'),
             TransitionDefinition('pg', 'transformtoidea'),
             TransitionDefinition('transformtoidea', 'eg'),
             TransitionDefinition('pg', 'transformtoquestion'),
             TransitionDefinition('transformtoquestion', 'eg'),
             TransitionDefinition('pg', 'edit'),
             TransitionDefinition('edit', 'eg'),
             TransitionDefinition('pg', 'remove'),
             TransitionDefinition('remove', 'eg'),
             TransitionDefinition('pg', 'pin'),
             TransitionDefinition('pin', 'eg'),
             TransitionDefinition('pg', 'unpin'),
             TransitionDefinition('unpin', 'eg'),
             TransitionDefinition('pg', 'see'),
             TransitionDefinition('see', 'eg'),
             TransitionDefinition('eg', 'end'),
     )
Example #11
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         creat=ActivityDefinition(contexts=[CreateFilmSynopses],
                                  description=_("Create a film synopsis"),
                                  title=_("Create a film synopsis"),
                                  groups=[_('Add')]),
         edit=ActivityDefinition(contexts=[EditFilmSynopses],
                                 description=_("Edit the film synopsis"),
                                 title=_("Edit"),
                                 groups=[]),
         see=ActivityDefinition(contexts=[SeeFilmSynopses],
                                description=_("Details"),
                                title=_("Details"),
                                groups=[]),
         put_on_hold=ActivityDefinition(
             contexts=[PutOnHoldFilmSynopses],
             description=_("Put on hold the film synopsis"),
             title=_("Put on hold"),
             groups=[]),
         publish=ActivityDefinition(
             contexts=[PublishFilmSynopses],
             description=_("Publish the film synopsis"),
             title=_("Publish"),
             groups=[]),
         archive=ActivityDefinition(
             contexts=[ArchiveFilmSynopses],
             description=_("Archive the film synopsis"),
             title=_("Archive"),
             groups=[]),
         remove=ActivityDefinition(
             contexts=[RemoveFilmSynopses],
             description=_("Remove the film synopsis"),
             title=_("Remove"),
             groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'creat'),
         TransitionDefinition('creat', 'eg'),
         TransitionDefinition('pg', 'see'),
         TransitionDefinition('see', 'eg'),
         TransitionDefinition('pg', 'edit'),
         TransitionDefinition('edit', 'eg'),
         TransitionDefinition('pg', 'put_on_hold'),
         TransitionDefinition('put_on_hold', 'eg'),
         TransitionDefinition('pg', 'publish'),
         TransitionDefinition('publish', 'eg'),
         TransitionDefinition('pg', 'archive'),
         TransitionDefinition('archive', 'eg'),
         TransitionDefinition('pg', 'remove'),
         TransitionDefinition('remove', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #12
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         creat=ActivityDefinition(contexts=[CreateWebAdvertising],
                                  description=_("Create an announcement"),
                                  title=_("Create an announcement"),
                                  groups=[_('Add')]),
         edit=ActivityDefinition(contexts=[EditWebAdvertising],
                                 description=_("Edit the announcement"),
                                 title=_("Edit the announcement"),
                                 groups=[]),
         see=ActivityDefinition(contexts=[SeeWebAdvertising],
                                description=_("Details"),
                                title=_("Details"),
                                groups=[]),
         see_all=ActivityDefinition(contexts=[SeeAdvertisings],
                                    description=_("See announcements"),
                                    title=_("The announcements"),
                                    groups=[_('See')]),
         publish=ActivityDefinition(
             contexts=[PublishAdvertising],
             description=_("Publish the announcement"),
             title=_("Publish"),
             groups=[]),
         archive=ActivityDefinition(
             contexts=[ArchiveAdvertising],
             description=_("Archive the announcement"),
             title=_("Archive"),
             groups=[]),
         remove=ActivityDefinition(contexts=[RemoveAdvertising],
                                   description=_("Remove the announcement"),
                                   title=_("Remove"),
                                   groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'creat'),
         TransitionDefinition('creat', 'eg'),
         TransitionDefinition('pg', 'see'),
         TransitionDefinition('see', 'eg'),
         TransitionDefinition('pg', 'see_all'),
         TransitionDefinition('see_all', 'eg'),
         TransitionDefinition('pg', 'edit'),
         TransitionDefinition('edit', 'eg'),
         TransitionDefinition('pg', 'publish'),
         TransitionDefinition('publish', 'eg'),
         TransitionDefinition('pg', 'archive'),
         TransitionDefinition('archive', 'eg'),
         TransitionDefinition('pg', 'remove'),
         TransitionDefinition('remove', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #13
0
 def _init_definition(self):
     self.defineNodes(
             start = StartEventDefinition(),
             eg1 = ExclusiveGatewayDefinition(),
             pg1 = ParallelGatewayDefinition(),
             eg2 = ExclusiveGatewayDefinition(),
             votingamendments = SubProcessDefinitionAmendments(pd='ballotprocess', contexts=[VotingAmendments],
                                    description=_("Start voting on amendments"),
                                    title=_("Start voting on amendments"),
                                    groups=[]),
             alert = ActivityDefinition(contexts=[Alert],
                                    description=_("Alert"),
                                    title=_("Alert"),
                                    groups=[]),
             timer = IntermediateCatchEventDefinition(TimerEventDefinition(time_date=calculate_improvement_cycle_date)),
             amendmentsresult = ActivityDefinition(contexts=[AmendmentsResult],
                                    description=_("Result of the vote on amendments"),
                                    title=_("Result of the vote on amendments"),
                                    groups=[]),
             improve = ActivityDefinition(contexts=[ImproveProposal],
                                    description=_("Improve the proposal"),
                                    title=_("Improve"),
                                    groups=[]),
             improveandexplain = ActivityDefinition(contexts=[ImproveProposalAndExplain],
                                    description=_("Improve and explain"),
                                    title=_("Improve and explain"),
                                    groups=[]),
             end = EndEventDefinition(),
     )
     self.defineTransitions(
             TransitionDefinition('start', 'pg1'),
             TransitionDefinition('pg1', 'improve'),
             TransitionDefinition('pg1', 'improveandexplain'),
             TransitionDefinition('pg1', 'timer'),
             TransitionDefinition('timer', 'eg1'),
             TransitionDefinition('eg1', 'votingamendments', eg4_votingamendments_condition, sync=True),
             TransitionDefinition('eg1', 'alert', eg4_alert_condition, sync=True),
             TransitionDefinition('alert', 'eg2'),
             TransitionDefinition('votingamendments', 'amendmentsresult'),
             TransitionDefinition('amendmentsresult', 'eg2'),
             TransitionDefinition('eg2', 'end'),
     )
Example #14
0
 def _init_definition(self):
     self.defineNodes(
             start = StartEventDefinition(),
             pg = ParallelGatewayDefinition(),
             add = ActivityDefinition(contexts=[AddOrganizations],
                                    description=_("Upload organizations from xl file"),
                                    title=_("Upload organizations"),
                                    groups=[_('More')]),
             remove = ActivityDefinition(contexts=[RemoveOrganization],
                                    description=_("Remove the organization"),
                                    title=_("Remove"),
                                    groups=[]),
             creat = ActivityDefinition(contexts=[CreatOrganizations],
                                    description=_("Creat organizations"),
                                    title=_("Creat organizations"),
                                    groups=[_('More')]),
             edits = ActivityDefinition(contexts=[EditOrganizations],
                                    description=_("Edit organizations"),
                                    title=_("Edit organizations"),
                                    groups=[_('Edit')]),
             sees = ActivityDefinition(contexts=[SeeOrganizations],
                                    description=_("See organizations"),
                                    title=_("Organizations"),
                                    groups=[_('See')]),
             edit = ActivityDefinition(contexts=[EditOrganization],
                                    description=_("Edit organization"),
                                    title=_("Edit organizations"),
                                    groups=[_('Edit')]),
             see = ActivityDefinition(contexts=[SeeOrganization],
                                    description=_("See organization"),
                                    title=_("Details"),
                                    groups=[]),
             eg = ExclusiveGatewayDefinition(),
             end = EndEventDefinition(),
     )
     self.defineTransitions(
             TransitionDefinition('start', 'pg'),
             TransitionDefinition('pg', 'add'),
             TransitionDefinition('pg', 'creat'),
             TransitionDefinition('pg', 'see'),
             TransitionDefinition('pg', 'edit'),
             TransitionDefinition('add', 'eg'),
             TransitionDefinition('pg', 'edits'),
             TransitionDefinition('edits', 'eg'),
             TransitionDefinition('pg', 'sees'),
             TransitionDefinition('sees', 'eg'),
             TransitionDefinition('creat', 'eg'),
             TransitionDefinition('edit', 'eg'),
             TransitionDefinition('see', 'eg'),
             TransitionDefinition('pg', 'remove'),
             TransitionDefinition('remove', 'eg'),
             TransitionDefinition('eg', 'end'),
     )
Example #15
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         add_group=ActivityDefinition(contexts=[AddGroup],
                                      description=_("Add a group"),
                                      title=_("Add a group"),
                                      groups=[_('More')]),
         remove_group=ActivityDefinition(contexts=[RemoveGroup],
                                         description=_("Remove the group"),
                                         title=_("Remove"),
                                         groups=[]),
         edit_group=ActivityDefinition(contexts=[EditGroup],
                                       description=_("Edit the group"),
                                       title=_("Edit the group"),
                                       groups=[]),
         manage_groups=ActivityDefinition(contexts=[ManageGroup],
                                          description=_("Manage groups"),
                                          title=_("Manage groups"),
                                          groups=[]),
         see_group=ActivityDefinition(contexts=[SeeGroup],
                                      description=_("Details"),
                                      title=_("Details"),
                                      groups=[]),
         private_group=ActivityDefinition(contexts=[PrivateGroup],
                                          description=_("Private"),
                                          title=_("Private"),
                                          groups=[]),
         publish_group=ActivityDefinition(contexts=[PublishGroup],
                                          description=_("Publish"),
                                          title=_("Publish"),
                                          groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'see_group'),
         TransitionDefinition('see_group', 'eg'),
         TransitionDefinition('pg', 'add_group'),
         TransitionDefinition('pg', 'remove_group'),
         TransitionDefinition('pg', 'edit_group'),
         TransitionDefinition('add_group', 'eg'),
         TransitionDefinition('edit_group', 'eg'),
         TransitionDefinition('remove_group', 'eg'),
         TransitionDefinition('pg', 'manage_groups'),
         TransitionDefinition('manage_groups', 'eg'),
         TransitionDefinition('pg', 'private_group'),
         TransitionDefinition('pg', 'publish_group'),
         TransitionDefinition('private_group', 'eg'),
         TransitionDefinition('publish_group', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #16
0
    def _process_cycle(self):
        """
        S: start event
        E: end event
        G0, 1, (x): XOR Gateway
        P,0(+): Parallel Gateway
        A, B, C, D: activities

          |---------------------------|
          |                           |
          |                           |
-----  ---V---    ------  ------    --|-----    -----   ----
| S |->| G0(x)|-->| A |-->|  B  |-->| G1(x) |-->| C |-->| E |
-----  ------     ------  ------    --------    -----   ----

        """
        pd = ProcessDefinition(**{'id':u'sample'})
        self.app['sample'] = pd
        pd.defineNodes(
                s = StartEventDefinition(),
                a = ActivityDefinition(contexts=[ActionA]),
                b = ActivityDefinition(contexts=[ActionB]),
                c = ActivityDefinition(contexts=[ActionX]),
                g0 = ExclusiveGatewayDefinition(),
                g1 = ExclusiveGatewayDefinition(),
                e = EndEventDefinition(),
        )
        pd.defineTransitions(
                TransitionDefinition('s', 'g0'),
                TransitionDefinition('g0', 'a'),
                TransitionDefinition('a', 'b'),
                TransitionDefinition('b', 'g1'),
                TransitionDefinition('g1', 'g0'),
                TransitionDefinition('g1', 'c'),
                TransitionDefinition('c', 'e'),
        )

        self.config.scan(example)
        return pd
Example #17
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         select=ActivityDefinition(
             contexts=[SelectEntity, SelectEntityAnonymous],
             description=_("Follow"),
             title=_("Follow"),
             groups=[]),
         deselect=ActivityDefinition(contexts=[DeselectEntity],
                                     description=_("Unfollow"),
                                     title=_("Unfollow"),
                                     groups=[]),
         addreaction=ActivityDefinition(contexts=[AddReaction],
                                        description=_("Add reactions"),
                                        title=_("Add a reaction"),
                                        groups=[]),
         updatereaction=ActivityDefinition(
             contexts=[UpdateReaction],
             description=_("Update reactions"),
             title=_("Update the reaction"),
             groups=[]),
         adddeadline=ActivityDefinition(
             contexts=[AddDeadLine],
             description=_("Add the next deadline"),
             title=_("Add the next deadline"),
             groups=[_('Add')]),
         editdeadline=ActivityDefinition(
             contexts=[EditDeadLine],
             description=_("Edit the current deadline"),
             title=_("Edit the current deadline"),
             groups=[_('Edit')]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'select'),
         TransitionDefinition('select', 'eg'),
         TransitionDefinition('pg', 'addreaction'),
         TransitionDefinition('addreaction', 'eg'),
         TransitionDefinition('pg', 'updatereaction'),
         TransitionDefinition('updatereaction', 'eg'),
         TransitionDefinition('pg', 'deselect'),
         TransitionDefinition('deselect', 'eg'),
         TransitionDefinition('pg', 'adddeadline'),
         TransitionDefinition('adddeadline', 'eg'),
         TransitionDefinition('pg', 'editdeadline'),
         TransitionDefinition('editdeadline', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #18
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         registration=ActivityDefinition(contexts=[Registration],
                                         description=_("User registration"),
                                         title=_("User registration"),
                                         groups=[]),
         confirmregistration=ActivityDefinition(contexts=[ConfirmRegistration],
                                                description=_(
                                                    "Confirm registration"),
                                                title=_(
                                                    "Confirm registration"),
                                                groups=[]),
         remind=ActivityDefinition(contexts=[Remind],
                                   description=_("Remind user"),
                                   title=_("Remind"),
                                   groups=[]),
         see_registration=ActivityDefinition(contexts=[SeeRegistration],
                                             description=_("Details"),
                                             title=_("Details"),
                                             groups=[]),
         see_registrations=ActivityDefinition(contexts=[SeeRegistrations],
                                              description=_(
                                                  "See registrations"),
                                              title=_("Registrations"),
                                              groups=[_('See')]),
         remove=ActivityDefinition(contexts=[RemoveRegistration],
                                   description=_("Remove the registration"),
                                   title=_("Remove"),
                                   groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'registration'),
         TransitionDefinition('registration', 'eg'),
         TransitionDefinition('pg', 'confirmregistration'),
         TransitionDefinition('confirmregistration', 'eg'),
         TransitionDefinition('pg', 'remind'),
         TransitionDefinition('remind', 'eg'),
         TransitionDefinition('pg', 'see_registration'),
         TransitionDefinition('see_registration', 'eg'),
         TransitionDefinition('pg', 'see_registrations'),
         TransitionDefinition('see_registrations', 'eg'),
         TransitionDefinition('pg', 'remove'),
         TransitionDefinition('remove', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #19
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         creat=ActivityDefinition(contexts=[CreateBrief],
                                  description=_("Create a news flash"),
                                  title=_("Create a news flash"),
                                  groups=[_('Add')]),
         edit=ActivityDefinition(contexts=[EditBrief],
                                 description=_("Edit the news flash"),
                                 title=_("Edit"),
                                 groups=[]),
         see=ActivityDefinition(contexts=[SeeBrief],
                                description=_("Details"),
                                title=_("Details"),
                                groups=[]),
         publish=ActivityDefinition(contexts=[PublishBrief],
                                    description=_("Publish the news flash"),
                                    title=_("Publish"),
                                    groups=[]),
         archive=ActivityDefinition(contexts=[ArchiveBrief],
                                    description=_("Archive the news flash"),
                                    title=_("Archive"),
                                    groups=[]),
         remove=ActivityDefinition(contexts=[RemoveBrief],
                                   description=_("Remove the news flash"),
                                   title=_("Remove"),
                                   groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'creat'),
         TransitionDefinition('creat', 'eg'),
         TransitionDefinition('pg', 'see'),
         TransitionDefinition('see', 'eg'),
         TransitionDefinition('pg', 'edit'),
         TransitionDefinition('edit', 'eg'),
         TransitionDefinition('pg', 'publish'),
         TransitionDefinition('publish', 'eg'),
         TransitionDefinition('pg', 'archive'),
         TransitionDefinition('archive', 'eg'),
         TransitionDefinition('pg', 'remove'),
         TransitionDefinition('remove', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #20
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         update=ActivityDefinition(contexts=[Update],
                                   description=_("Update processes"),
                                   title=_("Update processes"),
                                   groups=[_('More')]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'update'),
         TransitionDefinition('update', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #21
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         see=ActivityDefinition(contexts=[SeeGame],
                                description=_("Details"),
                                title=_("Details"),
                                groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'see'),
         TransitionDefinition('see', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #22
0
 def _init_definition(self):
     self.defineNodes(
             start = StartEventDefinition(),
             pg = ParallelGatewayDefinition(),
             add_promotions = ActivityDefinition(contexts=[AddPromotions],
                                    description=_("Add promotions"),
                                    title=_("Add promotions"),
                                    groups=[]),
             eg = ExclusiveGatewayDefinition(),
             end = EndEventDefinition(),
     )
     self.defineTransitions(
             TransitionDefinition('start', 'pg'),
             TransitionDefinition('pg', 'add_promotions'),
             TransitionDefinition('add_promotions', 'eg'),
             TransitionDefinition('eg', 'end'),
     )
Example #23
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         #egs = ExclusiveGatewayDefinition(),
         login=ActivityDefinition(contexts=[LogIn],
                                  description=_("Login with Yammer"),
                                  title=_("Login with Yammer"),
                                  groups=[]),
         create=ActivityDefinition(contexts=[CreateConnector],
                                   description=_("Add a Yammer connector"),
                                   title=_("Add a Yammer connector"),
                                   groups=[]),
         configure=ActivityDefinition(
             contexts=[Configure],
             description=_("Configure the Yammer connector"),
             title=_("Configure"),
             groups=[]),
         remove=ActivityDefinition(
             contexts=[Remove],
             description=_("Remove the Yammer connector"),
             title=_("Remove"),
             groups=[]),
         import_messages=ActivityDefinition(
             contexts=[Import],
             description=_("Import messages from Yammer"),
             title=_("Import"),
             groups=[]),
         pg=ParallelGatewayDefinition(),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'login'),
         TransitionDefinition('login', 'eg'),
         TransitionDefinition('pg', 'create'),
         TransitionDefinition('create', 'eg'),
         TransitionDefinition('pg', 'configure'),
         TransitionDefinition('configure', 'eg'),
         TransitionDefinition('pg', 'remove'),
         TransitionDefinition('remove', 'eg'),
         TransitionDefinition('pg', 'import_messages'),
         TransitionDefinition('import_messages', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #24
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         create=ActivityDefinition(
             contexts=[Create],
             description=_("Organize a discussion event"),
             title=_("Organize a discussion event"),
             groups=[]),
         edit=ActivityDefinition(contexts=[Edit],
                                 description=_("Edit the discussion event"),
                                 title=_("Edit"),
                                 groups=[]),
         remove=ActivityDefinition(
             contexts=[Remove],
             description=_("Remove the discussion event"),
             title=_("Remove"),
             groups=[]),
         see_events=ActivityDefinition(
             contexts=[SeeRelatedEvents],
             description=_("The organized discussion events"),
             title=_("The organized discussion events"),
             groups=[]),
         see=ActivityDefinition(contexts=[SeeEvent],
                                description=_("Details"),
                                title=_("Details"),
                                groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'create'),
         TransitionDefinition('create', 'eg'),
         TransitionDefinition('pg', 'edit'),
         TransitionDefinition('edit', 'eg'),
         TransitionDefinition('pg', 'remove'),
         TransitionDefinition('remove', 'eg'),
         TransitionDefinition('pg', 'see_events'),
         TransitionDefinition('see_events', 'eg'),
         TransitionDefinition('pg', 'see'),
         TransitionDefinition('see', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #25
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         timer=IntermediateCatchEventDefinition(
             TimerEventDefinition(time_date=time_date)),
         conditional=IntermediateCatchEventDefinition(
             ConditionalEventDefinition(event_condition)),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'timer'),
         TransitionDefinition('pg', 'conditional'),
         TransitionDefinition('conditional', 'eg'),
         TransitionDefinition('timer', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #26
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         report=ActivityDefinition(contexts=[Report],
                                   description=_("Report the content"),
                                   title=_("Report"),
                                   groups=[]),
         see_reports=ActivityDefinition(
             contexts=[SeeReports],
             description=_("See reported contents"),
             title=_("Reported contents"),
             groups=[]),
         ignore=ActivityDefinition(contexts=[Ignore],
                                   description=_("Ignore reports"),
                                   title=_("Ignore reports"),
                                   groups=[]),
         censor=ActivityDefinition(contexts=[Censor],
                                   description=_("Censor the content"),
                                   title=_("Censor the content"),
                                   groups=[]),
         restor=ActivityDefinition(contexts=[Restor],
                                   description=_("Restore the content"),
                                   title=_("Restore the content"),
                                   groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'report'),
         TransitionDefinition('report', 'eg'),
         TransitionDefinition('pg', 'see_reports'),
         TransitionDefinition('see_reports', 'eg'),
         TransitionDefinition('pg', 'ignore'),
         TransitionDefinition('ignore', 'eg'),
         TransitionDefinition('pg', 'censor'),
         TransitionDefinition('censor', 'eg'),
         TransitionDefinition('pg', 'restor'),
         TransitionDefinition('restor', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #27
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         pg=ParallelGatewayDefinition(),
         edit=ActivityDefinition(
             contexts=[EditReview, EditCinemaReview, EditInterview],
             description=_("Edit the review"),
             title=_("Edit"),
             groups=[]),
         reject=ActivityDefinition(contexts=[RejectReview],
                                   description=_("Reject the review"),
                                   title=_("Reject"),
                                   groups=[]),
         publish=ActivityDefinition(contexts=[PublishReview],
                                    description=_("Publish the review"),
                                    title=_("Publish"),
                                    groups=[]),
         prepare=ActivityDefinition(
             contexts=[PrepareForPublicationReview],
             description=_("Prepare the review for publication"),
             title=_("Prepare for publication"),
             groups=[]),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'edit'),
         TransitionDefinition('edit', 'eg'),
         TransitionDefinition('pg', 'publish'),
         TransitionDefinition('publish', 'eg'),
         TransitionDefinition('pg', 'prepare'),
         TransitionDefinition('prepare', 'eg'),
         TransitionDefinition('pg', 'reject'),
         TransitionDefinition('reject', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #28
0
 def _init_definition(self):
     self.defineNodes(
         start=StartEventDefinition(),
         #egs = ExclusiveGatewayDefinition(),
         see=ActivityDefinition(contexts=[SeeConnectors],
                                description=_("See all connectors"),
                                title=_("Connectors"),
                                groups=[_('See')]),
         add=ActivityDefinition(contexts=[AddConnectors],
                                description=_("Add connectors"),
                                title=_("Connectors"),
                                groups=[_('Add')]),
         pg=ParallelGatewayDefinition(),
         eg=ExclusiveGatewayDefinition(),
         end=EndEventDefinition(),
     )
     self.defineTransitions(
         TransitionDefinition('start', 'pg'),
         TransitionDefinition('pg', 'see'),
         TransitionDefinition('see', 'eg'),
         TransitionDefinition('pg', 'add'),
         TransitionDefinition('add', 'eg'),
         TransitionDefinition('eg', 'end'),
     )
Example #29
0
    def _init_definition(self):
        self.defineNodes(
                start = StartEventDefinition(),
                pg = ParallelGatewayDefinition(),
                add_cinemagoer = ActivityDefinition(contexts=[AddCinemagoer],
                                       description=_("Add cinema sessions"),
                                       title=_("Add cinema sessions"),
                                       groups=[_("Add")]),
                edit = ActivityDefinition(contexts=[EditFilmSchedule],
                                       description=_("Edit the film synopsis"),
                                       title=_("Edit"),
                                       groups=[]),
                see = ActivityDefinition(contexts=[SeeFilmSchedule],
                                       description=_("Details"),
                                       title=_("Details"),
                                       groups=[]),
                remove = ActivityDefinition(contexts=[RemoveFilmSchedule],
                                       description=_("Remove the film synopsis"),
                                       title=_("Remove"),
                                       groups=[]),
                eg = ExclusiveGatewayDefinition(),
                end = EndEventDefinition(),
        )
        self.defineTransitions(
                TransitionDefinition('start', 'pg'),
                TransitionDefinition('pg', 'add_cinemagoer'),
                TransitionDefinition('add_cinemagoer', 'eg'),
                TransitionDefinition('pg', 'see'),
                TransitionDefinition('see', 'eg'),
                TransitionDefinition('pg', 'edit'),
                TransitionDefinition('edit', 'eg'),
                TransitionDefinition('pg', 'remove'),
                TransitionDefinition('remove', 'eg'),
                TransitionDefinition('eg', 'end'),

        )
Example #30
0
 def _init_definition(self):
     self.defineNodes(
             start = StartEventDefinition(),
             pg = ParallelGatewayDefinition(),
             addapplication = ActivityDefinition(contexts=[Addapplications, AddFacebookApplication,
                                                           AddTwitterApplication, AddGoogleApplication],
                                    description=_("Add a social application"),
                                    title=_("Add a social application"),
                                    groups=[]),
             seeapplication = ActivityDefinition(contexts=[SeeApplication],
                                    description=_("See the application"),
                                    title=_("See the application"),
                                    groups=[]),
             editapplication = ActivityDefinition(contexts=[EditApplication],
                                    description=_("Edit the application"),
                                    title=_("Edit"),
                                    groups=[]),
             removeapplication = ActivityDefinition(contexts=[RemoveApplication],
                                    description=_("Remove the application"),
                                    title=_("Remove"),
                                    groups=[]),
             eg = ExclusiveGatewayDefinition(),
             end = EndEventDefinition(),
     )
     self.defineTransitions(
             TransitionDefinition('start', 'pg'),
             TransitionDefinition('pg', 'addapplication'),
             TransitionDefinition('addapplication', 'eg'),
             TransitionDefinition('pg', 'seeapplication'),
             TransitionDefinition('seeapplication', 'eg'),
             TransitionDefinition('pg', 'editapplication'),
             TransitionDefinition('editapplication', 'eg'),
             TransitionDefinition('pg', 'removeapplication'),
             TransitionDefinition('removeapplication', 'eg'),
             TransitionDefinition('eg', 'end'),
     )