Guillermo Espinoza 7 лет назад
Родитель
Сommit
a4524aaeee
4 измененных файлов с 105 добавлено и 80 удалено
  1. 23 62
      app/Resources/workflows/workflow_list.yml.dist
  2. 2 1
      app/config/config.yml
  3. 63 0
      app/config/workflow.yml
  4. 17 17
      composer.lock

+ 23 - 62
app/Resources/workflows/workflow_list.yml.dist

@@ -1,63 +1,24 @@
 framework:
-    workflows:
-        administrative_state:
-            type: 'state_machine'
-            marking_store:
-                type: 'single_state'
-                arguments:
-                    - 'administrativeState'
-            supports:
-                - CablemodemBundle\Entity\Cablemodem
-            places:
-                - active
-                - pre_notice
-                - suspend
-                - deleted
-            transitions:
-                active_to_pre_notice:
-                    from: active
-                    to:   pre_notice
-                active_to_suspend:
-                    from: active
-                    to:   suspend
-                pre_notice_to_active:
-                    from: pre_notice
-                    to:   active
-                pre_notice_to_suspend:
-                    from: pre_notice
-                    to:   suspend
-                suspend_to_active:
-                    from: suspend
-                    to:   active 
-                delete:
-                    from: [active,suspend,pre_notice]
-                    to:   deleted
-        transition_state:
-            type: 'state_machine'
-            marking_store:
-                type: 'single_state'
-                arguments:
-                    - 'transitionState'
-            supports:
-                - CablemodemBundle\Entity\Cablemodem
-            places:
-                - pending
-                - process
-                - fail
-                - success
-            transitions:
-                pending_to_process:
-                    from: pending
-                    to:   process
-                process_to_fail:
-                    from: process
-                    to:   fail
-                process_to_success:
-                    from: process
-                    to:   success
-                fail_to_pending:
-                    from: fail
-                    to:   pending
-                success_to_pending:
-                    from: success
-                    to:   pending
+  workflows:
+    cablemodem_workflow:
+      type: state_machine
+      marking_store:
+        type: single_state
+        arguments:
+          - currentState
+      supports:
+        - CablemodemBundle\Entity\Cablemodem
+      initial_place: active
+      places:
+        - active
+        - disable
+      transitions:
+        add_config:
+          from: active
+          to: active
+        disable:
+          from: active
+          to: disable
+        active:
+          from: disable
+          to: active

+ 2 - 1
app/config/config.yml

@@ -1,6 +1,7 @@
 imports:
     - { resource: parameters.yml }
     - { resource: services.yml }
+    - { resource: workflow.yml }
     - { resource: "@AuditBundle/Resources/config/services.yml" }
     - { resource: "@AuthBundle/Resources/config/services.yml" }
     - { resource: '@BaseAdminBundle/Resources/config/services.yml' }
@@ -118,7 +119,7 @@ sonata_admin:
         user_block: BaseOAuthClientBundle:Core:oauth_user_block.html.twig
         list: BaseAdminBundle::standard_list.html.twig
     persist_filters: true
-    
+
 doctrine_migrations:
     dir_name: "%kernel.root_dir%/DoctrineMigrations"
     namespace: Application\Migrations

+ 63 - 0
app/config/workflow.yml

@@ -0,0 +1,63 @@
+framework:
+    workflows:
+        administrative_state:
+            type: 'state_machine'
+            marking_store:
+                type: 'single_state'
+                arguments:
+                    - 'administrativeState'
+            supports:
+                - CablemodemBundle\Entity\Cablemodem
+            places:
+                - active
+                - pre_notice
+                - suspend
+                - deleted
+            transitions:
+                active_to_pre_notice:
+                    from: active
+                    to:   pre_notice
+                active_to_suspend:
+                    from: active
+                    to:   suspend
+                pre_notice_to_active:
+                    from: pre_notice
+                    to:   active
+                pre_notice_to_suspend:
+                    from: pre_notice
+                    to:   suspend
+                suspend_to_active:
+                    from: suspend
+                    to:   active 
+                delete:
+                    from: [active,suspend,pre_notice]
+                    to:   deleted
+        transition_state:
+            type: 'state_machine'
+            marking_store:
+                type: 'single_state'
+                arguments:
+                    - 'transitionState'
+            supports:
+                - CablemodemBundle\Entity\Cablemodem
+            places:
+                - pending
+                - process
+                - fail
+                - success
+            transitions:
+                pending_to_process:
+                    from: pending
+                    to:   process
+                process_to_fail:
+                    from: process
+                    to:   fail
+                process_to_success:
+                    from: process
+                    to:   success
+                fail_to_pending:
+                    from: fail
+                    to:   pending
+                success_to_pending:
+                    from: success
+                    to:   pending

