AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 09.04.2015, 20:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
axmfg: Product Configuration Synchronous Execution
Источник: http://blogs.msdn.com/b/axmfg/archiv...execution.aspx
==============

This blog post describes an new way of interacting synchronously from code with the
Constraint-Based Product Configurator which has been introduced in Microsoft
Dynamics AX 2012 R3 CU8.




Scenario

The scenario that drove the introduction of this feature can be described as follows:



An external 3rd party sales configurator outside of Microsoft Dynamics AX 2012 is used to
assign values to a subset of attributes(a partially configured order), from
which the remaining mandatory attributes can have their values deduced using
the Microsoft Dynamics AX 2012 Configurator, thereby completing the order.








Once the all the values have been deduced, assuming all values are valid, they can be passed on
to the back end configuration module, which will create the BOM and potentially
the Route (if the model has a Route).




Implementation

Included in Microsoft Dynamics AX 2012 R3 CU 8 is a new derived version of the PCRuntimeConfigurator class, named PCRuntimeSynchronousConfigurator.

This class is designed, as the name indicates, for synchronous interaction with the .NET
Configurator component.




The configure method on the class is the method
which exposes the new functionality added to the .NET Configurator to Xpp. The
method takes three arguments; the model as xml, the attribute assignments as
xml and a the number of milliseconds which can be used before a timeout occur.
The return of the method is a IsConfigurationComplete enum value, from which
result of the configuration can be determined;



  • Complete
    • The configuration is complete
  • Incomplete
    • One or more mandatory attributes does not have a value
  • Timeout
    • The configurator was not able to complete the configuration within the given timeout limit
  • Contradiction
    • One or more constraints have been violated


Note:

The PCRuntimeSynchronuosConfigurator class exposes
the functionality required by the .NET configurator component to support the
above scenario but it is not yet integrated with any order (sales, production
etc) or product variant creation nor is it integrated with the BOM and Route
generation.




KB Article with number 3028719 should be Applied on top of R3 CU 8 as it addresses a stability issue in the solution.

Example

In this example values are passed from the simulated 3rd party configurator into Dynamics AX 2012 through a web service, as illustrated below:







To expose the PCRuntimeSynchronousConfigurator class through
a web service, we start by introducing a new class
PCTechDemoService
which implements a method with the SysEntryPointAttribute code attribute, which is
needed for a method to be exposed as a web service.




In this simple implementation the example method looks like this:



[SysEntryPointAttribute(true)]

public boolean configure(PCName _modelName, str _xmlValues)

{

boolean ret;

str values;



PCRuntimeSynchronousConfigurator configurator = PCRuntimeSynchronousConfigurator::construct();

PCProductConfigurationModel productConfigurationModel = PCProductConfigurationModel::findByName(_modelName);

values = '' + _xmlValues + '';


if(configurator.configure(productConfigurationModel.getXML(), values,120000) == Microsoft.Dynamics.Ax.Frameworks.Controls.ProductConfiguration.IsConfigurationComplete::Complete)

{

ret = true;

}



return ret;

}

Now we can create a Service in the AOT which uses the PCTechDemoService
class and its configure method as an operation. To use this service, it needs
to be put in a service group, which can then be deployed.








To test the service, navigate to System administration > Services and Application Integration Framework > Inbound ports. Here we find our new PCTechDemoServiceGroup, copy the WSDL URI value.









Open Visual Studio Command prompt and type:

Wcftestclient



This will open the WCF test client where we can now see our web service.






For the demo data set I have used, I will use the following argument values



_modelName : 20001

_xmlValues :



Note: the xPath mechanism used to identify the attributes in model.







If you are familiar with the 20001(Home theater system) model, you will know that it has just two
mandatory attributes which are not assigned by defaults; the powerCableLength
on the root component and the size on the television component.




Attached you will find an Xpp project with code used for the example.



Enjoy










Источник: http://blogs.msdn.com/b/axmfg/archiv...execution.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axmfg: Product Configuration Performance : Caching Blog bot DAX Blogs 0 05.02.2015 01:11
axmfg: Product Configuration: Setting values based on system variables - example, current user ID Blog bot DAX Blogs 0 29.04.2014 20:11
axmfg: Understanding the default configuration concept for constraint-based products Blog bot DAX Blogs 0 17.07.2013 14:11
DynamicsAxSCM: Product-item data management services Blog bot DAX Blogs 0 06.07.2011 17:11
при построении перекрёстных ссылок выдаётся сообщение об ошибках mmmax DAX: Программирование 10 21.01.2005 12:42

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 17:45.