Is actually not so hard;
var mail = actions.create(“mail”);
mail.parameters.to = “email@example.com”
mail.parameters.from = person.properties.email;
mail.parameters.template = companyhome.childByNamePath(“Data Dictionary/Email Templates/sample.ftl”);
mail.parameters.text = “Welcome”;
– In Java we do it like this ;
// send email message
Action emailAction = actionService.createAction(“mail”);
Serializable creatorEmail = (String) nodeService.getProperty(user, ContentModel.PROP_EMAIL);
Serializable fromEmail = “firstname.lastname@example.org”;
Serializable subject = “Message from ” + fromEmail + “”;
Serializable emailMsg = “testMessageText”;
Reference : http://wiki.alfresco.com/wiki/Antivirus
I cant’ make it more clear than this person is doing – so here’s the link to his blog ;
Also – this can explain quite a lot.
But I still can manage to assign a task to a certain user….
This seems usefull information.
11.3.3. THE PERSONAL TASK LIST
The personal task list denotes all the task instances that are assigned to a specific individual. This is indicated with the property actorId on a TaskInstance. So to put a TaskInstance in someone’s personal task list, you just use one of the following ways:
- Specify an expression in the attribute actor-id of the task element in the process
- Use TaskInstance.setActorId(String) from anywhere in your code
- Use assignable.setActorId(String) in an AssignmentHandle
…. <time passes>
…. < more time passes>
And I`m back to messing around with the swimlanes. It seems they have priority over setting parameter in bmp-assignee and other values. So I solved it like this;
Lesson learned – This week I`ll close with a succesfull working workflow and next week i`ll start adding behaviour.
Still working on workflows;
This is good example to make a workflow with a lifecycle.
I only run into some issues with user authentication. If I start a workflow (as admin) on a txt document and refer it to a user (myself) there are some authentication errors. It might have something to do with this code;
I have no solution yet.. So back to research..
Login to alfresco. Goto Administration console / Nodebrowser.
Select Lucene in the dropdown box @ search
Enter this query :
Results in all directories in the user_homes. As far as I know this should be equal to the users in the system. Note that this does not include the alfresco admin user. This has Company Home as ‘user-home’
The above code skipped users guest and admin. I decided to use this query:
This also gives admin and guest accounts and seems more natural to use.