how to schedule approval/Rejection workflow in aem? - workflow

I have a requirement to develop approve-reject workflow. If user wants to approve the content he may schedule the activation by selecting date and time field from the review stage(workflow inbox), if he rejects the content an email notification should be sent to approver group and workflow initiator.
I used dialogue participant step to configure datetime field and approve group where approver can select the date.
How can I achieve the remaining functionality.
Is there any OOB functionality available.

You could create a custom Process workflow step that uses the Scheduler API to schedule a Sling job at the timestamp that was chosen by the user in the participent step.
That Sling job can use the Replicator API to replicate the approved content.

Related

Email on asset unpublish AEM OOTB

I want to send mails to user when his asset gets unpublished using the OOTB feature.
So, after I configure the Day CQ Mail Service and add email ID to the user details, is there anything else that I need to do? Or will the user automatically receive the email?
You can configure a workflow launcher to run on publish with the event type "node removed". In your workflow model you are going to check if the deleted node is a dam resource and if so, the next step is to configure an email step to send an email to your preferred user. The user and his email should exist on publish. If your users exist only on the author instance, you need a custom step with some kind of publish author notification mechanism or alternativ reverse replication.

workflow step for user Schedule a time for next step.?

Do we have any OOTB workflow step that can take a user input (like Date selection) Schedule time to take in one workflow step and trigger the next step according to the scheduled time.
You will have to create a new page action like "Schedule for Review" in the authoring mode. See this https://github.com/Adobe-Marketing-Cloud/aem-authoring-extension-header-backtosites
On click of the page. You can take the user to a custom servlet that will scheduler you workflow.
#Reference
Scheduler scheduler
scheduler.schedule()
your workflow can be triggered using workflowSession
For the scheduled for approval step - use a dialog participant step and associate a dialog with your participant step. This will ensure your user inputs approval schedule date and time
Write a process step to attach another scheduler to your previous approval request you can use #Replicator to publish page at run time

AEM Workflow process steps should not be shown to user after initiation

I have configured the workflow for a particular user group(author), who can only initiate the workflow, rest of the workflow steps should not be shown to user. In the current scenario if I am giving user to execute the workflow then all the process steps are showing in his page. I want to restrict the author to perform other process steps, they should only initiate the request only.
Please provide more information in the user group privileges so that I can allow or deny these rights to particular user.
thanks in advance
To restrict access for users from this group to all steps (except triggering workflow), these steps should be assigned to other participant (like administrators group).
You can assign the steps to the wf initiator or you can use other participant selector and there you can specify the assignee of the workflow. This way you can define which groups have access to the dialog.

Workflow for Servicenow Incidents

I was just checking for the feasibility for workflows on Incidents and found this post.
It seems it is possible to have workflows on incidents.
I just need to know is there any proper way to do it..I am kind of new bee to Servicenow. anyone share the experience and how can I achieve this.
For instance, a simple approval workflow on the Incident..
Thanks in advance Chitra
A few basic changes can get this going, since the Incident table has the Approval fields and such associated to it.
Alter the Incident form
Go to an Incident
Configure (Fuji) or Personalize (Eureka) the following
Form Layout > Add the Approval field
Related Lists > Add the Approvers list
Create workflow for approval
Next you want a workflow to run when an Incident is created.
Go to the Workflow Editor
Create a new workflow with the following
Name: Incident - Approval
Table: Incident [incident]
Activity pinning: Set by activity
If condition matches: Run the workflow
Condition: Leave blank
Leaving the Condition blank will cause it to run on creation of an Incident.
Fill out workflow
Add the following activities
Approval Action
Name: Set Requested
Action: Mark task as requested
Approval Group
Name: Wait for Approval
Groups: Select the group who will approve all Incidents, such as the Help Desk. Important: This group must have group members or this will automatically be approved.
Leave the rest as default
Approval Action
Name: Incident Approved
Action: Mark task approved
After creating this, connect the Approved node from the Wait for Approval action you just made to this activity. Also connect the Always node to the End Activity
Approval Action
Name: Incident Rejected
Action: Mark task rejected
Like above, connect the Rejected node from the Wait for Approval action you just made to this activity and connect the Always node to the End Activity
Test the workflow
Finally you can test this by Publishing this workflow and creating an Incident.
Publish your workflow
Create a new Incident and open it
Note the Approval field should say Approval requested
Under the Approvals Related List, you should see a list of all users inside of the group you set within the Wait for Approval Activity
If any user in this list Approves it, the Approval field will change to Approved
If any user in this list Rejects it, the Approval field will change to Rejected
I've put in a sample picture below, but this is a very basic workflow. It can get more complex as your needs change or are different. Hopefully this gets you on your way to a start.

Running a Workflow instance for a specific time using workflow foundation

Let me explain the scenario. I want to start a workflow instance which will create a request approval process. There are different levels and each level has approvers and specific time is assigned for each level. An approver should approve within the given time to complete process or he/she may be alert again to approve once the assigned time of the level is over.
A user may request something by starting a approval process this would intiate a workflow which will create a workflow instance for the specific request. when the process starts it will inform the respective approvers in first level to approve the request made by a user. if a approver failed to approve within the given level time the approver will be alerted to approve the request and it should pause the workflow and wait for it. if he managed to approve the request the process should moved to the next level and continue with the same process until the number of levels are over.
Can i do this using windows workflow foundation. I read and understood that invoking a workflow, bookmarks can be used for this. i need to how can i manged the background timer for each level and alert the users. im stucked at that point please help me.
if there is a better solution please feel free to talk :).
Yes you can achieve this by using a Pick activity which has a timer (delay) activity and your custom approval activity inside. Pick activity will choose only one PickBranch to complete when ever either of the contained activity is completed. That said if the timer activity is triggered, the custom approval activity will be cancelled then. And you can choose to do what ever you what to do afterward such as sending emails to notify the involved approvers that the task was expired. WF has a lot of potential but it seems this technology has been left in the corner by its vendor for a while...