资源预览内容
第1页 / 共13页
第2页 / 共13页
第3页 / 共13页
第4页 / 共13页
第5页 / 共13页
第6页 / 共13页
第7页 / 共13页
第8页 / 共13页
第9页 / 共13页
第10页 / 共13页
亲,该文档总共13页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
Custom Inline FunctionsThis learning module discusses the criteria, use and implementation of custom Inline Functions400.CCU Version:1 Revision:1 Duration: 1 hour SourceCode Technology Holdings, Inc. All Rights ReservedModule prerequisites and target audienceq Target Audience .NET Developersq Prerequisite knowledge Familiarity with K2 blackpearl and the K2 design tools Development experience with Microsoft .NET 2.0 or higher using the Microsoft Visual Studio IDEq Compatibility K2 blackpearl V 4.5 update 1370 or higherK2 Inline FunctionsqAllow workflow designers to insert the result of operations into any input field at design timeqInline Function results can be used in workflow rules and wizardsqTypically performs an operation on input values and returns a result in a supported data typeqK2 provides a standard set of Inline FunctionsqCustom Inline Functions can be used to supplement the standard set of Inline FunctionsStandard Inline Functions q Data Type Conversionq Simple data operationsq Date and Time Functionsq Excel Spreadsheet Calculationsq Expression builderq InfoPath attachment operationsq Operations against Lists (arrays)q Logical (Boolean) operationsq Mathematical operationsq Regular Expression Match operationsq Text processingq Word document content control read operationsInline Functions vs. SmartObject MethodsInline FunctionsSmartObject Methods Typically perform operations and return single valuesTypically perform CRUD/List/Execute operations against a data sourceCan only be used in K2 design toolsCan be used in K2 design tools, user interfaces, reports and custom codeMust be deployed to all K2 servers, developer machines and SharePoint servers (K2D4SP)Only need to be deployed to the K2 serverExecute on the K2 ServerExecute on the K2 serverSlightly better performance than SmartObject methodsAdditional layers (APIs, Services) may impact performanceSimpler and easier to implementCan be complex to implement, but is powerful and more re-usableImplementing Custom Inline Functionsq Create a .NET 2.0 - 3.5 class libraryq Add references to System.Drawing SourceCode.Framework SourceCode.Workflow.Functions SourceCode.Workflow.Functions.Design q Decorate the class with Category attribute q Implement public static methods for each function q Decorate the methods with attributes to expose them as custom functions (DisplayName, Description, K2Icon) q Decorate the method parameters with attributes (DisplayName, Description) q Use resource files for localization support q Sign the assembly if it will be used in K2 Designer for SharePointLAB 1: Examine an example custom Inline FunctionIn this lab exercise you will examine the implementation of an example custom inline function. The sample inline function performs some basic string manipulation. 15 minutesSurfacing of attributes in the K2 Design toolsScopeAttributeExposed asClassCategoryMethodDisplayNameDescriptionK2IconParameterDisplayNameDescriptionDeploying Custom Inline Functions q K2 Servers Copy the inline function assembly to the K2 Install DirectoryHost ServerBIN folderq K2 Designer for SharePoint Add the assembly to the GAC on the WFE servers Copy the icon file to WFE SharePoint HiveTemplateLAYOUTSWebDesignerImagesFunctionsq K2 Development Workstations Copy the inline function assembly to the K2 Install DirectoryBinFunctionsq Registration/Discovery Inline functions are discovered automatically no need to register them manually with K2Using Custom Inline FunctionsqUsed just like standard inline functionsqDrag-and-drop inline functions into input boxes at design timeqK2 will perform data type validation at design timeqUse nested Inline Functions to achieve the desired resultqCreate complex expressions using Inline FunctionsqSave frequently-used expressions to Saved FunctionsTroubleshooting Custom Inline FunctionsqAssemblies built in .NET 4.0 are not supportedqInline functions can be debugged by attaching a remote debugger to the K2HostServer.exe process and executing the function in a workflowqMake sure the resource file values are correct (use IntelliSense to verify)qAssemblies should be signed before registering them in the GACqThe default namespace as specified in the project properties should be the same as the namespace of the typeLAB 2: Create, deploy and use a custom Inline FunctionIn this lab exercise, you will create a new custom Inline Function, deploy the function and use the function in a K2 workflow. We will create a custom inline function to perform string encryption and decryption functions20 minutesqWhen to use custom Inline FunctionsqCustom Inline Functions vs. SmartObjectsqHow to build custom Inline FunctionsqDeploying and using custom Inline FunctionsqTroubleshooting custom Inline FunctionsReview and Q&A
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号