Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de...

Post on 26-Oct-2020

5 views 0 download

Transcript of Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de...

Anexo de documentación

Autor: Daniel Hernández Jané

Tutor: Juan Carlos Hernández Palacín

1

Índice

1. Orden de fabricación ............................................................................................................. 2

1.1. Convertidor ÖBB............................................................................................................ 2

1.2. Convertidor Civia ........................................................................................................... 5

1.3. Convertidor Desiro ........................................................................................................ 8

2. Hojas de ruta (HR) ............................................................................................................... 11

2.1. Convertidor ÖBB.......................................................................................................... 11

2.2. Convertidor CIVIA ........................................................................................................ 15

2.3. Convertidor Desiro ...................................................................................................... 18

3. Lista de materiales .............................................................................................................. 21

4. Programación de la interfaz gráfica del Workflow .............................................................. 34

2

1. Orden de fabricación

1.1. Convertidor ÖBB

Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general.

Figura 2: ejemplo de orden de fabricación extraída de SAP, pestaña Asignación.

3

Figura 3: ejemplo de orden de fabricación extraída de SAP, pestaña Entrada de mercancías.

Figura 4: ejemplo de orden de fabricación extraída de SAP, pestaña Control.

4

Figura 5: ejemplo de orden de fabricación extraída de SAP, pestaña Fechas / Cantidad.

Figura 6: ejemplo de orden de fabricación extraída de SAP, pestaña Datos maestros.

5

1.2. Convertidor Civia

Figura 7: ejemplo de orden de fabricación extraída de SAP, pestaña general. (Civia)

Figura 8: ejemplo de orden de fabricación extraída de SAP, pestaña Asignación. (Civia)

6

Figura 9: ejemplo de orden de fabricación extraída de SAP, pestaña Entradas mercancías. (Civia)

Figura 10: ejemplo de orden de fabricación extraída de SAP, pestaña Control. (Civia)

7

Figura 11: ejemplo de orden de fabricación extraída de SAP, pestaña Fechas / Cantidad. (Civia)

Figura 12: ejemplo de orden de fabricación extraída de SAP, pestaña Datos maestros. (Civia)

8

1.3. Convertidor Desiro

Figura 13: ejemplo de orden de fabricación extraída de SAP, pestaña general. (Desiro)

Figura 14: ejemplo de orden de fabricación extraída de SAP, pestaña Asignación. (Desiro)

9

Figura 15: ejemplo de orden de fabricación extraída de SAP, pestaña Entrada mercancías. (Desiro)

Figura 16: ejemplo de orden de fabricación extraída de SAP, pestaña Control. (Desiro)

10

Figura 17: ejemplo de orden de fabricación extraída de SAP, pestaña Fechas / Cantidad. (Desiro)

Figura 18: ejemplo de orden de fabricación extraída de SAP, pestaña Datos maestros. (Desiro)

11

2. Hojas de ruta (HR)

2.1. Convertidor ÖBB HR 1: subproceso � Pruebas y expedición.

HR 2: subproceso � Montaje.

12

HR 3: subproceso � FK1 (Cable de mando).

HR 4: subproceso � FK2 (Cable de mando).

13

HR 5: subproceso � FK3 (Cable de mando).

HR 6: subproceso � FK4 (Cable de mando).

HR 7: subproceso � FK5 (Cable de mando).

14

HR 8: subproceso � FK Puentes.

HR 9: subproceso � Cables de potencia.

HR 10: subproceso � Premontajes.

15

2.2. Convertidor CIVIA

HR 1: subproceso � Montaje, pruebas y expedición

HR 2: subproceso � FK1 (Cable de mando)

16

HR 3: subproceso � FK2 (Cable de mando)

HR 4: subproceso � FK3 (Cable de mando)

HR 5: subproceso � FK Puentes

17

HR 6: subproceso � Cables de potencia

HR 7: subproceso � Premontajes

18

2.3. Convertidor Desiro

HR 1: subproceso � Montaje, pruebas y expedición

19

HR 2: subproceso � FK1 (Cable de mando)

HR 3: subproceso � FK2 (Cable de mando)

20

HR 4: subproceso � Cables de potencia

