Is it possible to trigger the workflow manually? - tridion

Is that possible to trigger the workflow manually?
Say for example that I don't want to trigger the workflow when I save and close my component, but I want to update the component multiple times and, after I feel I am OK, I want to trigger the workflow attached for component.

Like Jeremy said it's not possible (yet), but it would also spoil the whole idea of Workflow that is - you can't have unapproved content checked in. In your case, you can edit component as many times as you want. No matter if you just save it or save and close. It will pass on to the next activity in workflow as soon as you will report "i'm done" - that is finish your activity.

You have to understand a few things about Tridion workflow. It is not designed or intended to be a process workflow, it's an approval workflow.
When changes are done to items that require workflow, workflow starts (item is locked). When you're done with the changes, you finish your activity and move on along the workflow process.
From the sound of it, you're probably working for an organization where workflow drives content publishing, while Tridion was designed from the ground up to not require workflow to publish to a website, workflow is simply for organizations requiring additional validation steps (some would say it's because they can't trust the editors, but that's a different story, which is easier to solve with permissions than workflow, but I digress).
Anyway, the good news for you is that the Workflow engine is being re-designed as we speak, and the next release will bring a lot of new process-oriented concepts into our workflow engine. But currently, what you want to do is not possible.

No, this is not possible. Workflow can only be triggered on the Save of an item. For the situation you mention you simply need to finish the initial activity at the point you are satisfied with the content.

Related

How to track HTML changes from another team that could break analytics rule conditions?

My department has analytic rule conditions in DTM that trigger events based on particular classes or custom data attributes. I'm concerned that if our dev team makes a change that would break the rule, we wouldn't find out until it's discovered that the metric is no longer tracking.
We're trying to future proof our scripts to allow for changing conditions (eg: using regex for changing class names &/or functions to traverse the DOM to find a condition without it needing to be hardcoded), but I thought someone here might have experience with this type of issue. How was it handled at your company?
**EDIT:**I'm exploring using custom Data Elements within DTM that are created with javascript that has multiple conditions for traversing the DOM in ways we've identified. So a sort of data layer that's controllable by my team.
Note: This isn't really an actual coding question; more of [analytics/marketing tag] coding principles/best practices. So I'm not entirely sure this question belongs on SO (maybe one of the other stack exchange sites, perhaps superuser.com?). But I'll answer here anyways.
TL;DR - You need to get site devs involved and have them take on some level of initial and ongoing ownership of it.
Tag managers sell themselves on being able to deploy tags without getting site devs involved, and many times this works out in the short term. But in my experience, this kind of passive deployment just doesn't work out in the long term, especially for websites that have active and regular changes over time.
In my experience, the only way to effectively help prevent site devs from inadvertently breaking the tracking from this, is to include the site devs in the deployment and make them take ownership of it on some level, so that it is something they are aware of within their own system/flow.
Sometimes it is as easy as having designated classes or attributes added to html tags on the page. For example, you can write a spec for the site devs to add a data-analytics='true' to any header, footer, CTA links on a given page, and tell the site devs this is something they need to keep as part of their workflow whenever they make changes to the site.
For more complicated things, you could spec for them to do something like broadcast a custom event for you to listen for. For example, maybe you have a purchase confirmation page and right now you have code in DTM to trigger based off the URL, or scrape the page for details about the purchase to push to tags. Instead, create a spec with instructions for the devs to put that in a data layer object and push to a custom event, and then create an event based rule for it.
The overall theme here is to create a spec document for all the things you want to be able to track on the website, that you know you can't reliably passively track without it breaking sooner or later, and hand the document to the devs and tell them they need to make it a part of their flow when making changes to the site. Bonus points if you can get them to loop you in whenever changes are going to be made and pushed to production, that you may go to your dev/qa version of your site to test to make sure your tracking still looks good.
The overall overall theme here is in order to prevent site devs from breaking your tracking, you need to be more proactive about making them and keeping them aware of your tracking, and in practice, this usually means putting some of the code work on their plate to own, so it's something in their history, in front of their face to see and know about. Because it is a lot easier for a dev to take notice of a data-analytics='true' in the header nav links they are about to restructure, than knowing hey, some piece of code in DTM relies on this current structure.. something that's not more directly in front of their face in their own code editor/environment.
Yes, actually accomplishing the above is often easier said than done. But it is the reality of the situation. Passively tracking things in a tag manager rarely works out for longer term stuff, short of "every page" tags that have little or no customization requirements at all.
I tell you from my own experience of over 10 years of working in the digital marketing and analytics industry, specifically with implementation, I have seen this time and time again. Too many times to count. Clients often want to and actually take the easier route of leaving the site devs out of the loop, all tracking requirements done solely through whatever the tag manager is capable of doing.
I've seen setups with hundreds of rules with trigger conditions based off scraping the page for some id or class, or some complex css selector dependent on 5 levels of html structure not changing. Or some random cookie you just assume means what you think it means. And you're spending more and more of your time playing whack-a-mole trying to re-adjust/fix individual rules/selectors as the next random change happens, and then one day comes a full site redesign and it's a nuclear bomb on all your tracking efforts.
And time and time again, without fail, eventually they wind up asking exactly what you've asked here, kicking themselves in the arse for the time and money they spent already on it for that "quick win", because nobody is confident in the data and they're wondering why they are allocating money/resources on tracking if it's just a bunch of trash, broken, pothole data. And the solution to it has always been "site dev awareness".
If it helps.. one card I sometimes play if I have a hard time convincing the dev team or other powers-that-be to jump on that bandwagon, is to point out that one of the biggest reasons for tracking websites is to help companies determine whether or not it's worth investing money in said website. If they can't determine that, then they may not be so inclined to do so, which means their need to even have a site dev team may also decline. To be more candid: it is something that helps justify their job.

