Easy Workflows - Activiti Kickstart

With its lastest release of the Activiti Designer, Activiti has moved more than a step forward in workflow definition and development. This tool was first announced a while ago (in the Alfresco DevCon 2013 celebrated in Berlin) and has been a very demanded one from developers and business people.

This tool allows the easy creation of Activiti workflows including deployment to an existing Alfresco repository. Apart from the process definitions, this tool can create the corresponding workflow model and form definitions and deploy them.

Installation

This is an Eclipse IDE based plugin. You will need to install the Activiti designer plugin using the following URL: http://activiti.org/designer/update/ making sure all items are ticked for installation.

Activiti Kickstart installation

Once installed, you'll need to restart Eclipse to enable the plugin.

Process creation

Developers can still use the original BPMN Designer that have been using. But a new designer that integrates content model and form creation is included in this new release. The great thing about this new editor is that there's no XML or programming language knowledge required to create the whole bunch of files that compound the entire workflow development.

Kickstart workflow process definition

As you might have noticed there are 2 new artifact that can be created (note that these can be created in any type of project, does not need to be a Kickstart project).

  • Kickstart form
  • Kickstart process

The order in which are created is not relevant as forms can be assigned to workflows of tasks as desired. Bear in mind that forms will be needed in the following ocassions:

  1. When starting a workflow
  2. In each manual task

Activiti Kickstart workflow form definition

As the video shows when defining a workflow or a manual task, you can choose between creating a new form, or selecting an exiting one. The cool thing about this tool is that the user can see how the form will look like and even define the behaviour of it, making fields read-only, allowing the field to be used as parameter further down the workflow steps, etc.

 Exporting

There are different options to export workflow processes and forms using the Kickstart tool.

Activiti Kickstart export options

Note: when exporting make sure you choose Kickstart project.

  1. Exporting to projects target directory
    This export creates all the files under the target directory in the current project. It will create 2 directories: repo with the XML files for the Alfresco Explorer webapp, and share with the XML configuration files for the forms in Alfresco Share
    Alfresco Activiti Kickstart export files
  2. Custom location
    The user selects where to place the output files for each of the Alfresco projects (Explorer and Share)
  3. CMIS
    By using this option, you can export and deploy the changes straight to an Alfresco repository defining where the workflow process, models and Share configuration files will be uploaded to. Note that this will upload the files straight to the repository instead of to the filesystem (bit of Alfresco's administration knowledge is required for this).

 

Comments

Hello,
I couldn't setup the plugin to use cmis on alfresco 4.2f

Then do you know how i can set up the worklows i created? do i have to use maven ?

Many thanks

Hi momo,

Once you create the forms and the workflows are you using the export option to publish it to Alfresco? Another option would be doing it manually by either uploading via the user interface or putting the corresponding files in shared/classes/alfresco/extension and shared/classes/alfresco/web-extension.

The concept for Alfresco Community and Enterprise is the same, so this should help you: http://docs.alfresco.com/4.2/topics/wf-howto.html

Adei

Many thanks for your reply. I finally managed to make it work. I made a mistake when following instructions.

Glad it worked :)

Really Very helpful.. Great work...Solved So Many issues.....

Hello and thanks for your help, finally i was able to create my own workflow.

Very helpful, i love it. One little question. Let's say for example that at the end of the process i want to move the file into a specific folder when things are approved, what should i use? A script step to move the files?

Hi momo,

Yes a script task is the easiest option, since moving a file is not very complicated.

You'll need to use Alfresco's Workflow Javascript API and Javascript API for that.

Hi! great tutorial!
it helped me a lot, but im facing a problem with the deployment im not sure where the repo and share files supose to be deployed in alfresco and CMIS is not an option in my case because it only works in EN instances.
Can you help me?
Thanks!

Hi Diego,

Glad the tutorial was helpful for you.

First we'll need to know which Alfresco version you are using. Alfresco. I will have to check but I'm pretty sure the latest community editions use CMIS. I actually think I used community when I was preparing this article.

Anyway, if you want to put them manually in the Alfresco repository the following link shows where in Alfresco the files have to go: http://www.bataon.com/sites/default/files/u2/kickstart%20export.png

You can also put them in the filesystem. This page explains where to put them and how to configure Alfresco to pick the configurations up: http://wiki.alfresco.com/wiki/Workflow_with_Activiti

For Share you can follow this link: https://wiki.alfresco.com/wiki/Custom_Share_Workflow_UI

NOTE: the links might be outdated and belong to an older version of Alfresco

Hi! great tutorial!
it helped me a lot, but im facing a problem with the deployment im not sure where the repo and share files supose to be deployed in alfresco and CMIS is not an option in my case because it only works in EN instances.
Can you help me?
Thanks!

