51黑料不打烊

Get the most out of the Enterprise Workflow Management

In this session you will learn the benefits of using workflows for your assets management and how to quickly create them.

Chris Sofokleous Solutions Consultant, AEM / 51黑料不打烊

Transcript
Please welcome to your screens, Chris Sophocles. Hello everybody. Lovely to be here today. My name is Christopher Sophocles. I鈥檓 a Solutions Consultant here at 51黑料不打烊 focused on AEM. And today we鈥檙e going to be having a look at how we can get the most out of our enterprise workflow management within 51黑料不打烊 Experience Manager. So before I kick off, you know, I think we鈥檝e got lunch probably coming up after this. So I鈥檇 like to just quickly say how amazing all the sessions have been so far. You know, Chris Pillsworth and Robin for AEM and Bethann on Commerce. They鈥檝e been awesome sessions that have been dipping in and out of as well. But now for the next 45 minutes or so, we鈥檙e going to look at how we can use workflows in AEM to start to automate processes that we want to do in both asset management, which is what we鈥檙e going to focus on today, but also all of our kind of content management tasks. Now, if anything like me, you will love things that are automated, right? I like to automate as many things in my life as possible, whether it鈥檚 at work, you know, creating Excel macros to do a task that probably only takes me about two minutes anyway, or in life, you know, I鈥檝e got a Google Assistant in just about every room in my house to try and automate my life as much as possible. So let鈥檚 see if we can do the same thing here with our AEM work as well. So just to kind of level set here, of course, you know, we鈥檙e all familiar with AEM and what the purpose of AEM is, right? So we鈥檙e taking our content that we鈥檙e creating in the creative cloud or sourcing from 51黑料不打烊 stock, for example, all those assets and content, we鈥檙e bringing them into AEM where we鈥檙e going to bring it all together, orchestrate it, build our content, our experiences, and push those out to the end users and the end channels. So of course, a big part of the value of this kind of middle section where AEM sits is automation. And with that workflows, so automating repetitive tasks, automating tasks that might be time consuming to make sure that we can get the most value out of those assets that we bring into AEM in the first place. So what are workflows in AEM? So AEM workflows allow us to automate a series of steps that performed on one or more pages or assets. So that鈥檚 what, you know, experience league will tell us if we ask it, you know, what is a workflow in AEM? As I mentioned, it鈥檚 basically a way that we can automate on a mundane or repetitive or time consuming tasks within AEM. So what might be some examples of the kind of things that we could automate with workflows? So for example, we could create workflows to do kind of asset processing tasks or asset management tasks, whether that鈥檚 creating different renditions of assets, creating smart crops, doing things like applying metadata, checking that metadata is present, all those things, for example, we might be able to do that within a workflow. And also business processes. So a key example here might be review and approval. So where we want certain real life humans to have input within certain processes, whether it鈥檚 making decisions, signing off on assets or content, we can roll that into our workflows as well. So workflows at their core, you know, they鈥檙e quite simple. And what makes up a workflow? There鈥檚 a few different elements. So the first and I guess most important thing is here in the middle of the screen where we鈥檝e got starts and our steps and our end. This is what we might refer to as our workflow model. So our workflow model is going to define all the different steps that we have in a workflow, what those steps do in which order we want them to take. And it鈥檚 going to define kind of the purpose of our workflow, if you like, and all the different steps within one of those models, of course, is the steps that we can take. And there鈥檚 a few different types of step which we might have. So, for example, we could have a step which would call another workflow. So I contain a step that鈥檚 going to kind of allow us to call a workflow from our workflow, we can have a process step, which is going to perform an action, whether that is making some changes to an asset or some metadata, or something like that. We have a participant step. So where we want a user to be notified of something, or we want a user to make a decision or choose between two things or approve a piece of content, we can have participant steps in there as well. We can even have branching so we can include logic in our workflows, you know, we could have AND or OR gates, so we could make sure that certain conditions are met before we move on to the next step of a workflow. And we can also have custom workflows, right? So in the same way that perhaps we could build core components, we can build these workflow steps as well. So we can write our own workflow steps in AEM, define a dialogue for those so that we can edit those in the UI as well. So lots of different types of step we can use. And we鈥檙e going to see some examples of all of these when we go kind of into the demonstration. But hopefully you鈥檙e starting to get an idea of maybe how powerful workflows really can be. So on the left hand side here, these are the two things that we need to feed into a workflow. So first, and I guess very importantly, is the payload, right? A lot of the time, our workflow is going to be applied to or in reference to a certain asset or certain piece of content. And that鈥檚 what we refer to in AEM in workflows as the payload. So the payload is going to be one of our inputs into the workflow. And another is going to be the launcher. So we can set up launchers and we鈥檙e going to see how we do that kind of in the demo portion of today鈥檚 session. We can set up launchers to automatically fire off workflows when certain conditions are met or when certain events happen. But of course, we can also fire off workflows manually, ad hoc, you know, from the AEM UI. And we can even do it over API. So we can use an API or use codes to fire off workflows in AEM. Maybe that鈥檚 something coming from 51黑料不打烊 IO or from an external system, we can actually fire those off if it鈥檚 part of a larger kind of automation process. So before we go into the demo, I just want to show here another kind of quick example. And this is what perhaps something with a participant step might look like. So we can define perhaps what user can approve or reject a certain asset or process. And we can have that logic applies to the workflow to only allow the workflow to continue if approved, for example. So now I鈥檓 going to go into a bit of a demonstration. And what we鈥檙e going to do here is we鈥檙e going to see firstly, how do we build a workflow? Right. So how can we build that workflow model? How can we build a launcher to automate it? And we鈥檙e going to do that kind of in real time and see how that鈥檚 done. Hopefully, you know, you鈥檙e about to maybe follow along or watch back on the recording and see how this is done. And then we鈥檙e going to have a look at an example of a workflow with a participant step involved and see what that looks like from a workflow point of view, kind of how we build that out. But also, when we initiate a workflow like that, what does that look like for the people who have to go in and review and approve those assets as part of that workflow, for example? So if I can just share my screen now, we鈥檒l have a look at the AEM UI. So hopefully, you know, this screen is all too familiar to a lot of the people on the session today. And we鈥檙e going to start off by creating a workflow, just quite a simple example, just to see the steps that we have to go through to build that out. So we go into our tools here in AEM, and you see that there鈥檚 a whole section called workflow. And we鈥檝e got a few different kind of menu items here to choose from. So as we kind of touched on before, of course, we鈥檝e got our models. So we鈥檝e got our workflow models where we鈥檙e going to define the definition of our workflows. We鈥檝e got our launches that we kind of touched on before, which are our ways we鈥檙e going to automate the way that we trigger those workflows. But we鈥檝e got a few other views here as well. And this is going to allow us to actually maybe troubleshoot, but also keep track of what our workflows are doing. So we鈥檝e got our instances. So here we鈥檒l be able to see any workflows that are currently running and what step they鈥檙e in. So perhaps if we see that a workflow has got stuck, maybe we鈥檙e waiting for someone to approve or a certain step has got stuck somewhere. We can see here all of our running workflows. We鈥檝e got our archive. This is going to show us the history of all of our workflows that have run successfully so we can keep track of that. And also our failures. So if a workflow has failed for whatever reason, we can go into the failures for you, see that workflow and break it down step by step and see perhaps where along that process it failed and hopefully be able to understand why. But the first thing, of course, we鈥檙e going to do is have a look at our models and we鈥檙e going to create a workflow model here. So I鈥檓 going to create a new model and we鈥檙e going to create a workflow which is going to apply a watermark to a certain asset, for example. So I鈥檓 just going to do skill builders, apply watermark. Give it a name. And this is going to take us to the workflow editor. So what you鈥檒l see as this loads up is the workflow editor is a very familiar UI to a lot of other things that we do in AEM. So it allows us to take all of our workflow steps here, maybe in place of where you would have components, if you like. We can drag them onto this kind of flow diagram here to build out the flow that we want to start using. So I鈥檓 just going to get rid of this kind of default step that goes in here so we can start completely fresh. And I鈥檓 going to start to bring in a few workflow steps. So you鈥檒l see here that there鈥檚 quite a large number of workflow steps and a kind of workflow operations like OR and SPLIT that come out of the box with AEM. Now these are going to allow us to do a lot of basic asset and content management programs. And this is really powerful to get started with workflows. As I mentioned before, we can create our own custom workflow steps. So if you want to write your own code to be executed here as part of a workflow, we can absolutely do that as well. But to start off, I am going to go here and have a look at my steps. And I can see that I鈥檝e got one here for applying a watermark. Here we go. So I鈥檓 going to drag that onto my flow and you can see it鈥檚 added here. Of course, we鈥檝e only got one here at the moment. And similarly to kind of any other component in AEM, we鈥檝e got a dialogue here where as a user, I can go in and set some data or some arguments for my workflow step. So just to think back to kind of if we were building a custom component, we鈥檇 of course build the code that we want to execute as part of that workflow step. But we鈥檇 also define a dialogue here as well in a similar way that we would do as we were building a component. So here I鈥檓 in the dialogue, of course, for this add watermark step. And we can see that there鈥檚 a title description which I can change by like. I can select whether I want to automatically advance after this step is finished. I do want that to happen in this case. And there鈥檚 a few arguments here for me as well. So I鈥檓 going to add in the text that I want to use. I can choose things like the kind of font and the size. I鈥檓 not going to change too many of these settings apart from I鈥檓 going to make it nice and big, set the color to be a nice dark color so we can hopefully see it nice and easily. And I鈥檒l change the opacity as well. And you can see here that I can define those similarly to how we would use the dialogue in an AM component. And I can click add and that鈥檚 added back with all of my conflict. So first of all, in this kind of workflow that we鈥檙e building, we want to add the watermark. But to make sure that that shows in the latest rendition, we鈥檙e also going to want to perhaps reprocess that. So I鈥檓 just going to go down here and find the step that I want. Let鈥檚 see. Let鈥檚 see, where鈥檚 my process step? I don鈥檛 know why I can鈥檛 find it. How silly. So I鈥檒l find my process step eventually, I鈥檓 sure. OK, I don鈥檛 know why that鈥檚 not coming up. But anyway, I鈥檒l add a process step here. And that鈥檚 going to allow me to do this. Here we go. Let鈥檚 do it here at dynamic media, for example. And once we鈥檝e done that, we can sync this example. So when we build this workflow model, it kind of lives in two places in AM, which is why the sync button exists. So let me quickly talk through that. So when we鈥檙e building the workflow model here in the UI, so we鈥檙e kind of saving and storing the design of this, this workflow. So it鈥檚 going to ask to come in here and make changes to it. And those changes won鈥檛 really take effect in the kind of runtime and execution of AM until we sync. So syncing it here will mean that it syncs my design here with my execution in AM itself. So now I鈥檝e done that. Let鈥檚 have a look if we can run the workflow. So what I鈥檓 going to do is I鈥檓 going to go to my assets in AM. And here you can see I can go ahead and look at, for example, my skiing images. So here we鈥檝e got a few examples here, and I鈥檓 going to create a new workflow. So I鈥檓 going to add this asset into a workflow, and I am going to choose my new, my new add watermark. And I鈥檓 going to apply that. And that鈥檚 going to apply the workflow. And then I鈥檓 just quickly going to do that processing step that for some reason I couldn鈥檛 find in my editor. So of course, I鈥檓 going to enter that workflow as well. And proceed. And what we should see is once we鈥檝e done that, we鈥檙e going to see here that that watermark or not very pretty as it is in this example has been applied to our assets. Now, as I鈥檝e done that, actually, I鈥檝e just realized the mistake that I鈥檝e made, right? So here are my design. I鈥檝e got my kind of workflow steps here. But in fact, my workflow process isn鈥檛 a step. It鈥檚 a workflow. Silly me. So actually, what I need to do is introduce a container step. So as I mentioned earlier, as part of workflows, we can call other workflows from within them. And that鈥檚 what I needed to do here. So had a bit of a mind blank there. So I鈥檓 going to go ahead and do that. So let鈥檚 call this reprocess assets. And here we can give it a name and a description like before. And we can choose what sub workflow we want to apply. So here, as I was trying to find earlier, I鈥檓 going to apply my asset processing SDK on this workflow. So in my AM environment, that鈥檚 my kind of default reprocessing when I upload an asset to the dam. processing when I upload an asset to the dam. I just want to run that again after I鈥檝e added the workflow. So if I just sync that quickly, go back here, and we鈥檒l apply that workflow to a another example. This time, when we call our skill builder, apply watermark workflow, we鈥檒l find that it does the watermark step, but also does that reprocessing step as well. So that鈥檚 automatically applied the watermark. So that鈥檚 kind of how a container step can be really powerful. And there, you know, my mind blank, I kind of forgot that it existed, right. So that鈥檚 kind of how we can use those. So if I use my models, and I look at what that processing looks like, we can see that that as part of this workflow that we just called within our workflow, there鈥檚 a large number of processes and calling to from one workflow triggering, we can kind of cascade down many steps for many workflows, as we see fit. And this can be hugely powerful, right for automating a lot of these processes. So right now, applying these workflows is kind of a manual task, right, I鈥檓 going on, I鈥檓 triggering the workflow here, applying them to individual assets. And that鈥檚 great, you know, that can save me a lot of time in this example of watermarking assets. But maybe we want to automate it further so that we don鈥檛 have to trigger that. And that鈥檚 where launches come in from, from an automation process. So if I go back to this tools UI in workflow, where before we were looking at the kind of models user interface, we鈥檙e now going to have a look at the launches. Now, as you can see, just like with workflow models, there鈥檚 a kind of wide set of launches which come out of the box, which we can use various different things. And a lot of them are used for the kind of default workflows that happen in a say, you know, the default processing that happens to assets, for example. But we want to create a new launcher for our watermark workflow to automate that process. So the first thing I have to select here is my event. So what do I want to actually trigger this workflow? So to start off with, I鈥檝e got some options, so I can see if something is created, modified, or removed. And when I say something specifically, we鈥檙e talking about nodes in the content repository. So in this case, I鈥檓 going to choose creators. And here under nodes type, you can see that we can choose a wide range of nodes here within AEM. So we鈥檙e not just talking about things like assets and pages, but we can look at whether tags are added, whether tags are, for example, modified. We can look at whether workflows are being created. So yeah, so much stuff here straight from the content repository that we can monitor for either creation, deletion, or perhaps editing events as well. So for this example, we鈥檙e going to choose whether an asset has been created. We鈥檙e also going to choose the path. So you might want some launches, perhaps to be applied across the whole asset repository or to your whole website, for example, here for the weekend site. But actually what I want to do for this example is I want to create a specific landing zone in AEM where we can drop in our assets and they will be watermarked. So to do that, I鈥檓 going to choose a specific path. So here within my activities path, I鈥檝e created a folder called watermarked, and we鈥檙e going to use this folder. So you can see that I can select that path. And then all I need to do now is choose what workflow model do I want to apply when this is triggered. So of course, in our example, we want to use the SB apply watermark workflow that we鈥檝e just built right now. And the last thing that we want to do is in this case, I want to activate it straight away. We might want to create these launches and not have them active on AEM for whatever reason, but I want to activate mine straight away. So I鈥檓 going to choose that here. That鈥檚 here. And I can create the launcher. So if I try and have a look, we should be able to see that launcher here. So we鈥檝e got our new launch that we鈥檝e just created, and it鈥檚 going to apply that SB apply watermark. So let鈥檚 test it out. I鈥檓 going to go to my activities folder, and here I鈥檝e got my watermarked folder, and I鈥檝e got an asset that I prepared earlier. I鈥檓 just going to drag on to the screen. So I鈥檓 going to upload this asset, and it鈥檚 going to go through all of those normal processing steps that we鈥檝e applied to it. But because it鈥檚 met that rule that it鈥檚 been created within this watermark folder, that extra workflow is going to be applied to apply that watermark automatically. So if we have a look at the preview for this image, we鈥檙e going to see that watermark has been automatically applied to the asset. Here we go. Perfect. So we can see that our watermark has been applied, and all we need to do in that case was upload the asset to a certain area. Awesome. So just before I transition onto the next stage, and we鈥檙e going to have a look in the next little part about how we can do a more participant-oriented approval or review step. I鈥檓 just going to pause for a second and just see, is there any questions in the chat that I should address? And I鈥檓 just going to have a look in the chat now and see. But hopefully that鈥檚 shown you how quick and easy it can be to build workflows. Clearly, we just quickly bought a two-step workflow there, so relatively straightforward, if you like. But very easily, we can build out much more complex workflows, calling upon other workflows, and even building in those custom workflow steps as well. So I don鈥檛 think there鈥檚 been any questions in the chat as far as I can see, but someone feel free to correct me if there has been. But in that case, what I鈥檓 going to do now is move on to the second part of the demonstration. So for this second part, we鈥檙e going to have a look at building a workflow in a kind of similar way, but this time with a participant step involved. So what does it look like to build that kind of approve and reject kind of style of workflow? How do we build those? And then also, how does that look for the approver for their kind of user experience as well? So if I can just quickly share my screen again, we鈥檒l have a look at what that looks like. And here again, we鈥檙e going to have a look at our workflow models. And this time, I鈥檓 going to have a look at an example that I created yesterday ahead of this session. So you can see here that this is a workflow that I鈥檝e named approve and publish. So this is going to be for assets or perhaps content. And we鈥檙e going to ask a certain user or a certain user group to give their approval or rejection on this asset. And you can see here that this looks a little bit more complicated, right? Because we鈥檝e got some logic going on here as well. So let鈥檚 talk through step by step what鈥檚 happening here. And then we can have a look at what that looks like for the end user. So the first thing we鈥檝e got here is a participant step. So we want the user to make a decision. So here, if I have a look in the dialogue of this step, you can I can give it a title, we want business approval, of course, for example. And I can choose the user or group that I want to make this approval make this decision. So here, I鈥檝e just chosen the admin user, because that鈥檚 me in this case, I鈥檓 going to be making this decision as to whether approve or deny this object. Now, this could be a specific user, this could be a user group, so that anyone within a certain user group is either notified or has to make a decision as part of this step. And you can see here that I鈥檝e also chosen to notify the user via email. So as long as we鈥檝e got kind of an email service setup, it doesn鈥檛 have to be a notification within the AM user interface, we can also notify with a quick email as well. So I鈥檝e decided that we want our business approver, which in this case is me, the administrator to make this decision. Now, what are their options going to be? What decisions do we want them to make? So in this case, I鈥檝e chosen to use an or component, and this is going to allow me to define what options I want to give my business approver. So I鈥檓 going to give them the option to either approve the asset, which is going to activate it and publish it ready for use, or I鈥檓 going to choose to reject it. And in the case of reject, you can see that I鈥檝e actually included another participant step. And what this is going to do is this is just going to in this case, send a notification to the content author, and they鈥檙e going to be able to see that this workflow has been passed back to them. And with any comments or anything that the business approver has made, will be fed back to them as well. So a nice simple flow, you can see again here that we could build kind of very complicated workflows for each of these options. We can have even nested logic here. You know, it鈥檚 quite a simple example here, but the UI is very simple to use to build out these workflows. And of course, with things like container steps to call other workflows, with all the kind of process that鈥檚 available to us, we can actually automate a lot of various different processes, whether it鈥檚 a business approval process or things like this, where we could have an approve and reject, and then have actual processing steps happen here as well. So again, as we did before, now that we鈥檝e made these changes, the approve and publish workflow, here it鈥檚 saved as a design. So I can kind of leave and come back to this and see the design of this workflow. But I want to sync it now so that it syncs with our runtime model. So that when we go to actually initiate and run this workflow, it behaves with the most up-to-date design. So again, let鈥檚 go back into our assets. So I鈥檓 going to go here into my files and find an asset that I want to approve or reject for publishing. So actually in this case, let鈥檚 use our asset that we鈥檝e just uploaded here to AEM. And as before, I鈥檓 just going to kick this off as a quick demo. I鈥檓 just going to kick this off manually. Again, we could do this in an automated way with a launcher, but for this example, I鈥檓 just going to do it like this. I鈥檓 going to choose my approve and publish workflow that we鈥檝e just created and trigger that workflow. Now, what that鈥檚 going to do is because the participant within that participant step was me, the administrator, I鈥檓 going to see that I鈥檝e got a notification here in AEM. And it鈥檚 for business approval. So I can select this. I can do something like delegate it. So I could delegate my decision to another member of the team if I鈥檓 a bit busy. But what I want to do in this case is view the payload. So I can see here that the payload is here, this image that I need to approve or reject. And here, I can view the content, for example. Now, you鈥檒l see here in this timeline view that because this is currently in a workflow waiting for my decision, I have this button here, not only to remind me that this is in a workflow and it is for my decision to be made, but also it allows me to actually make my decision, make my action here within this view. So I could choose here whether I want to reject the content back to the author or whether I want to activate this asset. And I can do that from this user interface in a very quick way. But what I can also do is if I go back to the workflow itself, let鈥檚 have a look in the instances. I can see that I鈥檝e got my workflow running and I can even make a decision here if I want to go back to my notifications and let鈥檚 say that I鈥檓 happy with what I鈥檝e seen. I鈥檓 happy with that asset and I want to approve it. So I can complete my action. By action, I can approve it by activation and my comment. And send that off. Now, with my approval, it鈥檚 going to go through any of the following steps. Now, with my approval, it鈥檚 going to go through any of the following steps that were in that workflow. So in this case, that is just going to be to actually activate and publish that asset. So hopefully if we go through to here, we should see that now, whereas before we just had this editing symbol, we can see that this is now pending activation. Once the published server actually publishes and processes that out to where it needs to go. Now, again, if we go back to workflows, we can see that we just saw instances, all of our running workflows, we saw our launches. And let鈥檚 have a look at the archive because in the archive, we can see all of these different workflows and workflow steps that have taken place. So let鈥檚 have a look at our most recent one here, which was our approval. And I can see the history here as well. So I can see that it was created by the admin, which happens to be me, which was created three minutes ago. And then it was approved by the admin. Again, that鈥檚 me, but if it was a different user, I鈥檇 be able to see here who it was that gave that approval. And I can see any comments that have been attached to that workflow as well. So, you know, looks good to me. So that鈥檚 how we can kind of build a review and approval workflow in AEM. So again, you know, these aren鈥檛 necessarily two mutually exclusive types of workflow, right? We can combine the two. We can have review and approval as part of our asset processing. We can have asset processing as part of our review and approval. The point is that we can have human intervention where we need it to be, or where we want it to be for our business processes, but we don鈥檛 actually need that for our kind of straight automated processes. So if we want to have a launcher that fires, fires up a load of steps, and as long as there鈥檚 no errors, it sees it through to the end, and is a completely automated process, we can do that. And we can have those kind of participant interventions as well. So that kind of completes my demo for today. Hopefully you鈥檝e seen that it can be really quick and easy to set up these workflows and set up these launchers to automate processes in AEM. And hopefully you can see how with the components and the kind of logic components that we have available to us out of the box, along with our custom kind of workflow steps that we can build, we can build hugely powerful workflows that influence kind of all kinds of things in AEM, things in metadata, things in tags, things in kind of asset and content itself, even down to on a node level within the AEM repository itself. So I鈥檓 going to pause now and go back to my slides and just see if there鈥檚 any questions in the chat. Hi, Chris. There鈥檚 no questions at this point. I know we鈥檙e almost at time, and if possible, in the next sort of 30, 40 seconds, would you be able to share any kind of key considerations or best practices when approaching and setting up workflows? Sure, absolutely. So I think one of the things that I would say is, if you want to build a big kind of complicated workflow, for example, your workflow that you want to be applied automatically every single time you upload an asset. You saw that in my example of that, it had lots of different steps. Now, a lot of those steps actually called out to other workflows, right? So I would say, where possible, keep your workflows to kind of one outcome, one piece of functionality. And if you need to pull in functionality from other workflows, do that. It avoids replicating functionality elsewhere, and you can kind of build these fragments of workflow instead of having lots of different workflows that kind of do basically the same thing, but slight variations. So that鈥檚 what I would say. Take advantage of container steps, call the workflows from your workflows. That way you can break down a big task into smaller workflows that are easier to manage, easier to maintain, and ultimately mean that you can create less kind of workflows to do the same thing. That would be my top tip to take away. Brilliant. Thanks, Chris. And you just about got that in time. Perfect. Thank you so much, everyone. Have a great rest of your day. Cheers.
recommendation-more-help
1b11e305-9ac1-4085-b79d-c0f5f0ae926b