Enhanced e-commerce using GTM but no in-page dataLayer

I am working on a project where I do not have access to page source nor can I ask client's IT team to create in-page/onload dataLayer e.g. having dataLayer before the tag. Is the idea of implementing enhanced e-commerce tracking remotely possible via dataLayer.push e.g. build dataLayer as you go?I have a very little knowledge of dataLayer.push (which I am starting to read up). Question is :
Is dataLayer.push the correct way move forward? Have anyone done this
before?
what issue I might face e.g. "add to cart" event, remove cart or
category page any working example? I still don't have a clear view of
the workflow here.
What are the downside of doing it this way beside "style/css" based
trigger might fall off during future site design update.
Thanks.
Your main problem is that you need to get the data from somewhere. Usually without a dataLayer this means DOM scraping and then assembling the scraped data into a dataLayer in a custom javascript function. Drawbacks are the same as with your stle/css based triggers:
Implementation is strongly coupled to the page layout
data might be missing, or require cleaning (if mixed with html or unrelated text)
potentially expensive in clients CPU time
custom javascript introduces new points of failure (i.e. can you test rigorously enough to guarantee that there are no side effects)
If you do workarounds around your client's ITs shortcomings remember that you own them - you will be responsible if the workarounds break, or have side effects, or need to be amended to account for new features. Make sure that you are very well compensated for that risk (and personally with the experience I have now I would not do this at all).
I think it's important to acknowledge here that the Data Layer is just one way of storing this information, and is used solely because it's possible to push data to it from the page.
If you can't write the code into the site itself, don't push information to the data layer. Just keep that information for yourself, in GTM's variables. You'll save yourself a huge headache, and a bit of computation too.
DOM scraping is a perfectly reasonable way to get hold of information, but you will run into some barriers.
You're going to have to write a lot of JavaScript to get the data you need.
Some buttons may turn out to be composed of several elements that you'll have to cover with your triggers etc.
Any changes to the site will potentially ruin your code.
Not everything is available to you, especially verification of data (checking if a purchase went through is probably no longer possible before reporting the transaction).

Multiview vs Wizard Control

I want to take multiple inputs from user in multiple steps.
Which approach is better? Multiview or Wizard control?
What is the basic difference between them. can any body guide me in it.
Thanks
I would go with a Wizard control, as long as the experience is informative and usable. It is a typical process and I would guess most users are familiar with the approach.
Before heading straight into the development it would be ideal to map our the flow and information you want captured in each step. Then decide how persistent the wizard should be - can the user come back to the same place when saving a draft, do all pages need to be completed before saving, how are transactions handled.
For tips on design you can look over some Smashing Magazine articles.

