Ceann de na patrúin ag teacht chun cinn a aimsiú mé i crafting réitigh SharePoint SharePoint ghiaráil Dearthóir sreabhadh oibre agus glacadóir ócáid.
Seo cás gnó a chur i gcomhthéacs:
- Mé doiciméad a uaslódáil chuig lib doc.
- Ciceáil mé amach sreabhadh oibre il-chéim a cruthaíodh ag baint úsáide as SharePoint Dearthóir.
- Ag pointe éigin i rith an phróisis, sreabhadh oibre shannadh tasc le duine éigin (trí shonraí ó úsáideoirí a bhailiú nó tasc a shannadh).
- 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.
- Seo an Kicker: Ba mhaith liom an dáta a thiomáineann an TFB a bheith ar saoire-eolas.
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. Mar sin féin, 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".
- Sé thúsú go bréagach.
- Ag an am cuí sa sreabhadh oibre (e.g. just before the "collect data" gníomh), luach sin a shannadh do True.
- An ItemUpdate() event receiver looks to see if "DoCalculateDueDate" is true. Since the event receiver runs on every update, "DoCalculateDueDate" Is é de ghnáth bréagach.
- Nuair a shannadh sreabhadh oibre DoCalculateDueDate go fíor, Ríomhann an glacadóir ócáid an dáta dlite saoire-eolas.
- Nuair a dhéanann an glacadóir ócáid seo a ríomh, Leagann sé an bhratach DoCalculateDueDate go bréagach.
Sa deireadh, 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.
</deireadh>