Workflows represent situations where elements within your design can be found in a job. Workflow is a collection of steps that an item can follow as it circulates between actors. In cases where you start the flows that you have designed on Xpoda, the stages that are asked for the approval of the person are waiting for the user (the person who went to the approval) in the notification drawer. Through this notification drawer, you can manage the status of your flow and perform approval or rejection processes with explanations for the flow to proceed to the next steps.
As soon as you use the Send To Approval tool via the flow chart, a notification is sent to the notification drawer on the client screen of the relevant user.
Mail definition to the user is done through the Client interface. The mail field on the user identification screen is filled with the user's e-mail address.
The flow e-mail sent to the e-mail address is as follows.
By clicking on the link in the incoming mail content, you can go to the page where the relevant flow is started. From here you can manage the status of your stream.
In cases where you do not want to use this structure, you can approve or reject the flow from the incoming mail.
Now let's manage the flow over the mail together.
For this example, I need 2 form pages, the first is the form page where the flow starts and the other is the form page where the flow state is managed.
A form called Permission Request Form is designed as the form page where the flow starts .
TABLENAME: TABLEFORMS
The user who wants to use permission on this form page will select himself from the Personnel field and then request permission by filling in the relevant fields and clicking the Save and Submit button.
Two actions should be added to the Save and Send for Approval button. First, the Save action should be used to save the process, and then the Start Flow action should be used to start the flow.
Note: Since all fields will be cleared after the Save action, the flow will not know from which ID to start. For this reason, the Do Not Refresh After Save feature in the properties of the form page should be selected as Yes so that an ID value from which the flow can start is found on the form page.
If this feature is not turned on, the error you will receive in the submit button for approval will appear as follows.
After the processes are completed on this page, another form page is opened for the approval mechanism to work, and fields such as the following are added to this form page.
ProjectID, UserID, UserTableID containing the information of the flow will be sent to this form page via the link by using the Search parameter on this form page, so the relevant fields are added.
Then, the Flow ID field, where the FlowunID for this (ProjectID, UserID, UserTableID) information will be printed, is created, and then the Control field is added to the form page as the field to keep the Reject and Approval statuses.
Final image of the form
When the values entered in UID - UserID and ProjectID change, it is necessary to write a query in the relevant fields in order to find the ID information of the flow corresponding to these three. It starts with the action definition for the PID field.
When the value changes - With the value update action, the AkisID field is updated with the following query.
SELECT TOP 1 * FROM XPODA_WORK_FLOWS
WHERE FlowProjectID = '$PPID$' AND
FlowDocumentID = '$PUID$' AND
FlowState = 0 AND
FlowUserID='$PUserID$'
This action is updated by going to the Run Condition field and filling all the relevant fields. This action will not work until all of the PID, UID and UserID fields are filled.
SELECT CASE WHEN '$PUID$' = '' OR '$PPID$' = '' OR '$PUserID$' = '' THEN 0 ELSE 1 END
The same action is copied and added to the UID and UserID fields.
After the form processes are completed, it is switched to the Flow section.
The Find User and Send Approval flow elements are added to the flowchart.
In the Find User field, the information of the person or persons to be approved should be written.
For this example, it will be sent to a single user's approval and the ID value of the person who will go for the approval in the system is 26. Accordingly, inside the Find User element
SELECT 26
statement is written.
By clicking on the Document element, the Permission Request Form is selected from the Document field. Since the Start Flow action is given to the save and send for approval button on the permission request form, the Auto Start option on this tab should be selected as No.
Since the value will be sent to the permissions form page via the link, first a Public Form is created by going to the Permissions Form page.
When the Create Public Link button is pressed, a pop-up page will open as below.
On this page, the username and password of one of the client users is entered and the Create button is clicked on. A public link will be created in the link field, the created link is copied.
An Object is created by returning to the Flow field. Link will be created for Approval and Rejection statuses in this object.
A query is created for Links by clicking on the query wizard.
SELECT
CONCAT('https://xpodanew.xpodacloud.com//Forms/DisplayForms?fm=Z2s4Y25odGlsMmRSUVcwUDJmN3VKSGxrZ3FoUTI5bjF4ODZ3bWR2V1J4ZnRPZkJHZzNjdGdWUGdOZ0plMkF4NG90OXhpcXhZR1lYL0Q5bXIwcVpBY1UzYmtNU3lzbVpqWXI5Q2ZndTI0cUE90','&search=UID:','$PUserTableID$',',Kontrol:1,PID:189,UserID:26') AS OnayLinki
Values coming in using concat are combined. First of all, this link value is written as it will be the Public Link that we copied the information on which form page to go to. Then, when the Permissions form page is opened by using the Search parameter, the form fields are filled with the information we will send.
You can access more detailed information on the use of Search via this link.
https://docs.xpoda.com/hc/en/articles/4414587377170-Search-Parametresi-Use%C4%B1m%C4%B1
The names of the fields we have sent and the fields on the form page must be the same.
Since we are sending approval to a single user, a fixed value of 26 is sent to the UserID field. The ID value of the user who will grant approval in the system is 26. Since the link we have created is a confirmation link, a value of 1 (1 in the WORK FLOWS table means Approved) is entered in the Control field. The value returned as a result of the query is named as ConfirmLink by giving ALIAS.
Likewise, a link is created within the Red transaction.
CONCAT('https://xpodanew.xpodacloud.com//Forms/DisplayForms?fm=Z2s4Y25odGlsMmRSUVcwUDJmN3VKSGxrZ3FoUTI5bjF4ODZ3bWR2V1J4ZnRPZkJHZzNjdGdWUGdOZ0plMkF4NG90OXhpcXhZR1lYL0Q5bXIwcVpBY1UzYmtNU3lzbVpqWXI5Q2ZndTI0cUE90','&search=UID:','$PUserTableID$',',Kontrol:2,PID:189,UserID:26') AS RedLinki
The control value is changed to 2 (the equivalent of 2 in the WORK FLOWS table means Rejected). The ALIAS is called RedLink.
The query of the object created as a result is as follows.
SELECT CONCAT('https://xpodanew.xpodacloud.com//Forms/DisplayForms?fm=Z2s4Y25odGlsMmRSUVcwUDJmN3VKSGxrZ3FoUTI5bjF4ODZ3bWR2V1J4ZnRPZkJHZzNjdGdWUGdOZ0plMkF4NG90OXhpcXhZR1lYL0Q5bXIwcVpBY1UzYmtNU3lzbVpqWXI5Q2ZndTI0cUE90','&search=UID:','$PUserTableID$',',Kontrol:1,PID:189,UserID:26') AS OnayLinki,
CONCAT('https://xpodanew.xpodacloud.com//Forms/DisplayForms?fm=Z2s4Y25odGlsMmRSUVcwUDJmN3VKSGxrZ3FoUTI5bjF4ODZ3bWR2V1J4ZnRPZkJHZzNjdGdWUGdOZ0plMkF4NG90OXhpcXhZR1lYL0Q5bXIwcVpBY1UzYmtNU3lzbVpqWXI5Q2ZndTI0cUE90','&search=UID:','$PUserTableID$',',Kontrol:2,PID:189,UserID:26') AS RedLinki
The content of the mail is arranged by coming to the Send To Approval flow element.
Approval and Rejection Links created in the object are added to the mail content with $P.
The e-mail that will be sent to the user when a new registration is made and the flow starts when they come to the Permission Request Form page is as follows.
Since this usage is not user-friendly, in order to change the Mail content, return to the flow area and change the Mail content.
Two buttons are added for links by clicking the View HTML button in the E-Mail Content area.
You can customize the buttons by making css changes or writing a different html query. Sample html codes are as follows.
<html>
<head>
<style>
.button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.button2 {background-color: #f44336;} /* Red */
</style>
</head>
<body>
<p>Akışı onaylamak veya reddetmek için aşağıdaki butonları kullanabilirsiniz</p>
<button class="button"><a href=$POnayLinki$>Onayla </a> </button>
<button class="button button2" <a href=$POnayLinki$>Reddet</a></button>
</body>
</html>
After adding the html codes, click the Update button. The mail content will change as follows.
After all these processes are completed, go to the Permissions form page. And the flow update process is performed according to the FlowID value found.
In this usage we need two actions, approving and rejecting the flow.
For this, a button named Update Flow is added to the Permissions form page and two actions are added to it.
For the confirmation process, the relevant fields are filled by using the Update Flow action. Since the FlowID information is kept in the AkisID field, the AkisID value is written to the connected fields.
1 or 2 values are included in the Control value that comes with the Search parameter. Since 1 means confirm and 2 reject, and Type Of Operation Complete is selected in this action, a working condition should be added to the action as in the picture.
According to the value in the control, if it is 1, the incoming FlowID will be confirmed, other than that, the action will not work.
This action is copied and added to the button again. In total, there will be 2 actions in the button.
Reject value is selected instead of Complete value, the action is saved by changing the working condition. The final version of the copied action is as follows.
When the value changes by coming to the AkisID field, the button we just added is triggered with the change property action.