Hi All,

App Factory currently supports uploading a WAR file via 'Add New
Application'.

As per the current implementation we have a config file which has
ApplicationLifecycle aspect (refer the attachment for more details).
Therefore when an application
is added out of a WAR file, the initial stage is set to "Development".

So my concern is whether the WAR file should go through all the life cycle
stages (Promote/Demote) as an ordinary application or should it directly go
to "Production" stage.

If we go-ahead with all life cycle stages, then it requires minimal set of
changes.
If the requirement is to set the life cycle state as "Production" there are
two ways to achieve this requirement:

1. One way is to keep the existing aspect and when the war is created do
internal calls('Promote') at application update itself to take the
application to "Production" stage.
2. Define another aspect config for WAR files and godhead with it.

Please share your thoughts.

-- 
Thanks and Regards,

Punnadi Gunarathna
Senior Software Engineer,
WSO2, Inc.; http://wso2.com <http://wso2>
Blog: http://hi-my-world.blogspot.com/
Tel : 94 11 214 5345
Fax :94 11 2145300



 <http://lalajisureshika.blogspot.com/>
<!--
 ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 ~
 ~ WSO2 Inc. licenses this file to you under the Apache License,
 ~ Version 2.0 (the "License"); you may not use this file except
 ~ in compliance with the License.
 ~ You may obtain a copy of the License at
 ~
 ~    http://www.apache.org/licenses/LICENSE-2.0
 ~
 ~ Unless required by applicable law or agreed to in writing,
 ~ software distributed under the License is distributed on an
 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 ~ KIND, either express or implied.  See the License for the
 ~ specific language governing permissions and limitations
 ~ under the License.
 -->
<aspect name="ApplicationLifecycle" class="org.wso2.carbon.governance.registry.extensions.aspects.DefaultLifeCycle">
    <configuration type="literal">
        <lifecycle>
            <scxml xmlns="http://www.w3.org/2005/07/scxml";
                   version="1.0"
                   initialstate="Development">
                <state id="Development">
                    <datamodel>
                        <data name="checkItems">
                            <item name="Code Completed*" forEvent="Promote">
                                <!--<permissions>
                                    <permission roles=""/>
                                </permissions>
                                <validations>
                                    <validation forEvent="" class="">
                                        <parameter name="" value=""/>
                                    </validation>
                                </validations>-->
                            </item>
                            <item name="Design Review Done*" forEvent="">
                            </item>
                            <item name="Code Review Done*" forEvent="">
                            </item>
                        </data>

			<data name="transitionExecution">
                            <execution forEvent="Promote" class="org.wso2.carbon.appfactory.core.governance.lifecycle.AppFactoryLCExecutor">
                            </execution>			
                        </data>
			<data name="transitionScripts">
                            <js forEvent="Promote">
                                <console function="doPromote">
                                <script type="text/javascript">
                                    doPromote = function() {
                                        window.location = unescape("../resources/resource.jsp?region=region3%26item=resource_browser_menu%26path=/_system/governance/repository/applications");
                                    }
                                </script>
                            </console>
                            </js>
                        </data>			
                    </datamodel>
                    <transition event="Promote" target="Testing"/>                  
                </state>
                <state id="Testing">
                    <datamodel>
                        <data name="checkItems">
                            <item name="Smoke Tests Passed*" forEvent="Promote">
                            </item>
                            <item name="Test Cases Passed*" forEvent="Promote">
                            </item>
                        </data>
                        <data name="transitionExecution">
                            <execution forEvent="Promote" class="org.wso2.carbon.appfactory.core.governance.lifecycle.AppFactoryLCExecutor">
                            </execution>
                            
                            <execution forEvent="Demote" class="org.wso2.carbon.appfactory.core.governance.lifecycle.AppFactoryLCExecutor">
                            </execution>			    
                        </data>	
                        			
			<data name="transitionScripts">
                            <js forEvent="Promote">
                                <console function="doPromote">
                                <script type="text/javascript">
                                    doPromote = function() {
                                        window.location = unescape("../resources/resource.jsp?region=region3%26item=resource_browser_menu%26path=/_system/governance/repository/applications");
                                    }
                                </script>
                            </console>                          
                            </js>
                            <js forEvent="Demote">
                                <console function="doDemote">
                                <script type="text/javascript">
                                    doPromote = function() {
                                        window.location = unescape("../resources/resource.jsp?region=region3%26item=resource_browser_menu%26path=/_system/governance/repository/applications");
                                    }
                                </script>
                            </console>
                            </js>

                        </data>			
			
                    </datamodel>
                    <transition event="Promote" target="Production"/>
                    <transition event="Demote" target="Development"/>
                </state>
                <state id="Production">  
                    <datamodel>
                        <data name="checkItems">
                            <item name="Verify no one is using the Application*" forEvent="">
                            </item>
                        </data>
			<data name="transitionExecution">
                            <execution forEvent="Retire" class="org.wso2.carbon.appfactory.core.governance.lifecycle.AppFactoryLCExecutor">
                            </execution>		
		            <execution forEvent="Demote" class="org.wso2.carbon.appfactory.core.governance.lifecycle.AppFactoryLCExecutor">
                            </execution>								
                        </data>
			<data name="transitionScripts">
                            <js forEvent="Retire">
                                <console function="doRetire">
                                <script type="text/javascript">
                                    doPromote = function() {
                                        window.location = unescape("../resources/resource.jsp?region=region3%26item=resource_browser_menu%26path=/_system/governance/repository/applications");
                                    }
                                </script>
                            </console>
                            </js>
			    <js forEvent="Demote">
                                <console function="doDemote">
                                <script type="text/javascript">
                                    doPromote = function() {
                                        window.location = unescape("../resources/resource.jsp?region=region3%26item=resource_browser_menu%26path=/_system/governance/repository/applications");
                                    }
                                </script>
                            </console>
                            </js>
                        </data>			
                    </datamodel>
                    <transition event="Demote" target="Testing"/>
                    <transition event="Retire" target="Retired"/>
                </state>  
                
                <state id="Retired">  
                    <datamodel>					
                    </datamodel>
                </state>
                              
            </scxml>
        </lifecycle>
    </configuration>
</aspect>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to