Afternoon all,
I think this is a great product, but I'm having trouble deploying the bpmn20.xml file. I'm able to generate it from Eclipse & it makes all the files. I'm also able to select the bpmn20.xml file into Activiti & upload new deployment. It then displays in the list of deployments & I can view the process diagram etc all OK..... However when I go to my dashboard & select "start workflow", once the "please select a workflow" there are NO workflows displayed. When I delete the new bpmn20.xml file from the list of workflows, then all the default workflows are listed again.....

I was able to track down a random bpmn20.xml file on the internet & deploy that one & it works perfectly !! So whatever is causing the problem it appears to be the file itself.

Are you able to assist ?

Hi Marcel,

The list of workflows displayed in the Start Workflow page is defined in the *-config-custom.xml file that is created when you export it. Could you share that file so I can help you with that?

Thank-you so much, that would be fantastic. Can you advise on the best method to share the file ?

You're free to e-mail marcel@evolutionmarketing.com.au if that works better for you.

regards,

Marcel....

Hi There,

Thanks for the video tutorial, extremely helpful. I'm just having some trouble deploying my new process. I was able to create & export the bpmn20.xml file to the project target folder without any problems & I was able to upload the new deployment into the Activiti workflow console. I can see it displayed in the list of workflows & can view the diagram, see the process definitions & resources attached to it. However....... when I go to Alfresco to start a new workflow, there are no workflows listed - not even the default ones. When I delete my new bpmn20.xml file, then everything returns to normal.

Any ideas on what be causing that ? Any help would be most appreciated.

regards

Hi,
Thanks for your tutorial. I have one little question. I exported hire process into target directory but my hire-model.xml is incomplete. For example it doesn't contain values from Position Type from start form. I have there Sales, Marketing etc. but my model.xml doesn't contains such data :( I found this bug because when I earlier exported my project to the CMIS forms in Alfresco looked bit different than in Eclipse. I used Eclipse Indigo.

Regards,
Magda

And i noticed now that when I add values they are visible. I saved form of course. When I close form or go to another tab such values dissaper.

Regards,
Magda

And when I exported my project to the Alfresco my forms are different. For example I should have in start form : Due Date, Priority etc.
In Alfresco I Have:
Select people
hire:email:
Locale:
etc
1. Each field is under the previous...in Eclipse I set three fields next to each other
2. What is Locale for example? It isn't field defined by me in Alfresco.

I don't know why I have such bugs :(

Regards,
Magda

Hi Magda,

Could you send us the exported files you get with the plugin? We would need to know how the XML files look and were they are being placed.

Regards,

Adei

Hi!
Thanks for your reply.
Today I solved this problem. The problem was a connection with solr. I solved it :)
But now I have other problem ...
1. I started workflow in Alfresco
2. I want approve task by the user so I clicked "Approve"
3. I get such exception:

"ERROR [action.executer.MailActionExecuter] [http-apr-8080-exec-8] Failed to send email to XXX@gmail.com
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Unknown SMTP host: smtp.example.com
I clicked "Approve" i have such exception:"

Regards,
Magda

Hi Magda,

It looks like your workflow sends email notifications. In order to send emails you'll need to configure Alfresco to connect to a SMTP server (this can be google or any your company uses). You have some examples in the following URL: https://wiki.alfresco.com/wiki/Outbound_E-mail_Configuration

Regards,

Adei

Hi Magda,
i'm having the same problem as you
could you help me please?
thanks in advance
M JELTI

Hi Jelti,

You can check the online Alfresco documentation. You can find all available properties, and as well, an example for GMail. Here is the doc for 4.2.x:

http://docs.alfresco.com/4.2/concepts/email-outboundsmtp-props.html

Ben

