From 7baa8030af03754b27153cadf3e26b742b3ecd56 Mon Sep 17 00:00:00 2001 From: Bensong Liu <bensl@microsoft.com> Date: Wed, 21 Oct 2020 13:24:34 +0800 Subject: [PATCH] doc --- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ea30a29..e57a82d 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,53 @@ Please install rlib: https://github.com/recolic/rlib You C++ compiler must at least support C++14. -## Install +## Installation ``` sudo make install ``` -## Use +## Usage -1. Write your `Workflow.cc` with our lib. If you want some example, please read `xaml.gen.example.cc` and `workflows/*.cc`. **Make your code as simple as you can**. +1. Write your `Workflow.cc` with our lib. 2. Compile and run your `Workflow.cc`. You're all set. + +## Example for your Workflow.cc + +For examples of more advanced features, please refer to `xaml.gen.example.cc` and `workflows/*.cc`. **Make your code as simple as you can**. + +Writing a complex workflow is as easy as this: + +```c++ +#include <cis-workflow-gen/quick-include.hpp> + +int main() { + #define DEFINE_ACTIVITY(name, entityName) \ + Activity name (#name, "FleetAGC.Activities.DelayActivity", entityName); \ + name.addInputSetting("Message", "Doing " #name); + + DEFINE_ACTIVITY(SCS, "PreRteg.InitiateBareMetalComplete") + DEFINE_ACTIVITY(SearchAnalytics, "") + DEFINE_ACTIVITY(SearchFarms , "") + DEFINE_ACTIVITY(ClassisSearchUX , "") + DEFINE_ACTIVITY(ModernSearch, "") + DEFINE_ACTIVITY(Loki, "PreRteg.InitiateBareMetalComplete") + DEFINE_ACTIVITY(Yggdrasil, "") + DEFINE_ACTIVITY(OfficeGraph, "") + DEFINE_ACTIVITY(IC3Tooling, "PreRteg.InitiateBareMetalComplete") + DEFINE_ACTIVITY(MonitoringSetup, "") + DEFINE_ACTIVITY(MicroServices, "") + DEFINE_ACTIVITY(DevelopmentValidation, "") + DEFINE_ACTIVITY(IntegrationTesting, "") + DEFINE_ACTIVITY(TSConfigAndInterop, "PreRteg.InitiateBareMetalComplete") + + auto block1 = SCS >> (SearchAnalytics | (SearchFarms >> (ClassisSearchUX | ModernSearch))); + auto block3 = Loki >> Yggdrasil >> OfficeGraph; + auto block4 = IC3Tooling >> (MonitoringSetup | (MicroServices >> DevelopmentValidation >> IntegrationTesting)); + auto completeFlow = block1 | TSConfigAndInterop | block3 | block4; + + println(to_file("IC3TeamsVirtualWorkflow.xaml"), completeFlow.generateXaml("FleetAGC.Workflows.IC3TeamsVirtualWorkflow")); +} +``` + -- GitLab