Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de...
Transcript of Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de...
![Page 1: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/1.jpg)
Anexo de documentación
Autor: Daniel Hernández Jané
Tutor: Juan Carlos Hernández Palacín
![Page 2: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/2.jpg)
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
![Page 3: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/3.jpg)
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.
![Page 4: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/4.jpg)
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.
![Page 5: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/5.jpg)
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.
![Page 6: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/6.jpg)
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)
![Page 7: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/7.jpg)
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)
![Page 8: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/8.jpg)
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)
![Page 9: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/9.jpg)
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)
![Page 10: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/10.jpg)
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)
![Page 11: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/11.jpg)
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)
![Page 12: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/12.jpg)
11
2. Hojas de ruta (HR)
2.1. Convertidor ÖBB HR 1: subproceso � Pruebas y expedición.
HR 2: subproceso � Montaje.
![Page 13: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/13.jpg)
12
HR 3: subproceso � FK1 (Cable de mando).
HR 4: subproceso � FK2 (Cable de mando).
![Page 14: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/14.jpg)
13
HR 5: subproceso � FK3 (Cable de mando).
HR 6: subproceso � FK4 (Cable de mando).
HR 7: subproceso � FK5 (Cable de mando).
![Page 15: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/15.jpg)
14
HR 8: subproceso � FK Puentes.
HR 9: subproceso � Cables de potencia.
HR 10: subproceso � Premontajes.
![Page 16: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/16.jpg)
15
2.2. Convertidor CIVIA
HR 1: subproceso � Montaje, pruebas y expedición
HR 2: subproceso � FK1 (Cable de mando)
![Page 17: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/17.jpg)
16
HR 3: subproceso � FK2 (Cable de mando)
HR 4: subproceso � FK3 (Cable de mando)
HR 5: subproceso � FK Puentes
![Page 18: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/18.jpg)
17
HR 6: subproceso � Cables de potencia
HR 7: subproceso � Premontajes
![Page 19: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/19.jpg)
18
2.3. Convertidor Desiro
HR 1: subproceso � Montaje, pruebas y expedición
![Page 20: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/20.jpg)
19
HR 2: subproceso � FK1 (Cable de mando)
HR 3: subproceso � FK2 (Cable de mando)
![Page 21: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/21.jpg)
20
HR 4: subproceso � Cables de potencia
HR 5: subproceso � Premontajes
![Page 22: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/22.jpg)
21
3. Lista de materiales
Convertidor ÖBB � Extracto de materiales de montaje
![Page 23: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/23.jpg)
22
Convertidor ÖBB � Extracto de materiales de cables de mando
![Page 24: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/24.jpg)
23
Convertidor ÖBB � Extracto de materiales de FK puentes
![Page 25: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/25.jpg)
24
Convertidor ÖBB � Extracto de materiales de cables de potencia
![Page 26: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/26.jpg)
25
Convertidor ÖBB � Extracto de materiales de premontajes
![Page 27: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/27.jpg)
26
Convertidor CIVIA � Extracto de materiales de montaje
![Page 28: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/28.jpg)
27
Convertidor CIVIA � Extracto de materiales de cables de mando
![Page 29: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/29.jpg)
28
Convertidor CIVIA � Extracto de materiales de FK puentes
![Page 30: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/30.jpg)
29
Convertidor CIVIA � Extracto de materiales de cables de potencia
![Page 31: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/31.jpg)
30
Convertidor CIVIA � Extracto de materiales de premontajes
![Page 32: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/32.jpg)
31
Convertidor DESIRO � Extracto de materiales de montaje
![Page 33: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/33.jpg)
32
Convertidor DESIRO � Extracto de materiales de cables de mando y FK puentes
Convertidor DESIRO � Extracto de materiales de cables de potencia
![Page 34: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/34.jpg)
33
Convertidor DESIRO � Extracto de materiales de premontajes
![Page 35: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/35.jpg)
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; }
![Page 36: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/36.jpg)
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()
{
![Page 37: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/37.jpg)
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");
}
![Page 38: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/38.jpg)
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)
{
![Page 39: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/39.jpg)
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)
![Page 40: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/40.jpg)
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;
}
}
![Page 41: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/41.jpg)
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);
![Page 42: Anexo de documentación de... · Lista de materiales ... 1.1. Convertidor ÖBB Figura 1: ejemplo de orden de fabricación extraída de SAP, pestaña general. Figura 2: ejemplo de](https://reader033.fdocuments.ec/reader033/viewer/2022060706/60725e6dce39da4b0848c0d7/html5/thumbnails/42.jpg)
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
}
}