0% found this document useful (0 votes)
70 views

How To Execute Windows Work Flows in Pos

1. Create a Windows workflow project in Visual Studio. 2. Add a Code Activity and Activity to the project that programmatically invokes core POS operations. 3. Build the project and place the DLL and XAML files in the desired folder. 4. Configure a POS button to run the workflow using the XAML file path. Clicking the button will now run the workflow.

Uploaded by

Islam Sultan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

How To Execute Windows Work Flows in Pos

1. Create a Windows workflow project in Visual Studio. 2. Add a Code Activity and Activity to the project that programmatically invokes core POS operations. 3. Build the project and place the DLL and XAML files in the desired folder. 4. Configure a POS button to run the workflow using the XAML file path. Clicking the button will now run the workflow.

Uploaded by

Islam Sultan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

How to: Windows Workflow Foundation in POS

Further reading
Microsoft Dynamics AX 2012 for Developers [AX 2012] SDK Download RunOperation Method

Tutorial
AX Retail Point of Sale allows partners to customize services. Partners can programmatically invoke the same core operations users invoke by pressing a button in the UI. These operations can further be described by a Windows workflow. 1. Create a new Windows workflow project in Visual Studio. 2. Add a new Code Activity (see ItemSaleActivity.cs). 3. Add a new Activity (see ItemSale.xaml). a. The ItemSale.xaml expects an ItemId as an argument and has a default value of 0113. 4. Build your project and put both the dll and the xaml file in your desired folder. 5. On the main screen, click Tasks then right click on a button and change the action to Windows workflow foundation, set the Path field to reflect the location of your xaml file. 6. To run the workflow, just click the newly added button.

Example
ItemSaleActivity.cs
public class ItemSaleActivity : NativeActivity { // Define an activity input argument of type string public InArgument<string> ItemId { get; set; } protected override void Execute(NativeActivityContext context) { IApplication application = context.GetExtension<IApplication>(); if (application != null) { string itemId = context.GetValue(this.ItemId); application.RunOperation(PosisOperations.ItemSale, itemId); } } }

ItemSale.xaml
<Activity mc:Ignorable="sap" x:Class="WorkflowDemo.ItemSale" local:ItemSale.itemId="0113" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:local="clrnamespace:WorkflowDemo;assembly=WorkflowDemo" xmlns:mc="http://schemas.openxmlformats.org/markupcompatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clrnamespace:System;assembly=System.Core" xmlns:sa="clrnamespace:System.Activities;assembly=System.Activities" xmlns:sad="clrnamespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clrnamespace:System.Collections.Generic;assembly=System" xmlns:scg1="clrnamespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clrnamespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clrnamespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clrnamespace:System.Data;assembly=System.Data" xmlns:sl="clrnamespace:System.Linq;assembly=System.Core" xmlns:st="clrnamespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <x:Members> <x:Property Name="itemId" Type="InArgument(x:String)" /> </x:Members> <sap:VirtualizedContainerService.HintSize>240,240</sap:VirtualizedContainerService.HintSize> <mva:VisualBasic.Settings>Assembly references and imported namespaces for internal implementation</mva:VisualBasic.Settings> <local:PosOperationActivity sad:XamlDebuggerXmlReader.FileName="ItemSale.xaml" sap:VirtualizedContainerService.HintSize="200,200" ItemId="[[itemId]]" /> </Activity>

You might also like