Hello,
i'have spend several days trying to deploy my first workflow on my alfresco 4.2.0
the problem is that i can see the workflow on my alfresco but the form is not the same as what i defined on alfresco (according to the forum the system don't find my share-custom file and uses a standard form)
could you please tell me where exactly sould i upload the file
i have :
-DemandeDeRecrutement-config-custom.xml
-demandeDeRecrutement-share-context.xml

i've put that files on
Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension

thank you in advance for your help

M JELTI

Hello,
i'have spend several days trying to deploy my first workflow on my alfresco 4.2.0
the problem is that i can see the workflow on my alfresco but the form is not the same as what i defined on alfresco (according to the forum the system don't find my share-custom file and uses a standard form)
could you please tell me where exactly sould i upload the file
i have :
-DemandeDeRecrutement-config-custom.xml
-demandeDeRecrutement-share-context.xml

i've put that files on
Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\web-extension

thank you in advance for your help

M JELTI

Hi Jelti,

Usually, you need to name your file "share-config-custom.xml", and it's better to move it to the shared folder, instead of withing the share webapp. You can find more details here:

http://docs.alfresco.com/4.2/tasks/forms-config.html

Ben

Hi,

Great tutorials and it works just fine.

just for the info, what is the exact location of the files that has to be placed under.
alfresco version 5.0.1 enterprise edition

Thanks in advance

Hi brooke,

It should be the same location as shown in the Export section of the blog post. I haven't tried it yet with Alfresco 5, but I don't think that has changed.

Regards.

hi,
Thank you for the reply.
I am using Alfersco 5, so was little concerned about the CMIS Export.

Best Regards

Hi.

I dint know that creating workflow in alfresco could be this easy.

I deployed the workflow which i created following the above tutorials, the form appeared and i filled in the values, but when i clicked "start workflow" , i get this message
06280046 Failed to start workflow activiti$leaveManagement:1:4808.
I think this might be related to java script.
Please help as what went wrong.

Amanda

Hi Amanda,

We would need to get more information to know the cause of the issue... Could you post your log trace?

Regards,

Adei

Hi Adei,

I'm trying to debug my somehow faulty workflow definition. It deploys fine but for some reason cannot be started.
following is some part of the file alfrescotomcat-stdout

2015-07-29 17:49:53,596 DEBUG [repo.jscript.ScriptLogger] [http-apr-8088-exec-6] kind = workflow
2015-07-29 17:49:53,596 DEBUG [repo.jscript.ScriptLogger] [http-apr-8088-exec-6] id = activiti$leaveManagement
2015-07-29 17:49:54,034 DEBUG [repo.jscript.RhinoScriptProcessor] [http-apr-8088-exec-6] Imports resolved, adding resource '_root
2015-07-29 17:49:54,038 DEBUG [jscript.RhinoScriptProcessor.calls] [http-apr-8088-exec-6] string script Start
2015-07-29 17:49:54,042 DEBUG [jscript.RhinoScriptProcessor.calls] [http-apr-8088-exec-6] string script End 4 ms
2015-07-29 17:49:54,050 DEBUG [repo.jscript.ScriptLogger] [http-apr-8088-exec-6] org.alfresco.service.cmr.workflow.WorkflowException: 06290023 Failed to start workflow activiti$leaveManagement:8:5708.
2015-07-29 17:49:54,050 DEBUG [repo.jscript.ScriptLogger] [http-apr-8088-exec-6] Returning 500 status code
2015-07-29 17:49:54,050 DEBUG [jscript.RhinoScriptProcessor.calls] [http-apr-8088-exec-6] form.post.json.js End 455 ms

so nothing more than I can see in the logs file and in result I don't get any worthy info.

Alfresco version 5.0

Thanks

Hi Amanda,

There's not much information there to troubleshoot it I'm afraid. I believe the issue is with your worfklow definition and/or the model, but without knowing what you coded it won't be easy to help you.

You can send them to a.mandaluniz@bataon.com?

Hi,

Just to inform that the issue is resolved. i made a small error, nothing wrong with the tutorial. :)

Thanks

Hi,

I have a slight change in my requirement.

I want to assign a group rather than the multiple users to approve in the screening part.
how do i achieve that ??
I did try by using the human step and assigning the candidate group with the group i wanted take the authority, but still i dont see the task under the users in the assigned group.

Any help would be appreciated.

Best Regards

Hi Sherry,

You'll need to use the potentialOwner tag for a userTask:

<potentialOwner>
 <resourceAssignmentExpression>
   <formalExpression>${bpm_groupAssignee.properties.authorityName}</formalExpression>
 </resourceAssignmentExpression>
</potentialOwner>

You can hardcode the group name instead of using the ${....}

Hope this helps.

Hi,
I created a custom workflow by following the example in the video and using the latest version of Alfresco (5.0.d), not being able to deploy through CMIS I just moved the files created in the target folder in extension and web-extension. In particular I put the bpmn20, context and model files in the extension folder and modified the shared-config-custom.xml file already present in web-extension by adding to its end the content of the config-custom file created by eclipse.

Everything seems to work just fine: the custom workflow appears in the list on Alfresco and it can be started normally. However, when there is a review step in the process, as soon as the last necessary approve or reject is selected an error appears (org.alfresco.scripts.ScriptException:10160011 Failed to execute supplied script: unterminated string literal (AlfrescoJS#6)) and doesn't allow the reviewing user to make the workflow go to the next step.

Any help is much appreciated,
Thanks in advance

Hi Alessandro,

That looks like a Javascript error. It might be that your Script listener is not properly coded. Have a look into this question with the same error. Also does it happen in other browsers as well?

http://stackoverflow.com/questions/5296402/unterminated-string-literal

Regards,

Adei

Hi Adei,
thanks for the tip, it was a javascript error. In particular there were some misreadings in the contents of an email step that I was using, now that problem is solved.
Do you have some tips regarding the configuration of inbound and outbound email in Alfresco 5.0.d? In particular I'd like to obtain the same result as the video when I set the different parameters of an email step (right now since nothing is configured the emails don't arrive).

Thanks again,
Alessandro

I've tried to create workflow same as the video above, but when I exported it, I got the error message : "org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: null". Could someone help me solve this?

Hi,

When exporting CMIS, I got error "CmisRuntimeException: null"

Any idea why?

Thanks

Add new comment