SlideShare une entreprise Scribd logo
1  sur  184
Windows Workflow Foundation 28 Gennaio 2012 Felice Pescatore – felice.pescatore@gmail.com www.felicepescatore.it  - www.storiainformatica.it felice.pescatore @felicepescatore Felice Pescatore
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Conclusioni
[object Object],[object Object],[object Object],[object Object],[object Object],Chi sono e di cosa mi occupo Attualmente lavoro presso la  Microgame Spa  di Benevento, società specializzata nella realizzazione di piattaforme per il gambling (scommesse) online, dove mi occupo di architetture di integrazione con partner esteri.
Parte Prima I WORKFLOW
Il mondo dei Workflow ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Prima
Il mondo dei Workflow ,[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Prima
[object Object],Il mondo dei Workflow Windows Workflow Foundation  Parte Prima
Il mondo dei Workflow Windows Workflow Foundation  Parte Prima Coordinamento  di attività (work) eseguite da software e/o persone Gestione ottimale di processi  long running and stateful   Ciclo di vita  trasparente e dincamico Modelli estensibili ( extensible models)
[object Object],Il mondo dei Workflow Windows Workflow Foundation  Parte Prima
Il mondo dei Workflow: processi Long Running ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Prima 1 2 3 4 5
Il mondo dei Workflow: sulla carta…. Windows Workflow Foundation  Parte Prima
…  sul calcolatore Windows Workflow Foundation  Parte Prima
Il mondo dei Workflow: l’approccio Dichiarativo ,[object Object],Windows Workflow Foundation  Parte Prima
Parte Seconda I WORKFLOW NEL MONDO .NET Windows Workflow Foundation  Parte Seconda
[object Object],Workflow nel mondo .NET Windows Workflow Foundation  Parte Seconda
[object Object],[object Object],Workflow nel mondo .NET COSA E NON COME Windows Workflow Foundation  Parte Seconda
Windows Workflow Foundation ,[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Windows Workflow Foundation Windows Workflow Foundation  Parte Seconda Workflow Foundation .NET  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Un unico ambiente che consente di fattorizzare I propri investimenti in know-how e in sviluppo ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Windows Workflow Foundation: il Runtime Windows Workflow Foundation  Parte Seconda
Windows Workflow Foundation http://tinyurl.com/38g64k The  workflow framework and tools  for Microsoft products and partner/customer ecosystem ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Windows Workflow Foundation Architecture Key Concepts ,[object Object],[object Object],[object Object],[object Object],Components ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda Host Process Windows Workflow Foundation Runtime Engine workflow activity Runtime Services Base Activity Library Custom Activity Library Visual Designer
[object Object],Windows Workflow Foundation Windows Workflow Foundation  Parte Seconda
Windows Workflow Foundation Runtime Unleashed Host Application App Domain SQL Out of Box Services  per la comunicazione con SQL Server 2000, 2005, 2008 Servizi Comuni  per la gestione dei thread, dei timer e delle tranazioni PersistenceService , salvataggio e ripristino di istanze TrackingService  manages profiles and stores tracked information. Runtime Services PersistenceService TrackingService SchedulerService TransactionService Windows Workflow Foundation  Parte Seconda Services
Windows Workflow Foundation Runtime ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Windows Workflow Foundation Runtime Windows Workflow Foundation  Parte Seconda Workflow Runtime Properties Property Purpose IsStarted Used to determine whether the workflow runtime has been started and is ready to accept workflow instances.  IsStarted  is  false  until the host calls  StartRuntime . It remains  true  until the host calls  StopRuntime .  Name Gets or sets the name associated with the  WorkflowRuntime . You cannot set  Name  while the workflow runtime is running (that is, when  IsStarted  is  true ). Any attempt to do so will result in an  InvalidOperationException . Workflow Runtime Methods AddService  Adds the specified service to the workflow runtime. There are limitations regarding what services can be added as well as when.  CreateWorkflow  Creates a workflow instance, including any specified (but optional) parameters. If the workflow runtime has not been started, the  CreateWorkflow  method calls  StartRuntime .  GetWorkflow  Retrieves the workflow instance that has the specified workflow instance identifier (which consists of a Guid). If the workflow instance was idled and persisted, it will be reloaded and executed.  StartRuntime  Starts the workflow runtime and the workflow runtime services and then raises the  Started  event.  StopRuntime  Stops the workflow runtime and the runtime services and then raises the  Stopped  event.
Windows Workflow Foundation Runtime Windows Workflow Foundation  Parte Seconda Events Purpose Started  Raised when the workflow runtime is started.  Stopped  Raised when the workflow runtime is stopped.  WorkflowCompleted  Raised when a workflow instance has completed.  WorkflowIdled  Raised when a workflow instance enters the idle state. When workflow instances go idle, you have the opportunity to unload them from memory, store them in a database (in case they’re waiting for a long-running task), and bring them back into memory at a later time.  WorkflowTerminated  Raised when a workflow instance is terminated. The workflow can be terminated by the host through a call to the  Terminate  method of a workflow instance, by a  Terminate  activity, or by the workflow runtime when an unhandled exception occurs.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Visual Studio e WFF Windows Workflow Foundation  Parte Seconda
[object Object],WF: Ma cos’è a livello di codice .NET? using System.Workflow.Activities; public class MyWorkflow: SequentialWorkflow  { … } <?Mapping XmlNamespace=&quot;Activities&quot; ClrNamespace=&quot;System.Workflow.Activities&quot; Assembly=&quot;System.Workflow.Activities&quot; ?> <SequentialWorkflow x:Class=&quot;MyWorkflow&quot; xmlns=&quot;Activities&quot; xmlns:x=&quot;Definition&quot;> … </SequentialWorkflow> ma può anche essere «dichiarativo» tramite XML: Windows Workflow Foundation  Parte Seconda
WF is… ART! ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Windows Workflow Foundation 4 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Windows Workflow Foundation 4: Data Windows Workflow Foundation  Parte Seconda
Hello Workflow ,[object Object],by design…. Windows Workflow Foundation  Parte Seconda
Hello Workflow ,[object Object],namespace HelloCodeWorkflow {  class Program {  static void Main(string[] args) {  WorkflowInvoker.Invoke(new HelloWorkflow());  }  }  public class HelloWorkflow:Activity {  public HelloWorkflow() {  this.Implementation = () => new Sequence {  Activities = {  new WriteLine(){Text=&quot;Hello Workflow&quot;}  }  };  }  }  }  by code…. Windows Workflow Foundation  Parte Seconda
Parte Seconda I Workflow nel mondo .NET:  IMPERATIVE CODE vs. DECLARATIVE DESIGN Windows Workflow Foundation  Parte Seconda
WF: Un modello misto, dichiarativo e imperativo ,[object Object],[object Object],[object Object],Solo Markup ( Dichiarativo ) Markup e Codice Solo Codice (Imperativo) Generato da  Applicazioni Terze Composto da soli TAG XML che definiscono sia la struttura logica che il flusso dati ,[object Object],[object Object],Struttura e flusso  dati definiti attraverso uno dei linguaggi del  framework App crea l’albero delle activity e lo serializza Workflow Compiler wfc.exe C#/VB Compiler Windows Workflow Foundation  Parte Seconda XML C#/VB XML C#/VB XML C#/VB
WF: modello Dichiarativo vs. modello Imperativo Windows Workflow Foundation  Parte Seconda
WF: modello Dichiarativo vs. modello Imperativo Windows Workflow Foundation  Parte Seconda
WF: modello Dichiarativo vs. modello Imperativo Windows Workflow Foundation  Parte Seconda
WF: modello Dichiarativo vs. modello Imperativo public static Activity GetWF() {          Variable<string> var =  new Variable<string>(&quot;var&quot;, &quot;hello workflow&quot;);          return new Sequence {              Variables = { var },              Activities ={                  new WriteLine{Text=&quot;Workflow Started&quot;},                  new WriteLine{Text=new InArgument<string>(var)},                  new WriteLine{Text=&quot;Workflow Ended&quot;}              }          };      } Sequence activity  Windows Workflow Foundation  Parte Seconda
WF: modello Dichiarativo vs. modello Imperativo public class MyCodeWorkflow : Activity { public InArgument<string> inMSG { get; set; } public OutArgument<string> outMSG { get; set; } public MyCodeWorkflow() { this.Implementation = () => new Sequence { Activities = { new WriteLine{ Text=new InArgument<string>( (activityContext)=>this.inMSG.Get(activityContext) ) }, new Assign<string>{ To=new ArgumentReference<string>(&quot;outMSG&quot;), Value=new InArgument<string>( (activityContext)=>this.inMSG.Get(activityContext) ) } }};} } //host static void Main(string[] args) { IDictionary<string, object> input = new Dictionary<string, object>(); input.Add(&quot;inMSG&quot;,&quot;hello&quot;); IDictionary<string, object> output = new Dictionary<string, object>(); MyCodeWorkflow activity = new MyCodeWorkflow(); output = WorkflowInvoker.Invoke(activity,input); Console.WriteLine(output[&quot;outMSG&quot;]);  } Code Workflow  Windows Workflow Foundation  Parte Seconda
WF: modello Dichiarativo vs. modello Imperativo public static DynamicActivity GetWF()  {  return new DynamicActivity()  {  Implementation = () => new  Sequence()  { Activities  = { new WriteLine(){Text=&quot;Hello Workflow&quot;}  }  }  };  }  Dynamic Activity  Permette di creare una nuova istanza di workflow a runtime senza la necessità di definire direttamente il wf. Windows Workflow Foundation  Parte Seconda
WF: modello Dichiarativo vs. modello Imperativo ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Da Codice (C#) a Desisgner (XAMLX) Chi ha deciso di sviluppare il proprio workflow (WF4) direttamente da codice, può convertire rapidamente il proprio lavoro in XAMLX in modo da vederlo nel designer. L’istruzione da usare è la seguente: XamlServices.Save(@&quot;...emo.xaml&quot;, workflow), dove workflow è definito come, ad esempio, nello spezzone di codice seguente: Windows Workflow Foundation  Parte Seconda
Parte Seconda I Workflow nel mondo .NET:  TIPOLOGIE DI WORKFLOW Windows Workflow Foundation  Parte Seconda
Workflow Types Windows Workflow Foundation  Parte Seconda Type Meaning Sequenziali I task sono eseguiti autonomamente con la possibilità di piccole variazioni del path. La Root Activity di riferimento è  SequentialWorkflow . State-machine, similare ad un grafo   I  task del Workflow dipendono da eventi esterni che ne guidano l’evoluzione. La Root Activity di riferimento è  StateMachineWorkflow. Flowchart Pensati per il mapping 1:1 dei flowchart di progetto. La Root Activity di riferimento è  Flowchart Rules-based   Pensati per risolvere problemi elevata complessità che non possono essere risolti con i modelli precedenti. I Rules-based workflow possono avere come Root Activity indistintamente quelle precedenti.
Workflow Types:  Sequential Workflow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Workflow Types:  FlowChart ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Workflow Types: State Machine ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Workflow Types: State Machine Windows Workflow Foundation  Parte Seconda
State Machine Workflow:  il  dilemma di casa Redmond ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Esempio di processo di approvazione Windows Workflow Foundation  Parte Seconda
Demo: Simple Workflow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Parte Seconda I Workflow nel mondo .NET:  ACTIVTIES Windows Workflow Foundation  Parte Seconda
[object Object],Windows Workflow Foundation: Activites Windows Workflow Foundation  Parte Seconda
[object Object],Windows Workflow Foundation: Activites Windows Workflow Foundation  Parte Seconda
[object Object],Windows Workflow Foundation: Activites Windows Workflow Foundation  Parte Seconda
[object Object],Windows Workflow Foundation: Activites Windows Workflow Foundation  Parte Seconda
Activites: i mattoncini lego di WWF ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
[object Object],[object Object],[object Object],[object Object],Anche il Workflow stesso è un Activity! Windows Workflow Foundation  Parte Seconda
Activites:  un approccio estendibile ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Base Activity Library Custom Activity Libraries Out-of-Box Activities Windows Workflow Foundation  Parte Seconda Author new  activity Extend  activity Compose  activities ,[object Object],[object Object],Domain-Specific Workflow Packages Compliance RosettaNet CRM IT Mgmt
Activity:  Stati  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda Inizializzazione Esecuzione Chiusura Compensazione Cancellazione Tipo di transizioni Activity Runtime
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Activites:  esecuzione Windows Workflow Foundation  Parte Seconda
Activites:  schedulazione I Work Item sono eseguiti uno alla volta per singola istanza del workflow Alcuni Work Item sono aggiunti all’inizio della coda di esecuzione, altri alla fine Windows Workflow Foundation  Parte Seconda while !EmptyList Execute(next WorkItem)
[object Object],[object Object],[object Object],[object Object],[object Object],Activites:  Custom Activities Semplicità Flessibilità Code Activity InvokeMethod & EventSink Custom Activities InvokeWebService Activity Workflow Execution Logic Windows Workflow Foundation  Parte Seconda
Activites:  Namespace System.Activities Windows Workflow Foundation  Parte Seconda
Activites:  Proprietà Windows Workflow Foundation  Parte Seconda Property Purpose Description   Gets or sets the user-defined description of the activity.  Enabled   Gets or sets a value that indicates whether this instance is enabled for execution and validation.  ExecutionResult   Gets the  ActivityExecutionResult  of the last attempt to run this instance ( Canceled ,  Compensated ,  Faulted ,  None , and  Succeeded ).  ExecutionStatus   Gets the status of the workflow in the form of one of the  ActivityExecutionStatus   values ( Canceling ,  Closed ,  Compensating ,  Executing ,  Faulting , and  Initialized ).  Name   Gets or sets the name of this activity instance.  Parent   Gets the activity that encloses this activity.  WorkflowInstanceId   Gets the workflow instance identifier associated with this activity.
Activites:  Metodi Windows Workflow Foundation  Parte Seconda Method Purpose Cancel   Cancels the execution of an activity.  Clone   Returns a deep copy of the activity (“deep copy” means the clone contains all of the internal data from the cloned activity).  Execute   Synchronously runs the activity.  GetActivityByName   If executed on a composite activity, this method returns the named activity if it is contained by the composite activity.  Load   Loads an instance of an activity from a stream.  RaiseEvent   Raises an event associated with the specified  DependencyProperty .  RaiseGenericEvent<T>   Raises the event associated with the referenced  DependencyProperty . The effect of  RaiseEvent  and  RaiseGenericEvent  is the same—fire an event.  RaiseEvent  uses the dependency property directly, while  RaiseGenericEvent  is the generic (templated) version.  Save   Saves a copy of the activity to a stream.
Activites:  Activity Composition ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
CodeActivity (high level)  vs. NativeActivity (lowest level) CODE ACTIVITY NATIVE ACTIVITY per la creazione di semplici Custom Activity per la creazione di complesse Custom Activity Una  CustomActivity  estende WF creando un’unità atomica di esecuzione. Windows Workflow Foundation  Parte Seconda
Activites:  CodeActivity (high level)  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Activites:  CodeActivity (high level)  public class DoubleActivity : CodeActivity { public InArgument<int> Value {get; set;} public OutArgument<int> Double {get; set;} protected ovveride void Execute(CodeActivityContext context) { Double.Set(context, Value.Get(context) * 2); } } public class DoubleActivity : CodeActivity<int> { public InArgument<int> Value {get; set;} protected ovveride int Execute(CodeActivityContext context) { return Value.Get(context) * 2; } } Windows Workflow Foundation  Parte Seconda
Activites:  Native Activity (lowest level) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Activites:  Native Activity (lowest level) public class ReadString: NativeActivity { public OutArgument<string> Name {get; set;} protected override CanInduceIdle {get; {return true;} } protected ovveride void Execute(ActivityExecutionContext context) { context.CreateNamedBookmark(«input», new  BookmarkCallback(this.OnBookmarkCallback)); } private void OnBookmarkCallback(ActivityExecutionContext context, Bookmark  bookmark, object obj) { this.Name.Set(context, (string), obj); } } workflowApp.Run() string text = Console.ReadLine(); workflowApp.ResumeBookmark(«input», text,); syncEvent.WaitOne(); Windows Workflow Foundation  Parte Seconda
Activites:  ActivityDelegate ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda Process Order Receive Order Reserve Inventory Ship Order Approval Payment
Parte Seconda I Workflow nel mondo .NET:  ACTIVITIES ASICONCRONE
Activities Asincrone Windows Workflow Foundation  Parte Seconda
[object Object],Activities Asincrone Parallel  p = new  Parallel { Branches = { new  WriteToFile  { FileName = &quot;a&quot;, Bytes = … }, new  WriteToFile  { FileName = &quot;b&quot;, Bytes = … } } }; WorkflowInvoker.Invoke(p); Windows Workflow Foundation  Parte Seconda
Activities I Workflow nel mondo .NET:  BUILT-IN ACTIVITIES
Built-in Activities: Control flow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Built-in Activities: Control flow ,[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Built-in Activities: Flowchart ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Built-in Activities: Messaging ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Built-in Activities: Messaging, Known Type ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Built-in Activities: Runtime ,[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Built-in Activities: State Machine* ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],*Presente in WF3.5, in WF4.0 bisogna scaricare l’estensione da Codeplex, reintrodotto in WF4.5 Windows Workflow Foundation  Parte Seconda
Built-in Activities: Primitives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Built-in Activities: Transaction ,[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Transazioni in Windows Workflow ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Transazioni in Windows Workflow: Compensazione Long-running workflow Atomic Transaction Get Item De-queue Item Queue DB Queue DB Compensation Handler Queue Item Queue DB Normale esecuzione Logica di Compensazione Eseguita solo in caso di errore o di cancellazione della stessa Windows Workflow Foundation  Parte Seconda
Compensating Flow Long-running workflow Atomic Transaction 1 Compensation Handler 1 Re-queue Item DB Atomic Transaction 2 Process Item DB Get Item De-queue Item DB DB ,[object Object],[object Object],Windows Workflow Foundation  Parte Seconda Compensation Handler 2 Cleanup Item DB
Built-in Activities: Data ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Built-in Activities: Collection ,[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Built-in Activities: Migration ,[object Object],Windows Workflow Foundation  Parte Seconda
Parte Seconda DEMO! Windows Workflow Foundation  Parte Seconda
Parte Seconda I Workflow nel mondo .NET:  BUILT-IN ACTIVITIES - REHOSTING WORKFLOW DESIGNER Windows Workflow Foundation  Parte Seconda
Rehosting the Workflow Designer in WF4 ,[object Object],Windows Workflow Foundation  Parte Seconda
Rehosting the Workflow Designer in WF4 ,[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Rehosting the Workflow Designer in WF4 ,[object Object],[object Object],[object Object],workflowDesigner = new WorkflowDesigner(); _workflowDesigner.Load(_fileName);  var view = _workflowDesigner.View; Grid.SetColumn(view, 1); Grid.SetRow(view, 1); LayoutGrid.Children.Add(view);  var propInspector = _workflowDesigner.PropertyInspectorView; Grid.SetColumn(propInspector, 2);  Grid.SetRow(propInspector, 1); LayoutGrid.Children.Add(propInspector); Lo step successivo è quello di registrare i metadata, ma è necessaria per utilizzare le activity in modo espanso. new DesignerMetadata().Register(); Windows Workflow Foundation  Parte Seconda
Rehosting the Workflow Designer in WF4 ,[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Rehosting the Workflow Designer in WF4 Ora, aggiungere la ToolBox al proprio progetto: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Rehosting the Workflow Designer in WF4 …  aggiungiamo il codice per visualizzare l’Activity correntemente selezionata ed i relativi «figli»,  registrando l’handler: _workflowDesigner.Context.Items.Subscribe<Selection>(SelectionChanged); ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ed implementandone il codice: Windows Workflow Foundation  Parte Seconda
Rehosting the Workflow Designer in WF4 …  ed ora il codice per la validazione del workflow. Registriamo l’handler che cattura gli eventi di modifica: var validationErrorService = new ValidationErrorService(WorkflowErrors.Items);_workflowDesigner.Context.Services.Publish<IValidationErrorService>(validationErrorService); ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ed implementandone il codice (dando un corpo alla  IValidationErrorService : Windows Workflow Foundation  Parte Seconda
Rehosting the Workflow Designer in WF4 …  eseguiamo il nostro applicativo! ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Parte Seconda DEMO! workflowdesigner_embedded.zip Windows Workflow Foundation  Parte Seconda
Parte Seconda I Workflow nel mondo .NET:  ESECUZIONE DI UN WORKFLOW Windows Workflow Foundation  Parte Seconda
Esecuzione di un Workflow ,[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Esecuzione di un Workflow: WorkflowInvoker ,[object Object],[object Object],[object Object],[object Object],[object Object],var workflow = new HelloWorkflow(); workflow.DisplayName = «Hello Workflow»; var output = WorkflowInvoker.Invoke(workflow); PrintOutput(output); Windows Workflow Foundation  Parte Seconda
Esecuzione di un Workflow: WorkflowApplication ,[object Object],[object Object],[object Object],[object Object],[object Object],var workflow = new HelloWorkflow(); workflow.DisplayName = «Hello Workflow»; var wa= new WorkflowApplication(workflow); wa.Completed => PrintOutput(e.Outputs); wa.Run(); Windows Workflow Foundation  Parte Seconda
Esecuzione di un Workflow: WorkflowServiceHost ,[object Object],[object Object],[object Object],[object Object],var workflow = new HelloWorkflowService(); var baseAddress = new Uri(«http://localhost/HelloWorkflow»); var wsh = new WorkflowServiceHost(workflow, baseAddress); wsh.Open(); Console.WriteLine(«The WorkflowSertvice is listening.»); Console.ReadLine(); wsh.Close(); Torneremo successivamente ed approfonditamente sui Workflow Service Windows Workflow Foundation  Parte Seconda
Hosted Workflow  and WorkflowService ,[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Seconda
Parte Terza WORKFLOW SERVICES Windows Workflow Foundation  Parte Terza
[object Object],Workflow Service Windows Workflow Foundation  Parte Terza
Workflow Service ,[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Terza
Workflow Service ,[object Object],Windows Workflow Foundation  Parte Terza WF  Runtime WCF Client
[object Object],Workflow Service Windows Workflow Foundation  Parte Terza
Workflow Service Windows Workflow Foundation  Parte Terza
Workflow Service: un mondo di servizi… XAML ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Terza ACTIVITIES ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Workflow Service: goals ,[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Terza
[object Object],Workflow Service Windows Workflow Foundation  Parte Terza
WCF E WF 4 Environment Runtime Databases Windows Workflow Foundation  Parte Terza Windows Server .NET Framework Windows Server AppFabric Services Management Tools IIS/WAS Workflows Persistence Monitoring Hosting Persistence Caching Monitoring IIS Manager Modules PowerShell
WF Service Components Persistence (Instances) Monitoring Activity Library Receive Send ... WCF Layer Windows Workflow Foundation  Parte Terza Workflow Service Host Management Endpoint Persistence Behavior Tracking Behavior
WF Service: coordinazione di chiamate asincrone a servizi Add/Remove Item Calculate Best Price Get Price Get Price Windows Workflow Foundation  Parte Terza Supplier One Service Supplier Two Service Best Price Workflow Service Purchase Service
WF Service Demo ,[object Object],[object Object],Windows Workflow Foundation  Parte Terza
WF Service: CONTEXT e DATA Correlation ,[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Terza
WF Service: CONTEXT  BASED CORRELATION 1. Start 3. Send (key 3) 4. Receive (key 3) Receive Send Receive Persistence DB (Instances) 2. Save (key 3) 5. Load (key 3) 6.Complete Instance 123  |  data 456  |  data 789  |  data A11  |  data Key 123  |  key 1 456  |  key 2 789  |  key 3 A11  |  key 4 create correlation key3 Windows Workflow Foundation  Parte Terza Workflow Service
WF Service: CONTENT  BASED CORRELATION Persistence DB (Instances) Instance 123  |  data 456  |  data 789  |  data A11  |  data Key 123  |  userid 1 456  |  userid 2 789  |  userid 3 A11  |  userid4 1. Add item (userId 3) 3. View items (userId 3) 5. Best Price (userId 3) Receive Receive Receive 2. Save (userId 3) 4. Load (userId 3) 6. Load (userId 3) create correlation  Windows Workflow Foundation  Parte Terza
WF Service: CONTENT  BASED CORRELATION le limitazioni del Designer ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Terza
WF Service: CONTENT  BASED CORRELATION le limitazioni del Designer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Terza
WF Service: CONTENT  BASED CORRELATION le limitazioni del Designer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte Terza
WF Service Demo ,[object Object],[object Object],Windows Workflow Foundation  Parte Terza
Parte Quarta ASPETTI AVANZATI Windows Workflow Foundation  Parte  Quarta
Parte Quarta Aspetti Avanzati : ERROR HANDLING, EXCEPTION e FAULT Windows Workflow Foundation  Parte  Quarta
Built-in Activities: Error Handling ,[object Object],[object Object],[object Object],Il ramo FINALLY dell’Activity Try/Catch non si comporta come l’omonima istruzione dei linguaggi: praticamente viene eseguita solo se viene eseguito il  blocco try  o uno dei  blocchi catch .  Se si verifica un’eccezione non catturata, neanche il Finally verrà eseguito causando l’Abort del Flow. Nel caso di Fault da Servizio (Send/Recive Activity) l’attuale implementazione dell’Activity di Try/Catch è in grado di gestire solo la base class FaultExeception e non la generica FaultEception<MyFault>. Se si prova a catturare quest’ultima l’eccezione verrà propagata.   Suggerimento : se si è anche autori del servizio che può generare il Fault, utilizzare uno dei parametri standard di FaultException (ad esempio Action) per individuare l’eccezione specifica. Windows Workflow Foundation  Parte  Quarta
WF Service: Fatal and NonFatal Error ,[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quarta
WF Service: Fatal Error ,[object Object],Windows Workflow Foundation  Parte  Quarta
WF Service: FATAL ERROR ,[object Object],Windows Workflow Foundation  Parte  Quarta
WF Service: NON FATAL ERROR ,[object Object],Windows Workflow Foundation  Parte  Quarta
Parte Quarta Aspetti Avanzati: WINDOWS SERVER APPFABRIC MONITORING,PERSISTENZA e CACHE Windows Workflow Foundation  Parte  Quarta
Windows Server AppFabric ,[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quarta You are Here
Windows Server AppFabric: Architettura  Persistence Database Windows Workflow Foundation  Parte  Quarta IIS Worker Process AppFabric Hosting Services IIS Manager AppFabric Caching Services Cache Server Cache Server ASP.NET WF & WCF Apps Windows Apps Cache Client Monitoring Database Cache Config Cache Client Cache Server
Parte Quarta Windows Server AppFabric MONITORING Windows Workflow Foundation  Parte  Quarta
AppFabric Hosting Services : Monitoring ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quarta
AppFabric Hosting Services : Monitoring Persistence Database Windows Workflow Foundation  Parte  Quarta IIS Worker Process IIS Manager WF & WCF Apps Monitoring Database ISV Apps ASP.NET Apps Event Tracing for Windows (ETW) AppFabric  Extensions
AppFabric Hosting Services : Monitoring, ECS Windows Server AppFabric Monitoring Database Monitoring Tools ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quarta Workflow Service  Event Collector Service WCF Trace Tracking Participant Tracking Profile
Parte Quarta Windows Server AppFabric PERSISTENZA e VERSIONING Windows Workflow Foundation  Parte  Quarta
[object Object],[object Object],[object Object],[object Object],[object Object],AppFabric Hosting Services : Persistenza Windows Workflow Foundation  Parte  Quarta
AppFabric Hosting Services : Persistenza AppFabric  Extensions SQL Workflow  Instance Store Windows Workflow Foundation  Parte  Quarta Client Persistence Store Monitoring Database IIS Manager Workflow Service WF WCF IIS Worker Process
[object Object],[object Object],[object Object],[object Object],[object Object],AppFabric Hosting Services : Persistenza Windows Workflow Foundation  Parte  Quarta
Workflow: Stati in relazione alla Persistenza ,[object Object],[object Object],Running Active  -  In Memory Idle –  Persisted ,[object Object],[object Object],[object Object],[object Object],Completed Suspend Resume ,[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quarta
AppFabric Hosting Services :  Cosa viene salvato con la persistenza? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quarta
AppFabric Hosting Services : WF Definiton PARALLEL ■ DateTime d int n string s private int index private int index Windows Workflow Foundation  Parte  Quarta
AppFabric Hosting Services : WF Serialized Data PARALLEL ■ DateTime d int n string s private int index private int index “ hello” 3 Bookmark:“x” Windows Workflow Foundation  Parte  Quarta INPUT
AppFabric Hosting Services :  Versioning! ,[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quarta
AppFabric Hosting Services :  Versioning, Rounting Workaround! ,[object Object],[object Object],Questa soluzione in un contesto reale è però assolutamente inapplicabile perché costringere il client ad aggiornare ogni volta il proxy. Windows Workflow Foundation  Parte  Quarta
AppFabric Hosting Services :  Versioning, Rounting Workaround! ,[object Object],Come accade questa magia? Beh, come sempre, i modi sono diversi, ma il più semplice è quello di far ritornare in seguito alla prima invocazione il «version number» della definizione e riutilizzarlo per tutte le relative chiamate successive. Se non è presente un  «version number», la richiesta viene indirizzata sempre all’ultima definizione, creando una nuova istanza. Windows Workflow Foundation  Parte  Quarta
AppFabric Hosting Services :  Versioning, Rounting Workaround! ,[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quarta
Bookmarks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quarta
Bookmark Resumption Windows Workflow Foundation  Parte  Quarta “ Please deliver [data] to instance [id] at bookmark [name]”
AppFabric Hosting Services : Persistenza e Load Balancer Windows Workflow Foundation  Parte  Quarta Windows  Server  AppFabric Windows  Server AppFabric Load Balancer Persistence DB Workflow  Service Workflow  Service Workflow Management Service Workflow Management Service Windows  Server  AppFabric Workflow  Service Workflow Management Service Instance 123  |  data 456  |  data 789  |  data 011  |  data
Parte Quarta Windows Server AppFabric CACHING Windows Workflow Foundation  Parte  Quarta
AppFabric Caching Services Windows Workflow Foundation  Parte  Quarta IIS Worker Process AppFabric Caching Services Cache Server Cache Server ASP.NET WF & WCF Apps Windows Apps Cache Client Cache Config Cache Client Cache Server
High Availability Cache Server Cached Data Your app Local Cache Cache Server Cached Data Cached Data Windows Workflow Foundation  Parte  Quarta Cache Server
Session State Session State Provider Session State Provider Session State Provider Windows Workflow Foundation  Parte  Quarta Web Server Web Server Web Server AppFabric Caching Services Cache Server Cache Server Cache Server App 1 2 1 2 App App Browser 1 Browser 2
Parte Quinta SECURITY:  introduzione a WIF – WINDOWS IDENTITY FOUNDATION Windows Workflow Foundation  Parte  Quinta
Claims-Based Security ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quinta
Claims-Based Security Trust Read Policy Read Policy Authenticate Get Token Send Token (claims) Sessione Relying Party (RP)  (applicazioni riconosciute) Identity Provider (IP-IDP) ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quinta Claims Processing Application Logic Security Token Service
Claims-Based Security: Windows Identity Foundation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quinta
Claims-Based Security: Security Token Services https://testserver/sts http://localhost/ sts  Locale Test Produzione Windows Workflow Foundation  Parte  Quinta https://Productionserver/sts
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Claims-Based Security: Sviluppo del servizio STS Windows Workflow Foundation  Parte  Quinta
[object Object],[object Object],Claims Based Security: ws2007FederationHttpBinding Windows Workflow Foundation  Parte  Quinta
Claims-Based Security: accesso ai Claim Claims Issuer Value ClaimType ValueType OriginalIssuer Windows Workflow Foundation  Parte  Quinta IClaimsIdentity Delegate IIdentity AuthenticationType IsAuthenticated Name IClaimsIdentity IClaimsIdentity Subject Identity
Claims-Based Security: accesso ai Claim void Page_Load(object sender, EventArgs e)  { IClaimsPrincipal icp = (IClaimsPrincipal) Thread.CurrentPrincipal; IClaimsIdentity claimsIdentity =  (IClaimsIdentity)icp.Identity; ageClaimValue = (from c in claimsIdentity.Claims  where c.ClaimType == &quot;http://MyNS/AgeClaim&quot;  select c.Value ).Single(); } Windows Workflow Foundation  Parte  Quinta
Parte Quinta Security WFF e WIF Windows Workflow Foundation  Parte  Quinta
WFF e WIF ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quinta
WFF e WIF: WF Security Pack ,[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quinta
WFF e WIF: WF Security Pack ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quinta
WFF e WIF: Scenario, pt1 NB: per accedere direttamente al BootStrapToke(RAW) come parte di  IClaimsIdentity , è necessario configurare il parametro  SaveBootstrapToken  a TRUE. Windows Workflow Foundation  Parte  Quinta
WFF e WIF: Scenario, pt2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Quinta
Parte Finale Conclusioni e Prossimi Sviluppi Windows Workflow Foundation  Parte  Finale
Evoluzione della specie ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Finale
Sommario ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Windows Workflow Foundation  Parte  Finale
Libreria Windows Workflow Foundation  Parte  Finale Escluso MSDN, la casa di Redmond latita un po' su testi e materiale ufficiale inerente WWF
Blog e Riferimenti Windows Workflow Foundation  Parte  Finale http://zamd.net/ Zulfiqar's weblog -  WCF/WF/AppFabric & random .Net stuff Ron Jacobs -  Windows Workflow Foundation http://blogs.msdn.com/b/rjacobs/ The Problem Solver http://msmvps.com/blogs/theproblemsolver/archive/tags/Workflow/default.aspx Riferimenti http ://dotnetside.org/blogs/articoli/pages/introduzione-a-windows-workflow-foundation-4.aspx http://www.slideshare.net/dannicola/wf-40-overview http://www.slideshare.net/markginnebaugh/microsoft-windows-server-appfabric http://blogs.msdn.com/b/rjacobs/ http://msdn.microsoft.com/it-it/magazine/gg598919.aspx http://xhinker.com/post/WF4Authoring-Workflows-Using-Imperative-Code.aspx
Domande? Windows Workflow Foundation  Parte  Finale
Windows Workflow Foundation  Parte  Finale Chi non riesce più a provare stupore e meraviglia è già come morto e i suoi occhi sono incapaci di vedere. ..:: Albert Einstein ::..

Contenu connexe

Similaire à Windows Workflow Foundation 4

Introduzione a Workflow Foundation
Introduzione a Workflow FoundationIntroduzione a Workflow Foundation
Introduzione a Workflow FoundationDotNetMarche
 
Integrazione continua con TFS Build
Integrazione continua con TFS BuildIntegrazione continua con TFS Build
Integrazione continua con TFS BuildGian Maria Ricci
 
Automazione dei processi con SharePoint e josh
Automazione dei processi con SharePoint e joshAutomazione dei processi con SharePoint e josh
Automazione dei processi con SharePoint e joshit Consult
 
Webcast - Introduzione a Visual Studio Online
Webcast - Introduzione a Visual Studio OnlineWebcast - Introduzione a Visual Studio Online
Webcast - Introduzione a Visual Studio OnlineDavide Benvegnù
 
Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...
Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...
Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...italianaSoftware
 
Rich client application: MVC4 + MVVM = Knockout.js
Rich client application: MVC4 + MVVM = Knockout.jsRich client application: MVC4 + MVVM = Knockout.js
Rich client application: MVC4 + MVVM = Knockout.jsGiorgio Di Nardo
 
Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte
 
Progetto e implementazione di una pipeline di sviluppo software con tecnologi...
Progetto e implementazione di una pipeline di sviluppo software con tecnologi...Progetto e implementazione di una pipeline di sviluppo software con tecnologi...
Progetto e implementazione di una pipeline di sviluppo software con tecnologi...Mattia Milleri
 
Esposizione RIA
Esposizione RIAEsposizione RIA
Esposizione RIAdiodorato
 
La piattaforma josh - Scenario strategico della piattaforma software di it Co...
La piattaforma josh - Scenario strategico della piattaforma software di it Co...La piattaforma josh - Scenario strategico della piattaforma software di it Co...
La piattaforma josh - Scenario strategico della piattaforma software di it Co...it Consult
 
Alm pills - Sessione community tour Dot Net Umbria 2011
Alm pills - Sessione community tour Dot Net Umbria 2011Alm pills - Sessione community tour Dot Net Umbria 2011
Alm pills - Sessione community tour Dot Net Umbria 2011Gian Maria Ricci
 
Introduzione a Ruby On Rails
Introduzione a Ruby On RailsIntroduzione a Ruby On Rails
Introduzione a Ruby On RailsLuca Mearelli
 
Win05 accesso ai dati in win 8
Win05   accesso ai dati in win 8Win05   accesso ai dati in win 8
Win05 accesso ai dati in win 8DotNetCampus
 
Rendere flessibili e trasformare architetture IT di vecchio tipo: passaggio d...
Rendere flessibili e trasformare architetture IT di vecchio tipo:passaggio d...Rendere flessibili e trasformare architetture IT di vecchio tipo:passaggio d...
Rendere flessibili e trasformare architetture IT di vecchio tipo: passaggio d...Emanuele Della Valle
 
Il buon programmatore - consigli pratici per una vita felice
Il buon programmatore - consigli pratici per una vita feliceIl buon programmatore - consigli pratici per una vita felice
Il buon programmatore - consigli pratici per una vita feliceAndrea Dottor
 

Similaire à Windows Workflow Foundation 4 (20)

Introduzione a Workflow Foundation
Introduzione a Workflow FoundationIntroduzione a Workflow Foundation
Introduzione a Workflow Foundation
 
Integrazione continua con TFS Build
Integrazione continua con TFS BuildIntegrazione continua con TFS Build
Integrazione continua con TFS Build
 
Scenario Framework
Scenario FrameworkScenario Framework
Scenario Framework
 
Notes for an Enterprise Scheduling Distributed Application
Notes for an Enterprise Scheduling Distributed ApplicationNotes for an Enterprise Scheduling Distributed Application
Notes for an Enterprise Scheduling Distributed Application
 
Automazione dei processi con SharePoint e josh
Automazione dei processi con SharePoint e joshAutomazione dei processi con SharePoint e josh
Automazione dei processi con SharePoint e josh
 
Webcast - Introduzione a Visual Studio Online
Webcast - Introduzione a Visual Studio OnlineWebcast - Introduzione a Visual Studio Online
Webcast - Introduzione a Visual Studio Online
 
Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...
Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...
Implementazione di una soluzione a microservizi: benifici organizzativi ed ec...
 
3DD 1e Reconfig
3DD 1e Reconfig3DD 1e Reconfig
3DD 1e Reconfig
 
Rich client application: MVC4 + MVVM = Knockout.js
Rich client application: MVC4 + MVVM = Knockout.jsRich client application: MVC4 + MVVM = Knockout.js
Rich client application: MVC4 + MVVM = Knockout.js
 
Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0
 
Introduzione a Struts
Introduzione a StrutsIntroduzione a Struts
Introduzione a Struts
 
Workflow Foundation 4.5
Workflow Foundation 4.5Workflow Foundation 4.5
Workflow Foundation 4.5
 
Progetto e implementazione di una pipeline di sviluppo software con tecnologi...
Progetto e implementazione di una pipeline di sviluppo software con tecnologi...Progetto e implementazione di una pipeline di sviluppo software con tecnologi...
Progetto e implementazione di una pipeline di sviluppo software con tecnologi...
 
Esposizione RIA
Esposizione RIAEsposizione RIA
Esposizione RIA
 
La piattaforma josh - Scenario strategico della piattaforma software di it Co...
La piattaforma josh - Scenario strategico della piattaforma software di it Co...La piattaforma josh - Scenario strategico della piattaforma software di it Co...
La piattaforma josh - Scenario strategico della piattaforma software di it Co...
 
Alm pills - Sessione community tour Dot Net Umbria 2011
Alm pills - Sessione community tour Dot Net Umbria 2011Alm pills - Sessione community tour Dot Net Umbria 2011
Alm pills - Sessione community tour Dot Net Umbria 2011
 
Introduzione a Ruby On Rails
Introduzione a Ruby On RailsIntroduzione a Ruby On Rails
Introduzione a Ruby On Rails
 
Win05 accesso ai dati in win 8
Win05   accesso ai dati in win 8Win05   accesso ai dati in win 8
Win05 accesso ai dati in win 8
 
Rendere flessibili e trasformare architetture IT di vecchio tipo: passaggio d...
Rendere flessibili e trasformare architetture IT di vecchio tipo:passaggio d...Rendere flessibili e trasformare architetture IT di vecchio tipo:passaggio d...
Rendere flessibili e trasformare architetture IT di vecchio tipo: passaggio d...
 
Il buon programmatore - consigli pratici per una vita felice
Il buon programmatore - consigli pratici per una vita feliceIl buon programmatore - consigli pratici per una vita felice
Il buon programmatore - consigli pratici per una vita felice
 

Plus de Felice Pescatore

Il Cinismo dell'Agilista Imbruttito
Il Cinismo dell'Agilista ImbruttitoIl Cinismo dell'Agilista Imbruttito
Il Cinismo dell'Agilista ImbruttitoFelice Pescatore
 
Intelligent Business Agility
Intelligent Business AgilityIntelligent Business Agility
Intelligent Business AgilityFelice Pescatore
 
Disciplined Agile, la Promessa, la Svolta e il Prestigio
Disciplined Agile, la Promessa, la Svolta e il PrestigioDisciplined Agile, la Promessa, la Svolta e il Prestigio
Disciplined Agile, la Promessa, la Svolta e il PrestigioFelice Pescatore
 
The Disciplined Approach to Change
The Disciplined Approach to ChangeThe Disciplined Approach to Change
The Disciplined Approach to ChangeFelice Pescatore
 
The Disciplined Approach to Change
The Disciplined Approach to ChangeThe Disciplined Approach to Change
The Disciplined Approach to ChangeFelice Pescatore
 
PMI Disciplined Agile: la Promessa, la Svolta e il Prestigio
PMI Disciplined Agile: la Promessa, la Svolta e il PrestigioPMI Disciplined Agile: la Promessa, la Svolta e il Prestigio
PMI Disciplined Agile: la Promessa, la Svolta e il PrestigioFelice Pescatore
 
Un cuore moderno per l'Agilità
Un cuore moderno per l'AgilitàUn cuore moderno per l'Agilità
Un cuore moderno per l'AgilitàFelice Pescatore
 
L'Occhio di Ra sul Testing
L'Occhio di Ra sul TestingL'Occhio di Ra sul Testing
L'Occhio di Ra sul TestingFelice Pescatore
 
Industry 4.0... a che punto siamo in Italia
Industry 4.0... a che punto siamo in ItaliaIndustry 4.0... a che punto siamo in Italia
Industry 4.0... a che punto siamo in ItaliaFelice Pescatore
 
Agile IoT & Eclipse Duttile
Agile IoT & Eclipse DuttileAgile IoT & Eclipse Duttile
Agile IoT & Eclipse DuttileFelice Pescatore
 
Fuffa Day - The Sixth Sense
Fuffa Day - The Sixth SenseFuffa Day - The Sixth Sense
Fuffa Day - The Sixth SenseFelice Pescatore
 
Value Focused Team: road to DevOps
Value Focused Team: road to DevOpsValue Focused Team: road to DevOps
Value Focused Team: road to DevOpsFelice Pescatore
 

Plus de Felice Pescatore (20)

Il Cinismo dell'Agilista Imbruttito
Il Cinismo dell'Agilista ImbruttitoIl Cinismo dell'Agilista Imbruttito
Il Cinismo dell'Agilista Imbruttito
 
Intelligent Business Agility
Intelligent Business AgilityIntelligent Business Agility
Intelligent Business Agility
 
AgileBIM, BIM mets Agile
AgileBIM, BIM mets AgileAgileBIM, BIM mets Agile
AgileBIM, BIM mets Agile
 
Disciplined Agile, la Promessa, la Svolta e il Prestigio
Disciplined Agile, la Promessa, la Svolta e il PrestigioDisciplined Agile, la Promessa, la Svolta e il Prestigio
Disciplined Agile, la Promessa, la Svolta e il Prestigio
 
AgileBIM overview
AgileBIM overviewAgileBIM overview
AgileBIM overview
 
The Disciplined Approach to Change
The Disciplined Approach to ChangeThe Disciplined Approach to Change
The Disciplined Approach to Change
 
The Disciplined Approach to Change
The Disciplined Approach to ChangeThe Disciplined Approach to Change
The Disciplined Approach to Change
 
PMI Disciplined Agile: la Promessa, la Svolta e il Prestigio
PMI Disciplined Agile: la Promessa, la Svolta e il PrestigioPMI Disciplined Agile: la Promessa, la Svolta e il Prestigio
PMI Disciplined Agile: la Promessa, la Svolta e il Prestigio
 
Agilozzi le testa tutte
Agilozzi le testa tutteAgilozzi le testa tutte
Agilozzi le testa tutte
 
39bit al secondo
39bit al secondo39bit al secondo
39bit al secondo
 
Un cuore moderno per l'Agilità
Un cuore moderno per l'AgilitàUn cuore moderno per l'Agilità
Un cuore moderno per l'Agilità
 
L'Occhio di Ra sul Testing
L'Occhio di Ra sul TestingL'Occhio di Ra sul Testing
L'Occhio di Ra sul Testing
 
#NoElevator4DevOps
#NoElevator4DevOps#NoElevator4DevOps
#NoElevator4DevOps
 
Don't Dirty my Backlog!
Don't Dirty my Backlog!Don't Dirty my Backlog!
Don't Dirty my Backlog!
 
Industry 4.0... a che punto siamo in Italia
Industry 4.0... a che punto siamo in ItaliaIndustry 4.0... a che punto siamo in Italia
Industry 4.0... a che punto siamo in Italia
 
Agile IoT & Eclipse Duttile
Agile IoT & Eclipse DuttileAgile IoT & Eclipse Duttile
Agile IoT & Eclipse Duttile
 
Fuffa Day - The Sixth Sense
Fuffa Day - The Sixth SenseFuffa Day - The Sixth Sense
Fuffa Day - The Sixth Sense
 
#NoElevator for DevOps
#NoElevator for DevOps#NoElevator for DevOps
#NoElevator for DevOps
 
Value Focused Team
Value Focused TeamValue Focused Team
Value Focused Team
 
Value Focused Team: road to DevOps
Value Focused Team: road to DevOpsValue Focused Team: road to DevOps
Value Focused Team: road to DevOps
 

Windows Workflow Foundation 4

  • 1. Windows Workflow Foundation 28 Gennaio 2012 Felice Pescatore – felice.pescatore@gmail.com www.felicepescatore.it - www.storiainformatica.it felice.pescatore @felicepescatore Felice Pescatore
  • 2.
  • 3.
  • 4. Parte Prima I WORKFLOW
  • 5.
  • 6.
  • 7.
  • 8. Il mondo dei Workflow Windows Workflow Foundation Parte Prima Coordinamento di attività (work) eseguite da software e/o persone Gestione ottimale di processi long running and stateful Ciclo di vita trasparente e dincamico Modelli estensibili ( extensible models)
  • 9.
  • 10.
  • 11. Il mondo dei Workflow: sulla carta…. Windows Workflow Foundation Parte Prima
  • 12. … sul calcolatore Windows Workflow Foundation Parte Prima
  • 13.
  • 14. Parte Seconda I WORKFLOW NEL MONDO .NET Windows Workflow Foundation Parte Seconda
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Windows Workflow Foundation: il Runtime Windows Workflow Foundation Parte Seconda
  • 20.
  • 21.
  • 22.
  • 23. Windows Workflow Foundation Runtime Unleashed Host Application App Domain SQL Out of Box Services per la comunicazione con SQL Server 2000, 2005, 2008 Servizi Comuni per la gestione dei thread, dei timer e delle tranazioni PersistenceService , salvataggio e ripristino di istanze TrackingService manages profiles and stores tracked information. Runtime Services PersistenceService TrackingService SchedulerService TransactionService Windows Workflow Foundation Parte Seconda Services
  • 24.
  • 25. Windows Workflow Foundation Runtime Windows Workflow Foundation Parte Seconda Workflow Runtime Properties Property Purpose IsStarted Used to determine whether the workflow runtime has been started and is ready to accept workflow instances. IsStarted is false until the host calls StartRuntime . It remains true until the host calls StopRuntime . Name Gets or sets the name associated with the WorkflowRuntime . You cannot set Name while the workflow runtime is running (that is, when IsStarted is true ). Any attempt to do so will result in an InvalidOperationException . Workflow Runtime Methods AddService Adds the specified service to the workflow runtime. There are limitations regarding what services can be added as well as when. CreateWorkflow Creates a workflow instance, including any specified (but optional) parameters. If the workflow runtime has not been started, the CreateWorkflow method calls StartRuntime . GetWorkflow Retrieves the workflow instance that has the specified workflow instance identifier (which consists of a Guid). If the workflow instance was idled and persisted, it will be reloaded and executed. StartRuntime Starts the workflow runtime and the workflow runtime services and then raises the Started event. StopRuntime Stops the workflow runtime and the runtime services and then raises the Stopped event.
  • 26. Windows Workflow Foundation Runtime Windows Workflow Foundation Parte Seconda Events Purpose Started Raised when the workflow runtime is started. Stopped Raised when the workflow runtime is stopped. WorkflowCompleted Raised when a workflow instance has completed. WorkflowIdled Raised when a workflow instance enters the idle state. When workflow instances go idle, you have the opportunity to unload them from memory, store them in a database (in case they’re waiting for a long-running task), and bring them back into memory at a later time. WorkflowTerminated Raised when a workflow instance is terminated. The workflow can be terminated by the host through a call to the Terminate method of a workflow instance, by a Terminate activity, or by the workflow runtime when an unhandled exception occurs.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. Windows Workflow Foundation 4: Data Windows Workflow Foundation Parte Seconda
  • 32.
  • 33.
  • 34. Parte Seconda I Workflow nel mondo .NET: IMPERATIVE CODE vs. DECLARATIVE DESIGN Windows Workflow Foundation Parte Seconda
  • 35.
  • 36. WF: modello Dichiarativo vs. modello Imperativo Windows Workflow Foundation Parte Seconda
  • 37. WF: modello Dichiarativo vs. modello Imperativo Windows Workflow Foundation Parte Seconda
  • 38. WF: modello Dichiarativo vs. modello Imperativo Windows Workflow Foundation Parte Seconda
  • 39. WF: modello Dichiarativo vs. modello Imperativo public static Activity GetWF() {          Variable<string> var = new Variable<string>(&quot;var&quot;, &quot;hello workflow&quot;);          return new Sequence {              Variables = { var },              Activities ={                  new WriteLine{Text=&quot;Workflow Started&quot;},                  new WriteLine{Text=new InArgument<string>(var)},                  new WriteLine{Text=&quot;Workflow Ended&quot;}              }          };      } Sequence activity  Windows Workflow Foundation Parte Seconda
  • 40. WF: modello Dichiarativo vs. modello Imperativo public class MyCodeWorkflow : Activity { public InArgument<string> inMSG { get; set; } public OutArgument<string> outMSG { get; set; } public MyCodeWorkflow() { this.Implementation = () => new Sequence { Activities = { new WriteLine{ Text=new InArgument<string>( (activityContext)=>this.inMSG.Get(activityContext) ) }, new Assign<string>{ To=new ArgumentReference<string>(&quot;outMSG&quot;), Value=new InArgument<string>( (activityContext)=>this.inMSG.Get(activityContext) ) } }};} } //host static void Main(string[] args) { IDictionary<string, object> input = new Dictionary<string, object>(); input.Add(&quot;inMSG&quot;,&quot;hello&quot;); IDictionary<string, object> output = new Dictionary<string, object>(); MyCodeWorkflow activity = new MyCodeWorkflow(); output = WorkflowInvoker.Invoke(activity,input); Console.WriteLine(output[&quot;outMSG&quot;]); } Code Workflow  Windows Workflow Foundation Parte Seconda
  • 41. WF: modello Dichiarativo vs. modello Imperativo public static DynamicActivity GetWF() { return new DynamicActivity() { Implementation = () => new Sequence() { Activities = { new WriteLine(){Text=&quot;Hello Workflow&quot;} } } }; } Dynamic Activity  Permette di creare una nuova istanza di workflow a runtime senza la necessità di definire direttamente il wf. Windows Workflow Foundation Parte Seconda
  • 42.
  • 43. Parte Seconda I Workflow nel mondo .NET: TIPOLOGIE DI WORKFLOW Windows Workflow Foundation Parte Seconda
  • 44. Workflow Types Windows Workflow Foundation Parte Seconda Type Meaning Sequenziali I task sono eseguiti autonomamente con la possibilità di piccole variazioni del path. La Root Activity di riferimento è SequentialWorkflow . State-machine, similare ad un grafo I task del Workflow dipendono da eventi esterni che ne guidano l’evoluzione. La Root Activity di riferimento è StateMachineWorkflow. Flowchart Pensati per il mapping 1:1 dei flowchart di progetto. La Root Activity di riferimento è Flowchart Rules-based Pensati per risolvere problemi elevata complessità che non possono essere risolti con i modelli precedenti. I Rules-based workflow possono avere come Root Activity indistintamente quelle precedenti.
  • 45.
  • 46.
  • 47.
  • 48. Workflow Types: State Machine Windows Workflow Foundation Parte Seconda
  • 49.
  • 50. Esempio di processo di approvazione Windows Workflow Foundation Parte Seconda
  • 51.
  • 52. Parte Seconda I Workflow nel mondo .NET: ACTIVTIES Windows Workflow Foundation Parte Seconda
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62. Activites: schedulazione I Work Item sono eseguiti uno alla volta per singola istanza del workflow Alcuni Work Item sono aggiunti all’inizio della coda di esecuzione, altri alla fine Windows Workflow Foundation Parte Seconda while !EmptyList Execute(next WorkItem)
  • 63.
  • 64. Activites: Namespace System.Activities Windows Workflow Foundation Parte Seconda
  • 65. Activites: Proprietà Windows Workflow Foundation Parte Seconda Property Purpose Description Gets or sets the user-defined description of the activity. Enabled Gets or sets a value that indicates whether this instance is enabled for execution and validation. ExecutionResult Gets the ActivityExecutionResult of the last attempt to run this instance ( Canceled , Compensated , Faulted , None , and Succeeded ). ExecutionStatus Gets the status of the workflow in the form of one of the ActivityExecutionStatus values ( Canceling , Closed , Compensating , Executing , Faulting , and Initialized ). Name Gets or sets the name of this activity instance. Parent Gets the activity that encloses this activity. WorkflowInstanceId Gets the workflow instance identifier associated with this activity.
  • 66. Activites: Metodi Windows Workflow Foundation Parte Seconda Method Purpose Cancel Cancels the execution of an activity. Clone Returns a deep copy of the activity (“deep copy” means the clone contains all of the internal data from the cloned activity). Execute Synchronously runs the activity. GetActivityByName If executed on a composite activity, this method returns the named activity if it is contained by the composite activity. Load Loads an instance of an activity from a stream. RaiseEvent Raises an event associated with the specified DependencyProperty . RaiseGenericEvent<T> Raises the event associated with the referenced DependencyProperty . The effect of RaiseEvent and RaiseGenericEvent is the same—fire an event. RaiseEvent uses the dependency property directly, while RaiseGenericEvent is the generic (templated) version. Save Saves a copy of the activity to a stream.
  • 67.
  • 68. CodeActivity (high level) vs. NativeActivity (lowest level) CODE ACTIVITY NATIVE ACTIVITY per la creazione di semplici Custom Activity per la creazione di complesse Custom Activity Una CustomActivity estende WF creando un’unità atomica di esecuzione. Windows Workflow Foundation Parte Seconda
  • 69.
  • 70. Activites: CodeActivity (high level) public class DoubleActivity : CodeActivity { public InArgument<int> Value {get; set;} public OutArgument<int> Double {get; set;} protected ovveride void Execute(CodeActivityContext context) { Double.Set(context, Value.Get(context) * 2); } } public class DoubleActivity : CodeActivity<int> { public InArgument<int> Value {get; set;} protected ovveride int Execute(CodeActivityContext context) { return Value.Get(context) * 2; } } Windows Workflow Foundation Parte Seconda
  • 71.
  • 72. Activites: Native Activity (lowest level) public class ReadString: NativeActivity { public OutArgument<string> Name {get; set;} protected override CanInduceIdle {get; {return true;} } protected ovveride void Execute(ActivityExecutionContext context) { context.CreateNamedBookmark(«input», new BookmarkCallback(this.OnBookmarkCallback)); } private void OnBookmarkCallback(ActivityExecutionContext context, Bookmark bookmark, object obj) { this.Name.Set(context, (string), obj); } } workflowApp.Run() string text = Console.ReadLine(); workflowApp.ResumeBookmark(«input», text,); syncEvent.WaitOne(); Windows Workflow Foundation Parte Seconda
  • 73.
  • 74. Parte Seconda I Workflow nel mondo .NET: ACTIVITIES ASICONCRONE
  • 75. Activities Asincrone Windows Workflow Foundation Parte Seconda
  • 76.
  • 77. Activities I Workflow nel mondo .NET: BUILT-IN ACTIVITIES
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88. Transazioni in Windows Workflow: Compensazione Long-running workflow Atomic Transaction Get Item De-queue Item Queue DB Queue DB Compensation Handler Queue Item Queue DB Normale esecuzione Logica di Compensazione Eseguita solo in caso di errore o di cancellazione della stessa Windows Workflow Foundation Parte Seconda
  • 89.
  • 90.
  • 91.
  • 92.
  • 93. Parte Seconda DEMO! Windows Workflow Foundation Parte Seconda
  • 94. Parte Seconda I Workflow nel mondo .NET: BUILT-IN ACTIVITIES - REHOSTING WORKFLOW DESIGNER Windows Workflow Foundation Parte Seconda
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103. Parte Seconda DEMO! workflowdesigner_embedded.zip Windows Workflow Foundation Parte Seconda
  • 104. Parte Seconda I Workflow nel mondo .NET: ESECUZIONE DI UN WORKFLOW Windows Workflow Foundation Parte Seconda
  • 105.
  • 106.
  • 107.
  • 108.
  • 109.
  • 110. Parte Terza WORKFLOW SERVICES Windows Workflow Foundation Parte Terza
  • 111.
  • 112.
  • 113.
  • 114.
  • 115. Workflow Service Windows Workflow Foundation Parte Terza
  • 116.
  • 117.
  • 118.
  • 119. WCF E WF 4 Environment Runtime Databases Windows Workflow Foundation Parte Terza Windows Server .NET Framework Windows Server AppFabric Services Management Tools IIS/WAS Workflows Persistence Monitoring Hosting Persistence Caching Monitoring IIS Manager Modules PowerShell
  • 120. WF Service Components Persistence (Instances) Monitoring Activity Library Receive Send ... WCF Layer Windows Workflow Foundation Parte Terza Workflow Service Host Management Endpoint Persistence Behavior Tracking Behavior
  • 121. WF Service: coordinazione di chiamate asincrone a servizi Add/Remove Item Calculate Best Price Get Price Get Price Windows Workflow Foundation Parte Terza Supplier One Service Supplier Two Service Best Price Workflow Service Purchase Service
  • 122.
  • 123.
  • 124. WF Service: CONTEXT BASED CORRELATION 1. Start 3. Send (key 3) 4. Receive (key 3) Receive Send Receive Persistence DB (Instances) 2. Save (key 3) 5. Load (key 3) 6.Complete Instance 123 | data 456 | data 789 | data A11 | data Key 123 | key 1 456 | key 2 789 | key 3 A11 | key 4 create correlation key3 Windows Workflow Foundation Parte Terza Workflow Service
  • 125. WF Service: CONTENT BASED CORRELATION Persistence DB (Instances) Instance 123 | data 456 | data 789 | data A11 | data Key 123 | userid 1 456 | userid 2 789 | userid 3 A11 | userid4 1. Add item (userId 3) 3. View items (userId 3) 5. Best Price (userId 3) Receive Receive Receive 2. Save (userId 3) 4. Load (userId 3) 6. Load (userId 3) create correlation Windows Workflow Foundation Parte Terza
  • 126.
  • 127.
  • 128.
  • 129.
  • 130. Parte Quarta ASPETTI AVANZATI Windows Workflow Foundation Parte Quarta
  • 131. Parte Quarta Aspetti Avanzati : ERROR HANDLING, EXCEPTION e FAULT Windows Workflow Foundation Parte Quarta
  • 132.
  • 133.
  • 134.
  • 135.
  • 136.
  • 137. Parte Quarta Aspetti Avanzati: WINDOWS SERVER APPFABRIC MONITORING,PERSISTENZA e CACHE Windows Workflow Foundation Parte Quarta
  • 138.
  • 139. Windows Server AppFabric: Architettura Persistence Database Windows Workflow Foundation Parte Quarta IIS Worker Process AppFabric Hosting Services IIS Manager AppFabric Caching Services Cache Server Cache Server ASP.NET WF & WCF Apps Windows Apps Cache Client Monitoring Database Cache Config Cache Client Cache Server
  • 140. Parte Quarta Windows Server AppFabric MONITORING Windows Workflow Foundation Parte Quarta
  • 141.
  • 142. AppFabric Hosting Services : Monitoring Persistence Database Windows Workflow Foundation Parte Quarta IIS Worker Process IIS Manager WF & WCF Apps Monitoring Database ISV Apps ASP.NET Apps Event Tracing for Windows (ETW) AppFabric Extensions
  • 143.
  • 144. Parte Quarta Windows Server AppFabric PERSISTENZA e VERSIONING Windows Workflow Foundation Parte Quarta
  • 145.
  • 146. AppFabric Hosting Services : Persistenza AppFabric Extensions SQL Workflow Instance Store Windows Workflow Foundation Parte Quarta Client Persistence Store Monitoring Database IIS Manager Workflow Service WF WCF IIS Worker Process
  • 147.
  • 148.
  • 149.
  • 150. AppFabric Hosting Services : WF Definiton PARALLEL ■ DateTime d int n string s private int index private int index Windows Workflow Foundation Parte Quarta
  • 151. AppFabric Hosting Services : WF Serialized Data PARALLEL ■ DateTime d int n string s private int index private int index “ hello” 3 Bookmark:“x” Windows Workflow Foundation Parte Quarta INPUT
  • 152.
  • 153.
  • 154.
  • 155.
  • 156.
  • 157. Bookmark Resumption Windows Workflow Foundation Parte Quarta “ Please deliver [data] to instance [id] at bookmark [name]”
  • 158. AppFabric Hosting Services : Persistenza e Load Balancer Windows Workflow Foundation Parte Quarta Windows Server AppFabric Windows Server AppFabric Load Balancer Persistence DB Workflow Service Workflow Service Workflow Management Service Workflow Management Service Windows Server AppFabric Workflow Service Workflow Management Service Instance 123 | data 456 | data 789 | data 011 | data
  • 159. Parte Quarta Windows Server AppFabric CACHING Windows Workflow Foundation Parte Quarta
  • 160. AppFabric Caching Services Windows Workflow Foundation Parte Quarta IIS Worker Process AppFabric Caching Services Cache Server Cache Server ASP.NET WF & WCF Apps Windows Apps Cache Client Cache Config Cache Client Cache Server
  • 161. High Availability Cache Server Cached Data Your app Local Cache Cache Server Cached Data Cached Data Windows Workflow Foundation Parte Quarta Cache Server
  • 162. Session State Session State Provider Session State Provider Session State Provider Windows Workflow Foundation Parte Quarta Web Server Web Server Web Server AppFabric Caching Services Cache Server Cache Server Cache Server App 1 2 1 2 App App Browser 1 Browser 2
  • 163. Parte Quinta SECURITY: introduzione a WIF – WINDOWS IDENTITY FOUNDATION Windows Workflow Foundation Parte Quinta
  • 164.
  • 165.
  • 166.
  • 167. Claims-Based Security: Security Token Services https://testserver/sts http://localhost/ sts Locale Test Produzione Windows Workflow Foundation Parte Quinta https://Productionserver/sts
  • 168.
  • 169.
  • 170. Claims-Based Security: accesso ai Claim Claims Issuer Value ClaimType ValueType OriginalIssuer Windows Workflow Foundation Parte Quinta IClaimsIdentity Delegate IIdentity AuthenticationType IsAuthenticated Name IClaimsIdentity IClaimsIdentity Subject Identity
  • 171. Claims-Based Security: accesso ai Claim void Page_Load(object sender, EventArgs e) { IClaimsPrincipal icp = (IClaimsPrincipal) Thread.CurrentPrincipal; IClaimsIdentity claimsIdentity = (IClaimsIdentity)icp.Identity; ageClaimValue = (from c in claimsIdentity.Claims where c.ClaimType == &quot;http://MyNS/AgeClaim&quot; select c.Value ).Single(); } Windows Workflow Foundation Parte Quinta
  • 172. Parte Quinta Security WFF e WIF Windows Workflow Foundation Parte Quinta
  • 173.
  • 174.
  • 175.
  • 176. WFF e WIF: Scenario, pt1 NB: per accedere direttamente al BootStrapToke(RAW) come parte di IClaimsIdentity , è necessario configurare il parametro SaveBootstrapToken a TRUE. Windows Workflow Foundation Parte Quinta
  • 177.
  • 178. Parte Finale Conclusioni e Prossimi Sviluppi Windows Workflow Foundation Parte Finale
  • 179.
  • 180.
  • 181. Libreria Windows Workflow Foundation Parte Finale Escluso MSDN, la casa di Redmond latita un po' su testi e materiale ufficiale inerente WWF
  • 182. Blog e Riferimenti Windows Workflow Foundation Parte Finale http://zamd.net/ Zulfiqar's weblog - WCF/WF/AppFabric & random .Net stuff Ron Jacobs - Windows Workflow Foundation http://blogs.msdn.com/b/rjacobs/ The Problem Solver http://msmvps.com/blogs/theproblemsolver/archive/tags/Workflow/default.aspx Riferimenti http ://dotnetside.org/blogs/articoli/pages/introduzione-a-windows-workflow-foundation-4.aspx http://www.slideshare.net/dannicola/wf-40-overview http://www.slideshare.net/markginnebaugh/microsoft-windows-server-appfabric http://blogs.msdn.com/b/rjacobs/ http://msdn.microsoft.com/it-it/magazine/gg598919.aspx http://xhinker.com/post/WF4Authoring-Workflows-Using-Imperative-Code.aspx
  • 183. Domande? Windows Workflow Foundation Parte Finale
  • 184. Windows Workflow Foundation Parte Finale Chi non riesce più a provare stupore e meraviglia è già come morto e i suoi occhi sono incapaci di vedere. ..:: Albert Einstein ::..

Notes de l'éditeur

  1. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  2. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  3. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  4. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  5. 02/08/12 21:52 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  6. 02/08/12 21:52 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  7. 02/08/12 21:52 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  8. 02/08/12 21:52 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  9. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  10. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  11. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  12. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  13. 02/08/12 21:52 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  14. 02/08/12 21:52 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
  15. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  16. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  17. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  18. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  19. 02/08/12 21:52 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.