HR 5: subproceso � Premontajes

21

3. Lista de materiales

Convertidor ÖBB � Extracto de materiales de montaje

22

Convertidor ÖBB � Extracto de materiales de cables de mando

23

Convertidor ÖBB � Extracto de materiales de FK puentes

24

Convertidor ÖBB � Extracto de materiales de cables de potencia

25

Convertidor ÖBB � Extracto de materiales de premontajes

26

Convertidor CIVIA � Extracto de materiales de montaje

27

Convertidor CIVIA � Extracto de materiales de cables de mando

28

Convertidor CIVIA � Extracto de materiales de FK puentes

29

Convertidor CIVIA � Extracto de materiales de cables de potencia

30

Convertidor CIVIA � Extracto de materiales de premontajes

31

Convertidor DESIRO � Extracto de materiales de montaje

32

Convertidor DESIRO � Extracto de materiales de cables de mando y FK puentes

Convertidor DESIRO � Extracto de materiales de cables de potencia

33

Convertidor DESIRO � Extracto de materiales de premontajes

34

4. Programación de la interfaz gráfica del Workflow

Seguidamente, se presenta el código resultante de la programación con Visual Studio

2010 de la interfaz gráfica sobre la que se ejecuta el Workflow (véase figura).

Figura 19: Captura de la reproducción del Workflow sobre la interfaz de reproducción.

using System; using System.Activities;

using System.Activities.Core.Presentation;

using System.Activities.Debugger; using System.Activities.Presentation;

using System.Activities.Presentation.Debug;

using System.Activities.Presentation.Services; using System.Activities.Tracking;

using System.Activities.XamlIntegration;

using System.Collections.Generic; using System.Threading;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Threading;

namespace Microsoft.Samples.VisualWorkflowTracking

