Да SharePoint тэхнічныя шаблонаў праектавання: SharePoint Designer працоўны працэс + Прыёмнік падзей = Высокае Кактэйль патэнцыі

Адна з новых мадэляў я знаходжу ў распрацоўцы рашэнняў SharePoint выкарыстоўвае SharePoint Designer працоўны працэс і прыёмнік падзеі.

Вось бізнес-сцэнар, каб змясціць яго ў кантэкст:

  • Я загрузіць дакумент да дакумента Lib.
  • Я адкідаю шматступенны працэс, створаны дапамогай SharePoint Designer.
  • У нейкі момант у ходзе гэтага працэсу, працоўны працэс прызначае задачу камусьці (з дапамогай збору дадзеных ад карыстальніка або прызначыць задачу).
  • We want to use a KPI to track how long that task is awaiting completion. The KPI shows green for tasks that are completed or due more than 3 days from now. It shows yellow if the task is due tomorrow or today. It shows red if the task is past due.
  • Вось футбаліст: Я хачу, што дата дыскаў, KPI, каб быць святам-Aware.

I can’t calculate a holiday-aware due date in SharePoint Designer workflow very easily. I would have to create a custom action or use a 3rd party tool. Аднак, it’s easy enough to calculate such a date in an event receiver. Merge those two together and we get a pattern like this:

  • Define a hidden yes/no site column on the document library labeled "DoCalcualteDueDate".
  • Ініцыялізаваць яго да ілжывым.
  • У адпаведны час у працоўны працэс (e.g. just before the "collect data" дзеянне), прызначыць гэта значэнне ПРАЎДА.
  • ItemUpdate() event receiver looks to see if "DoCalculateDueDate" is true. Since the event receiver runs on every update, "DoCalculateDueDate" Звычайна ілжывыя.
  • Калі рабочы працэс прызначае DoCalculateDueDate да сапраўднага, прыёмнік падзей разлічвае свята-Aware тэрмін.
  • Калі прыёмнік падзей робіць гэты разлік, яна ўсталёўвае сцяг DoCalculateDueDate да ілжывых.

У рэшце рэшт, SPD workflow is communicated with an event receiver via the DoCalculateDueDate semaphore and we have holiday-aware due dates that are assigned at the exactly correct moment in the workflow’s life. SharePoint Designer controls when the due date is assigned but the event receiver performs the actual calculation and assignment.

</канец>

Падпісацца на мой блог.

Пакінуць каментар

Ваш электронны адрас не будзе апублікаваны. Абавязковыя палі пазначаныя * *