Freitag, 30. Juli 2010

Sharepoint Designer workflow does not react on if -> else if

Wenn in dem Schritt, welchen Sie bearbeiten ein Approvalprozess gestartet wird und folgende Abfrage stattfindet:
If Aktuelles Element:Approval Status equals 1;#Rejected,
diese aber im Workflow nie abgehandelt wird, liegt es daran, dass der Statuswert nicht gesetzt wird.
Man muss sich das so vorstellen, dass der Approval Prozess ebenfalls aus einem Workflow besteht und man dort
definieren muss, was passieren soll, bzw. welche Werte wo gesetzt werden müssen, damit es funktioniert.
Ein simpler Workflow von mir sah so aus:

When there is the following if-clause in the apporval process, that you started:
If Current Element:Approval Status equals 1;#Rejected,
but the workflow never reacts on that, then the reason is, that the value is never set.
You have to consider, that the approval-process contains out of a workflow definition itself and you have to define there, what
has to happen, or what values need to be set, to make it work.
A simple workflow of mine looked like that:
WorkflowStep1

Grossansicht anzeigen - Show large image


Dort hatte ich das Problem, dass if und else einfach immer Approved ausgegeben haben. Das ist damit zu erklären, dass
der Prozess an sich immer approved = true ist, ausser der gesamte Workflow wird gelöscht oder beendet.
Was Sie gerne hätten wäre aber, wie der Prozess abgehandelt wurde, ob der Nutzer approved oder rejected hat.
Hierzu den Prozess einmal dort anklicken wie in der Grafik unten, damit man den Workflow des Porzesses bearbeiten kann.

There I had the problem, that if and else always returned approved. The explanation for that is, that the process itself always
returns approved = true, except you delete the workflow or cancel it.
What you want to know is, did the user approve or reject during the process.
Therefore click the process, like the image below shows you, to be able to edit the process itself.
WorkflowStep1

Grossansicht anzeigen - Show large image

Sie gelangen dann in die Eigenschaftenübersicht des Prozesses. Dort befinden sich auf der linken Seite die wichtigsten Einstellungen.
Klicken Sie den 3. Item in der Liste an, dann gelangen Sie in den Prozessworkflow. Der 2. Item könnte auch interessant sein,
wenn Sie Eigenschaften nach dem Prozess definieren wollen.

You will get to the settings overview of this process. On the left hand side you will see the major settings. Click on the 3rd item
in the list, then you will get to the process workflow. The 2nd item might be also very interesting for you,
when you want to set properties after the process happens.
WorkflowStep1

Grossansicht anzeigen - Show large image

WorkflowStep1

Grossansicht anzeigen - Show large image

Wenn Sie den 3. Item geklickt haben, sehen Sie den Workflow und dort gehen Sie bis zum Ende der einzelnen Schritte.
Am Ende befindet sich "When a task completes". Dort müssten Sie die Werte setzen, wie es in der Grafik markiert hervorgehoben
wird.

When you clicked on the 3rd item, you see the workflow and there go to the last step. There you will find the "When a task completes" step.
There you have to set the values, like I highlighted in the image below.
WorkflowStep1

Grossansicht anzeigen - Show large image

Dadurch werden die Werte während des Approvalprozesses gesetzt und man kann diese dann im eigenen Workflow auslesen und verwenden.

This way, the values are set during the approval-process and you can use those in your own workflow.

Keine Kommentare:

Kommentar veröffentlichen