{ /// <summary>

/// Interaction logic for WorkflowDesignerHost.xaml

/// </summary> public partial class WorkflowDesignerHost : UserControl

{

public WorkflowDesigner WorkflowDesigner { get; set; }

public IDesignerDebugView DebuggerService { get; set; }

35

TextBox tx;

Dictionary<int, SourceLocation> textLineToSourceLocationMap;

int i = 0;

public WorkflowDesignerHost()

{

InitializeComponent(); RegisterMetadata();

AddWorkflowDesigner();

AddTrackingTextbox(); }

private void RegisterMetadata() {

(new DesignerMetadata()).Register();

}

private void AddWorkflowDesigner()

{

this.WorkflowDesigner = new WorkflowDesigner(); this.DebuggerService = this.WorkflowDesigner.DebugManagerView;

this.WorkflowDesigner.Load("Workflow.xaml"); //this.WorkflowDesigner.Load("Prompt.xaml");

this.RehostGrid.Children.Add(this.WorkflowDesigner.View);

}

//Run the Workflow with the tracking participant public void RunWorkflow()

{

tx.Text = "";

WorkflowInvoker instance = new

WorkflowInvoker(GetRuntimeExecutionRoot());

//Mapping between the Object and Line No.

Dictionary<object, SourceLocation> wfElementToSourceLocationMap =

UpdateSourceLocationMappingInDebuggerService();

//Mapping between the Object and the Instance Id

Dictionary<string, Activity> activityIdToWfElementMap = BuildActivityIdToWfElementMap(wfElementToSourceLocationMap);

# region Set up Custom Tracking const String all = "*";

VisualTrackingParticipant simTracker = new

VisualTrackingParticipant()

{ TrackingProfile = new TrackingProfile()

{

Name = "CustomTrackingProfile", Queries =

{

new CustomTrackingQuery() {

Name = all,

ActivityName = all },

new WorkflowInstanceQuery()

{

36

// Limit workflow instance tracking records for

started and completed workflow states

States = { WorkflowInstanceStates.Started,

WorkflowInstanceStates.Completed }, },

new ActivityStateQuery()

{ // Subscribe for track records from all

activities for all states

ActivityName = all, States = { all },

// Extract workflow variables and arguments as a part of the activity tracking record

// VariableName = "*" allows for extraction of

all variables in the scope

// of the activity Variables =

{

{ all } }

}

} }

};

# endregion

simTracker.ActivityIdToWorkflowElementMap =

activityIdToWfElementMap;

//As the tracking events are received

simTracker.TrackingRecordReceived += (trackingParticpant, trackingEventArgs) =>

{

if (trackingEventArgs.Activity != null) {

System.Diagnostics.Debug.WriteLine(

String.Format("<+=+=+=+> Activity Tracking Record

Received for ActivityId: {0}, record: {1} ", trackingEventArgs.Activity.Id,

trackingEventArgs.Record

) );

ShowDebug(wfElementToSourceLocationMap[trackingEventArgs.Activity]);

this.Dispatcher.Invoke(DispatcherPriority.SystemIdle,

(Action)(() => {

//Textbox Updates

//tx.AppendText(trackingEventArgs.Activity.DisplayName + " " +

((ActivityStateRecord)trackingEventArgs.Record).State + "\n"); if

(((ActivityStateRecord)trackingEventArgs.Record).State == "Executing")

{ tx.AppendText("Ejecutando " +

trackingEventArgs.Activity.DisplayName + "\n");

}

37

else

{

tx.AppendText(trackingEventArgs.Activity.DisplayName + " finalizado" + "\n"); }

if

(trackingEventArgs.Activity.GetType().FullName.Equals(typeof(System.Activities.Statements.WriteLine).FullName)

&&

((ActivityStateRecord)trackingEventArgs.Record).State == "Executing") {

tx.AppendText(((System.Activities.Statements.WriteLine)(trackingEventArgs.Activit

y)).Text.Expression.ToString() + "\n"); }

if (((ActivityStateRecord)trackingEventArgs.Record).State == "Closed")

{

tx.AppendText("******************\n"); }

textLineToSourceLocationMap.Add(i,

wfElementToSourceLocationMap[trackingEventArgs.Activity]); i = i + 2;

tx.ScrollToEnd();

//Add a sleep so that the debug adornments are

visible to the user System.Threading.Thread.Sleep(1000);

}));

}

};

instance.Extensions.Add(simTracker); ThreadPool.QueueUserWorkItem(new WaitCallback((context) =>

{

//Invoking the Workflow Instance with Input Arguments instance.Invoke(new Dictionary<string, object> { {

"decisionVar", true }, { "testVar", "Prova" } }, new TimeSpan(1, 0, 0));

//This is to remove the final debug adornment

this.Dispatcher.Invoke(DispatcherPriority.Render

, (Action)(() =>

{ this.WorkflowDesigner.DebugManagerView.CurrentLocation =

new SourceLocation("Workflow.xaml",1,1,1,10);

//this.WorkflowDesigner.DebugManagerView.CurrentLocation = new SourceLocation("Prompt.xaml", 1, 1, 1, 10);

}));

}));

}

void ShowDebug(SourceLocation srcLoc)

{

38

this.Dispatcher.Invoke(DispatcherPriority.Render

, (Action)(() =>

{

this.WorkflowDesigner.DebugManagerView.CurrentLocation = srcLoc;

}));

}

//Provide Debug Adornment on the Activity being executed void textBox1_SelectionChanged(object sender, RoutedEventArgs e)

{

string text = this.tx.Text;

int index = 0;

int lineClicked = 0; while (index < text.Length)

{

if (text[index] == '\n') lineClicked++;

if (this.tx.SelectionStart <= index)

break;

index++;

}

this.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() =>

{ try

{

//Tell Debug Service that the Line Clicked is _______ this.WorkflowDesigner.DebugManagerView.CurrentLocation =

textLineToSourceLocationMap[lineClicked];

} catch (Exception)

{

//If the user clicks other than on the tracking records

themselves. this.WorkflowDesigner.DebugManagerView.CurrentLocation = new

SourceLocation("Workflow.xaml", 1, 1, 1, 10);

//this.WorkflowDesigner.DebugManagerView.CurrentLocation = new SourceLocation("Prompt.xaml", 1, 1, 1, 10);

}

}));

}

private Dictionary<string, Activity>