+ 17 - 17
composer.lock

@@ -1387,7 +1387,7 @@
                 "audit",
                 "bundle"
             ],
-            "time": "2018-01-16T14:31:20+00:00"
+            "time": "2018-01-16 14:31:20"
         },
         {
             "name": "ik/auth-bundle",
@@ -1410,7 +1410,7 @@
                 "auth",
                 "bundle"
             ],
-            "time": "2018-01-16T15:24:23+00:00"
+            "time": "2018-01-16 15:24:23"
         },
         {
             "name": "ik/base-admin-bundle",
@@ -1433,7 +1433,7 @@
                 "bootstrap",
                 "sonata"
             ],
-            "time": "2018-01-22T18:31:26+00:00"
+            "time": "2018-01-22 18:31:26"
         },
         {
             "name": "ik/device-bundle",
@@ -1456,7 +1456,7 @@
                 "bundle",
                 "validators"
             ],
-            "time": "2018-01-23T10:48:54+00:00"
+            "time": "2018-01-23 10:48:54"
         },
         {
             "name": "ik/extra-data-bundle",
@@ -1479,7 +1479,7 @@
                 "bundle",
                 "extra-data"
             ],
-            "time": "2018-01-16T14:36:50+00:00"
+            "time": "2018-01-16 14:36:50"
         },
         {
             "name": "ik/leaflet-bundle",
@@ -1500,7 +1500,7 @@
                 }
             },
             "description": "The Flowdat3 Leaflet Resource",
-            "time": "2018-01-16T14:41:54+00:00"
+            "time": "2018-01-16 14:41:54"
         },
         {
             "name": "ik/map-bundle",
@@ -1523,7 +1523,7 @@
                 "bootstrap",
                 "sonata"
             ],
-            "time": "2018-01-16T14:42:32+00:00"
+            "time": "2018-01-16 14:42:32"
         },
         {
             "name": "ik/migrations-bundle",
@@ -1546,7 +1546,7 @@
                 "bundle",
                 "migrations"
             ],
-            "time": "2018-01-16T14:43:17+00:00"
+            "time": "2018-01-16 14:43:17"
         },
         {
             "name": "ik/oauthclient-bundle",
@@ -1573,7 +1573,7 @@
                 "bundle",
                 "oauth"
             ],
-            "time": "2018-01-16T14:34:16+00:00"
+            "time": "2018-01-16 14:34:16"
         },
         {
             "name": "ik/owner-voter-bundle",
@@ -1596,7 +1596,7 @@
                 "bundle",
                 "owner-voter"
             ],
-            "time": "2018-01-16T14:44:27+00:00"
+            "time": "2018-01-16 14:44:27"
         },
         {
             "name": "ik/template-bundle",
@@ -1622,7 +1622,7 @@
                 "bundle",
                 "template"
             ],
-            "time": "2018-01-16T14:46:29+00:00"
+            "time": "2018-01-16 14:46:29"
         },
         {
             "name": "ik/webservice-bundle",
@@ -1643,7 +1643,7 @@
                 }
             },
             "description": "The Flowdat3 Webservice Rest",
-            "time": "2018-01-16T14:47:00+00:00"
+            "time": "2018-01-16 14:47:00"
         },
         {
             "name": "ik/workflow-bundle",
@@ -1651,7 +1651,7 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/WorkflowBundle.git",
-                "reference": "cd41b09393579b361ec9986c346cf6e64d96c68a"
+                "reference": "3d0fac4569ff7dd50f4232adb1c4dab4b0dbebb7"
             },
             "require": {
                 "php-amqplib/rabbitmq-bundle": "^1.12"
@@ -1681,7 +1681,7 @@
                 "bundle",
                 "workflow"
             ],
-            "time": "2018-01-17T14:16:11+00:00"
+            "time": "2018-01-23 15:19:44"
         },
         {
             "name": "incenteev/composer-parameter-handler",
@@ -3290,7 +3290,7 @@
                 "bootstrap",
                 "sonata"
             ],
-            "time": "2017-10-04T12:16:04+00:00"
+            "time": "2017-10-04 12:16:04"
         },
         {
             "name": "sonata-project/block-bundle",
@@ -4719,7 +4719,7 @@
                 }
             ],
             "description": "REST API Generator for Symfony 2",
-            "time": "2016-04-18T12:29:38+00:00"
+            "time": "2016-04-18 12:29:38"
         },
         {
             "name": "willdurand/jsonp-callback-validator",
@@ -6287,7 +6287,7 @@
         "ik/workflow-bundle": 20
     },
     "prefer-stable": false,
-    "prefer-lowest": true,
+    "prefer-lowest": false,
     "platform": {
         "php": ">=5.5.9"
     },