瀏覽代碼

Merge branch '20' into 'master'

#20 onu_workflow refactory. Action and Workflow migrations updated

See merge request interlink-sa/flowdat3/modules/ftth!130
Gabriel Gosparo 6 年之前
父節點
當前提交
989b3ada49

+ 27 - 0
app/DoctrineMigrations/Version20190328134353.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+
+/**
+ * Update workflow_id in onu table
+ */
+class Version20190328134353 extends AbstractMigration
+{
+    /**
+     * @param Schema $schema
+     */
+    public function up(Schema $schema)
+    {
+        $this->addSql('SET FOREIGN_KEY_CHECKS=0; UPDATE workflow SET id = 2 WHERE name = "onu_workflow"; UPDATE onu SET workflow_id = 2; SET FOREIGN_KEY_CHECKS=1;');
+    }
+
+    /**
+     * @param Schema $schema
+     */
+    public function down(Schema $schema)
+    {
+    }
+}

File diff suppressed because it is too large
+ 102 - 108
app/DoctrineMigrations/src/action.yml


+ 4 - 17
app/DoctrineMigrations/src/workflow.yml

@@ -21,25 +21,12 @@ insertorupdate:
           type: "state_machine"
           type: "state_machine"
           marking_type: "single_state"
           marking_type: "single_state"
           marking_name: "currentState"
           marking_name: "currentState"
-          description: "onu workflow"
-          template: "initial_place: active\r\nplaces:\r\n  - active\r\n  - disable\r\ntransitions:\r\n  add_config:\r\n    from: active\r\n    to: active\r\n  disable:\r\n    from: active\r\n    to: disable\r\n  active:\r\n    from: disable\r\n    to: active"
-          created: "2017-04-27 11:35:07"
-          updated: "2017-04-27 20:01:43"
-          tenancy_id: 1
-          enable: 1
-          support: "a:1:{i:0;s:21:\"FTTHBundle\\Entity\\ONU\";}"
-          owner: 1
-        -
-          id: 3
-          name: "onu_workflow_2"
-          type: "state_machine"
-          marking_type: "single_state"
-          marking_name: "currentState"
-          description: "ONU Workflow v2"
-          template: "initial_place: active\r\nplaces:\r\n  - active\r\n  - disable\r\n  - deleted\r\ntransitions:\r\n  active:\r\n    from: disable\r\n    to: active\r\n  disable_deleted:\r\n    from: disable\r\n    to: deleted\r\n  add_config:\r\n    from: active\r\n    to: active\r\n  disable:\r\n    from: active\r\n    to: disable\r\n  active_deleted:\r\n    from: active\r\n    to: deleted\r\n  deleted_active:\r\n    from: deleted\r\n    to: active"
+          description: "ONU Workflow"
+          template: "initial_place: active\r\nplaces:\r\n  - active\r\n  - disable\r\n  - deleted\r\ntransitions:\r\n  disable_active:\r\n    from: disable\r\n    to: active\r\n  disable_deleted:\r\n    from: disable\r\n    to: deleted\r\n  config:\r\n    from: active\r\n    to: active\r\n  active_disable:\r\n    from: active\r\n    to: disable\r\n  active_deleted:\r\n    from: active\r\n    to: deleted\r\n  deleted_active:\r\n    from: deleted\r\n    to: active"
           created: "2018-08-06 17:13:54"
           created: "2018-08-06 17:13:54"
-          updated: "2018-08-07 14:58:10"
+          updated: "2019-03-28 13:34:30"
           tenancy_id: 1
           tenancy_id: 1
           enable: 1
           enable: 1
           support: "a:1:{i:0;s:21:\"FTTHBundle\\Entity\\ONU\";}"
           support: "a:1:{i:0;s:21:\"FTTHBundle\\Entity\\ONU\";}"
           owner: 1
           owner: 1
+          used_by_default: 1

+ 7 - 26
app/Resources/workflows/workflow_list.yml.dist

@@ -20,28 +20,6 @@ framework:
           from: disabled
           from: disabled
           to: enabled
           to: enabled
     onu_workflow:
     onu_workflow:
-      type: state_machine
-      marking_store:
-        type: single_state
-        arguments:
-          - currentState
-      supports:
-        - FTTHBundle\Entity\ONU
-      initial_place: active
-      places:
-        - active
-        - disable
-      transitions:
-        add_config:
-          from: active
-          to: active
-        disable:
-          from: active
-          to: disable
-        active:
-          from: disable
-          to: active
-    onu_workflow_2:
       type: state_machine
       type: state_machine
       marking_store:
       marking_store:
         type: single_state
         type: single_state
@@ -55,18 +33,21 @@ framework:
         - disable
         - disable
         - deleted
         - deleted
       transitions:
       transitions:
-        active:
+        disable_active:
           from: disable
           from: disable
           to: active
           to: active
         disable_deleted:
         disable_deleted:
           from: disable
           from: disable
           to: deleted
           to: deleted
-        add_config:
+        config:
           from: active
           from: active
           to: active
           to: active
-        disable:
+        active_disable:
           from: active
           from: active
           to: disable
           to: disable
         active_deleted:
         active_deleted:
           from: active
           from: active
-          to: deleted
+          to: deleted
+        deleted_active:
+          from: deleted
+          to: active

+ 3 - 3
composer.lock

@@ -1,7 +1,7 @@
 {
 {
     "_readme": [
     "_readme": [
         "This file locks the dependencies of your project to a known state",
         "This file locks the dependencies of your project to a known state",
-        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
         "This file is @generated automatically"
     ],
     ],
     "content-hash": "2936d77bbfff21651cf2c40704457bde",
     "content-hash": "2936d77bbfff21651cf2c40704457bde",
@@ -2223,7 +2223,7 @@
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/WorkflowBundle.git",
                 "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/WorkflowBundle.git",
-                "reference": "5b0608cc9e4288c05fe6520c0621b6fd8b2eda5d"
+                "reference": "c22a633e32053400986316c2905d6ec95c29a593"
             },
             },
             "require": {
             "require": {
                 "php-amqplib/rabbitmq-bundle": "^1.12"
                 "php-amqplib/rabbitmq-bundle": "^1.12"
@@ -2253,7 +2253,7 @@
                 "bundle",
                 "bundle",
                 "workflow"
                 "workflow"
             ],
             ],
-            "time": "2019-03-15T17:07:28+00:00"
+            "time": "2019-03-28T15:09:41+00:00"
         },
         },
         {
         {
             "name": "incenteev/composer-parameter-handler",
             "name": "incenteev/composer-parameter-handler",