Alfresco Add Workflow Hyperlink to Notification - notifications

When it comes time to "evaluate" the outcome of a workflow. The workflow creator gets a task to do so. They would then need to open the workflow through "workflows I've started" to see the whole thing.
What I would like to do is add a hyperlink to the notification that would take them to either the Task Assigned or to the Workflow itself.
I believe this can be done by adding a couple of lines to the wf-email.html.ftl.
I'm just unsure of the syntax.
"Evaluating" is where it's most needed, but should be fine its included in all notifications.
Thanks!
-Ricardo

Not sure, but can you try this:
<a href="${shareUrl}/page/task-edit?taskId=${args.workflowId}">

Related

SharePoint Workflow Only Works For Me?

Ok, I have a workflow built in SharePoint 2010, built in SharePoint Designer. It is set up to begin whenever a new item is created. The library is also set up to create new items based on email attachments. So the goal is for users to email the attachments to the library and the workflow takes over.
The workflow only works for me. The other people attempting to use it are listed as Full Control in the permissions. They are using the correct email address, and the library is creating the new items based on the attachments. The problem is that the workflow keeps saying error occurred.
The error says something about some columns needing different types of data, but when I email to the library it goes off without a hitch.
I am completely stumped as to what could be different about them sending the email instead of me.
Sorry I got kind of long winded, and thanks in advance for any help.
The system account is not allowed to initiate workflow on its own. There is a powershell that you need to run to enable system account to run workflow. Also try impersonation in workflow.
Here found it.
stsadm.exe –o setproperty –propertyname declarativeworkflowautostartonemailenabled –propertyvalue yes
Not sure what was wrong with it, but I just deleted it then rebuilt it and now it works. Don't think I did anything different so I'm not sure.

google app script gmail testing

I want to make a clean up script for Gmail to my needs. I happy to use a script, which code I found in a blog, but now I need to modify it.
How can I test it without risking my Gmail box? I'm not good or experienced inJS, so I'm pretty sure there will be some mistakes. And I don't want my emails messed up. Is there a sandbox, or some kind of testing environment?
No, there is not. You should create a test account for you to work with.
Also, when working with your account. You could always just log an action instead of doing it. i.e. instead of
thread.moveToTrash()
do a
Logger.log('move thread "'+thread.getFirstMessageSubject()+'" to trash');
Then check menu View > Logs to verify the actions your script would do. You could also create a TEST variable and use it as condition in your code to determine if it should perform an action or just log it (or both).

How do I halt item posting on data validation error in plugin

Let's say I have a plugin Foo in osclass. In that plugin we register a hook for when an item is posted. According to the osclass hooks documentation the only hook that is run when an item is posted is posted_item.
But as far as I can tell from looking at the code this is run after the initial item data has already been validated and stored in the database. What if a validation of some plugin specific code fails and I would like to show the user an error message and present him with the form again to give him/her the chance to alter this information? Much like if you try to submit a new item but don't fill in one of the base information like description for instance.
I can't seem to find a way to do this. Only workaround I find to avoid the item being posted despite containing invalid plugin specific data, without editing the main osclass code, is to delete the posted item again in the posted_item hook callback function of my plugin. This feels extremely cumbersome and also requires every other plugin to check that the item still exists to make sure they don't save data connected to an item that is now deleted.
What I would like, and wonder if I have missed, is a hook that is run when an item is posted but before it's written to the database and have the ability to generate "errors" that would cause the item to not be posted and the user redirected back to the form with the "error" displayed just like for the basic item information.
Anyone have a solution I have missed? This feels like a very important part of plugins and without it posted items could become very fragmented.
A user on the osclass forums (teseo) told me about the undocumented hook pre_item_add that can be used.
<?php
function cust_my_plugin($aItem) {
osc_add_flash_error_message('My plugin has a complaint.');
$pItem = new CWebItem();
$pItem->redirectTo( osc_item_post_url() );
}
osc_add_hook('pre_item_add', 'cust_my_plugin');
?>
He also sais
The only bad news is that you can't merge your plugin validation
process with that of the core script, so if the ad had an error
related to your plugin and other errors, it would be rejected twice,
one by your plugin, the second by the core script. I couldn't see any
workaround for this little issue.

suggestions for Rails back-end workflow for cleaning up attachments to abandoned drafts?

I'm working on a Rails application. Two of my models are notes and attachments. The user can create notes and add attachments to them. This is standard stuff and I already have this working fine.
Currently, the user must create a note before they can add attachments to it. I'm looking to implement a more streamlined workflow for the user, similar to the familiar email workflow where you can add attachments to an unsaved email. However, the key is that I don't want the user to even have to save a draft of the note before the attachment can be added, and I want this unsaved note to be abandoned if the user navigates away (I don't want to have the additional complexity of unsaved/unpublished notes).
I know that when the note hasn't initially been saved yet, I can create the attachments without the link to the note, and then establish the link when the note gets saved. The part I'm drawing a blank on is how do I remove the unused attachments if the user breaks off the note creation process? Is there a hook that I'm missing that allows me to see that the user broke off?
Without such a hook, the first solution that comes to mind is a nightly cleanup script that runs via cron that would find all of the unattached attachments and remove them (perhaps filtering by attachments that have been created more than 24 hours ago). Is this the best solution?
There really isn't any kind of trigger to let you know when to clean those up, since a user can just leave the site without "logging out" or some other action. So that leaves you with a background job not attached to user action. In your case I think a nightly cron is nice and simple and would fit this situation well.

how do you develop "create site" workflow in SP 2010

i want to try doing this directly in SP2010 designer first. I have never worked with workflow before and haven't found anything that really helped me out online.
Flow:
I go into a global team site. I fill out a form (predefined form i created with specific controls) and click submit (form is validated for input).
Workflow kicks starts sending an email to a user who is defined to approve this workflow.
Once approval is obtained, the workflow completes and creates a Team Site from the information in the initial Form I filled out.
I am sure this is simple for anyone who has been developing workflows, but again this is my first and my first time using SP2010.
Any help starting this would greatly be appreciated. I haven't really found any good examples online for something like this.
We just completed a project exactly like this. We made a list with all the fields necessary to create a site. We attached a custom Approval workflow created in SharePoint Designer and a Workflow Event Receiver. When the Approval workflow finished, the WorkflowCompleted event checked that the workflow outcome was Approved, retrieved the List Item associated to the Task, and passed that List Item to our builder class.