//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// This file is a part of the 'SdackDemoApp' project.
// Copyright 2016 Elmar Sonnenschein, esoco GmbH, Flensburg, Germany
//
// Licensed 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.
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
package org.sdack.app.demo.server.process;

import de.esoco.process.EntityProcessDefinition;
import de.esoco.process.step.InteractionFragment;

import static de.esoco.process.ProcessRelationTypes.SUB_PROCESS_SEPARATE_CONTEXT;


/********************************************************************
 * The mainprocess of the application.
 *
 * @author eso
 */
public class MainProcess extends EntityProcessDefinition
{
	//~ Static fields/initializers ---------------------------------------------

	private static final long serialVersionUID = 1L;

	//~ Constructors -----------------------------------------------------------

	/***************************************
	 * Creates a new instance.
	 */
	@SuppressWarnings("boxing")
	public MainProcess()
	{
		// always invoke sub-processes in their own context to prevent
		// parameter conflicts on repeated executions
		setParameter(SUB_PROCESS_SEPARATE_CONTEXT, true);

		invoke(WebAppMainView.class);
	}

	//~ Inner Classes ----------------------------------------------------------

	/********************************************************************
	 * The interaction fragment that displays the main view of the customer
	 * self-care application.
	 *
	 * @author eso
	 */
	public static class WebAppMainView extends InteractionFragment
	{
		//~ Static fields/initializers -----------------------------------------

		private static final long serialVersionUID = 1L;

		//~ Methods ------------------------------------------------------------

		/***************************************
		 * {@inheritDoc}
		 */
		@Override
		public void init() throws Exception
		{
			label("Welcome to the SDACK demo application.");
		}
	}
}

@@ -146,9 +146,9 @@
  201
-6
+8
  Elm
@@ -898,22 +898,24 @@
 process.
-Entity
+StepList
 ProcessD
@@ -980,91 +980,8 @@
 t;%0A%0A
-import static de.esoco.process.ProcessRelationTypes.SUB_PROCESS_SEPARATE_CONTEXT;%0A%0A
 %0A/**
@@ -1058,16 +1058,17 @@
 The main
+ 
 process 
@@ -1146,14 +1146,16 @@
 nds 
-Entity
+StepList
 Proc
@@ -1512,174 +1512,8 @@
 %0A%09%7B%0A
-%09%09// always invoke sub-processes in their own context to prevent%0A%09%09// parameter conflicts on repeated executions%0A%09%09setParameter(SUB_PROCESS_SEPARATE_CONTEXT, true);%0A%0A
 %09%09in
@@ -1517,22 +1517,16 @@
 %09invoke(
-WebApp
 MainView
@@ -1700,28 +1700,20 @@
 The 
-interaction fragment
+process step
  tha
@@ -1748,31 +1748,8 @@
 the 
-customer%0A%09 * self-care 
 appl
@@ -1807,14 +1807,8 @@
 ass 
-WebApp
 Main

Simplify application structure