BuildActivityIdToWfElementMap(Dictionary<object, SourceLocation>

wfElementToSourceLocationMap) {

Dictionary<string, Activity> map = new Dictionary<string,

Activity>();

Activity wfElement;

foreach (object instance in wfElementToSourceLocationMap.Keys) {

wfElement = instance as Activity;

if (wfElement != null)

39

{

map.Add(wfElement.Id, wfElement);

}

}

return map;

}

Dictionary<object, SourceLocation>

UpdateSourceLocationMappingInDebuggerService() {

object rootInstance = GetRootInstance();

Dictionary<object, SourceLocation> sourceLocationMapping = new Dictionary<object, SourceLocation>();

Dictionary<object, SourceLocation> designerSourceLocationMapping =

new Dictionary<object, SourceLocation>();

if (rootInstance != null)

{

Activity documentRootElement = GetRootWorkflowElement(rootInstance);

SourceLocationProvider.CollectMapping(GetRootRuntimeWorkflowElement(), documentRootElement, sourceLocationMapping,

this.WorkflowDesigner.Context.Items.GetValue<WorkflowFileItem>().LoadedFile);

SourceLocationProvider.CollectMapping(documentRootElement, documentRootElement, designerSourceLocationMapping,

this.WorkflowDesigner.Context.Items.GetValue<WorkflowFileItem>().LoadedFile);

}

// Notify the DebuggerService of the new sourceLocationMapping.

// When rootInstance == null, it'll just reset the mapping.

//DebuggerService debuggerService = debuggerService as DebuggerService;

if (this.DebuggerService != null)

{

((DebuggerService)this.DebuggerService).UpdateSourceLocations(designerSourceLocat

ionMapping);

}

return sourceLocationMapping;

}

# region Helper Methods

object GetRootInstance() {

ModelService modelService =

this.WorkflowDesigner.Context.Services.GetService<ModelService>(); if (modelService != null)

{

return modelService.Root.GetCurrentValue(); }

else

{ return null;

}

}

40

// Get root WorkflowElement. Currently only handle when the object is

ActivitySchemaType or WorkflowElement.

// May return null if it does not know how to get the root activity. Activity GetRootWorkflowElement(object rootModelObject)

{

System.Diagnostics.Debug.Assert(rootModelObject != null, "Cannot pass null as rootModelObject");

Activity rootWorkflowElement; IDebuggableWorkflowTree debuggableWorkflowTree = rootModelObject as

IDebuggableWorkflowTree;

if (debuggableWorkflowTree != null) {

rootWorkflowElement = debuggableWorkflowTree.GetWorkflowRoot();

}

else // Loose xaml case. {

rootWorkflowElement = rootModelObject as Activity;

} return rootWorkflowElement;

}

Activity GetRuntimeExecutionRoot()

{

Activity root = ActivityXamlServices.Load("Workflow.xaml");

//Activity root = ActivityXamlServices.Load("Prompt.xaml"); WorkflowInspectionServices.CacheMetadata(root);

return root; }

Activity GetRootRuntimeWorkflowElement() {

Activity root = ActivityXamlServices.Load("Workflow.xaml");

//Activity root = ActivityXamlServices.Load("Prompt.xaml"); WorkflowInspectionServices.CacheMetadata(root);

IEnumerator<Activity> enumerator1 =

WorkflowInspectionServices.GetActivities(root).GetEnumerator(); //Get the first child of the x:class

enumerator1.MoveNext();

root = enumerator1.Current; return root;

}

void AddTrackingTextbox()

{

tx = new TextBox();

tx.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;

Grid.SetRow(tx, 1);

Label trackRecords = new Label();

trackRecords.FontSize = 11; trackRecords.FontWeight = FontWeights.Bold;

trackRecords.Content = "Tracking Records: ";

Grid.SetRow(trackRecords, 0); this.TrackingRecord.Children.Add(trackRecords);

this.TrackingRecord.Children.Add(tx);

41

//For Tracking Records displayed and to check which activity those

records corresponds to.

this.tx.SelectionChanged += new

RoutedEventHandler(textBox1_SelectionChanged); textLineToSourceLocationMap = new Dictionary<int, SourceLocation>();

} # endregion

}

}