View Javadoc

1   /*******************************************************************************
2    * Copyright (c) 2009 Ordina and committers to Mod4j
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *     Ordina - initial implementation
10   *******************************************************************************/
11  package org.mod4j.dslcommon.openarchitectureware;
12  
13  import org.eclipse.emf.mwe.core.WorkflowContext;
14  import org.eclipse.emf.mwe.core.issues.Issues;
15  import org.eclipse.emf.mwe.core.lib.WorkflowComponentWithModelSlot;
16  import org.eclipse.emf.mwe.core.monitor.ProgressMonitor;
17  
18  /* 
19   * Workflow component to write a Crossx model to an XML file.
20   * Referenced from workflow (*.oaw) files.
21   */
22  public class LoggingWorkflowComponent extends WorkflowComponentWithModelSlot {
23  
24      /**
25       * Converts a ModelInfo into an XML structure and writes this to file.
26       * 
27       * Then calling MyWorkflowComponent the invoke method is called. We use it, to instance the model and apply it to a
28       * modelslot, so it can be used later by the generator component.
29       * 
30       * @see org.openarchitectureware.workflow.WorkflowComponent#invoke(org.openarchitectureware.workflow.WorkflowContext,
31       *      org.openarchitectureware.workflow.monitor.ProgressMonitor, org.openarchitectureware.workflow.issues.Issues)
32       */
33  	@Override
34      public void invokeInternal(WorkflowContext wfCxt, ProgressMonitor arg1, Issues arg2) {
35  
36          String message = getModelSlot();
37  
38          System.err.println("MOD4 J LOGGING [" + message + "]");
39      }
40      public String outputFile;
41  
42      protected String getOutputFile() {
43          return outputFile;
44      }
45  
46      public void setOutputFile(final String outlet) {
47          this.outputFile = outlet;
48      }
49  
50      // capture the value of the <outputFile> slot in the workflow
51      public String project;
52  
53      protected String getProject() {
54          return project;
55      }
56  
57      public void setProject(final String theProject) {
58          this.project = theProject;
59      }
60  
61  }