Override activity in workflow?

I have a complicated workflow for sending marketing emails to customers. There's something like twenty activities that decide who gets what kind of email.
95% of my activities are defined in a binary activity library. I assembled my main activity in visual studio.
For certain types of customer I want to have the activity in (say) step 25a behave differently than what I defined when I built it. We could load the activity from xaml hosted in a database.
One option is to clone the entire workflow for those customers, but that is a lot of code duplication.
Is it possible to override whatever the runtime uses to locate and marshal activities so that if my customer is left handed, one activity in the workflow is substituted instead of what I defined in the IDE?
I'm thinking of how you can override the ViewEngine in mvc to dynamically load ipad views or whatever. Is there something similar for loading activities?
You can't replace the activity in the workflow itself if it is compiled into the assembly. There are several options you can use though:
Use a dynamically loaded activity using the ActivityXamlServices.Load() and as XAML is just XML change the XAML before laoding it.
Use a wrapper activity in your workflow that only loads the actual activity at runtime and uses the WorkflowInvoker to execute it.
Separate the intent from the implementation by using an activity and an extension. The activity only grabs all inputs and the extension and calls a function on it. At runtime you can vary the actual implementation of the workflow extension depending on your needs.
Good news... I have built exactly what you need for this in Microsoft.Activities. For details see WF4 How To Invoke a Child Workflow as XAML and just yesterday I added support for tracking child workflows see Tracking Child Workflow with InvokeWorkflow

Front-end first or back-end?

Hi I have to do a small CMS application in MS ASP.NET using WebForms.
I do everything on my own: front-end and back-end and Data Base schema.
Now that I want to develop the site, I wonder if I should start from front-end first, or back-end.
Considering this is a small project, could you guys give me a list of steps I do better following to help to determinate what is the best order for developing my application?
Thanks once again for your time.
You'll develop all tiers as you go most of the time
For some page you may first create database schema and fill it up with some dummy data and than work your way up.
For others you may start with a page itself and then write functionality that's needed to get it working. Especially when this page hasn't been envisioned enough. This is not bad nor good. It's just the way development tends to be.
Some considerations
Follow agile development
Write down some requirements in a form of user stories (and keep track of them), that don't give any info about page, data etc. Just something like As a user I would like to have primary navigation on my page. This kind of a story will permit later changes to code/pages without the story becoming invalid.
Don't haste into something fully functional at first. Don't over-engineer your code. Because you'll end up doing changes later = follow YAGNI. For instance don't fully design your DB at first. Do just as much as you need per story being developed. But do think of future things that you'll have to integrate into existing codebase.
Refactor existing code right away when you see something should be changed.
If you have someone to test your code, let them do it. Don't develop next stories before existing bugs have been fully resolved. You'll be grateful for this later.
If your code is semi-complex I suggest you write unit tests, so future code changes won't break existing functionality.
Most of all: learn as you go and change existing code while doing so. Since you're learning these technologies I suggest you stick to simplicity at first. You'll add more complex things when needed. Some of them won't get done at all. So in the end youl realise YIDNI (yep, I didn't need it).
I usually write out what my requirements are first, if I need to use a database, I create that first, always. After my database I start working on front end that connects and uses my already created database.
I worry about the front-end last, can you can always change that pretty easily
I would say that in many systems, the back-end is there to support what is needed for the front-end to work. If you don't know what the front-end needs, there is little chance of successfully designing the back-end. So I'd start off with putting at least a rough front-end in place first (if even just a paper prototype).
I tend to approach all of my projects with a back-to-front approach for one simple reason - testability. Writing solid tests against a back-end early will will make it easier to work on the other tiers progressively. It also, as "bonus" helps to keep business logic out of places it does not belong.
I find it easier to develop the logic and back-end first, so that I get that right, then apply the interface to it. This way you avoid writing functionality based on what you think you need from the front end.
It is important to get a good scope of what you want to do/tackle, and try to implement that in the back-end first. Then wrap it in a nice interface!

Resources