cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy and Publish custom workflows developed using activiti

mduduzi
Confirmed Champ
Confirmed Champ
Hi,

I have developed a workflow using an activiti plug-in installed in  eclipse. I also have deployed and tested this workflow using Activiti Explorer console accessible when logged in as an administrator user in alfresco explorer. The testing is successful since I can interact with all the forms I created to supply information to tasks.

The deployed workflow is published in Alfresco Explorer and Share (i.e it is available in the list of workflows) but it cannot be started. The reason  being that there is a form with required fields in the start event but that form is not shown when starting the workflow from explorer or share.

How do I manually deploy the custom workflow so that it works well in alfresco explorer?
5 REPLIES 5

jpotts
World-Class Innovator
World-Class Innovator
Have you defined forms for your workflow in web-client-config-custom.xml (Explorer) and share-config-custom.xml (Share)? If so but they are not showing up, I suspect you have not matched the activiti:formKey values to the types in your workflow content model and the form configuration elements. If this doesn't make sense or you want to see an example, refer to this tutorial, which covers Activiti and Share.

Jeff

mduduzi
Confirmed Champ
Confirmed Champ
Hi Jeff,
Thanks for the response. I am actual new in Alfresco and have been using your book as a starting point but I think I am missing something. Below is the process definition xml with the default name and id, process1:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="process1" name="process1">
    <startEvent id="startevent1" name="Start" activiti:formKey="scwf:submitHelloWorldTask"></startEvent>
    <userTask id="alfrescoUsertask1" name="Alfresco User Task" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
        <activiti:taskListener event="complete"
class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>execution.setVariable('wf_reviewOutcome',
task.getVariable('wf_reviewOutcome'));</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="alfrescoUsertask1">
          <extensionElements>
        <activiti:executionListener event="start"
class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
          <activiti:field name="script">
            <activiti:string>logger.log("Hello, " + scwf_helloName +
"!");</activiti:string>
          </activiti:field>
        </activiti:executionListener>
      </extensionElements>
    </sequenceFlow>
    <serviceTask id="alfrescoScripttask1" name="Alfresco Script Task"
activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
      <extensionElements>
        <activiti:field name="script">
          <activiti:string>logger.log("The outcome of the review task is: " +
wf_reviewOutcome);</activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow2" name="" sourceRef="alfrescoUsertask1" targetRef="alfrescoScripttask1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow3" name="" sourceRef="alfrescoScripttask1" targetRef="endevent1"></sequenceFlow>
  </process>

I created the ff workflow model:
<?xml version="1.0" encoding="UTF-8"?>

<model name="scwf:scWorkflowModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
   </imports>

   <namespaces>
      <namespace uri="scwf.workflow.model" prefix="scwf"/>
   </namespaces>

   <types>
     <type name="scwf:submitHelloWorldTask">
       <parent>bpm:startTask</parent>
       <properties>
      <property name="scwf:helloName">
         <type>d:text</type>
         <mandatory>true</mandatory>
         <multiple>false</multiple>
      </property>
       </properties>
     </type>
   </types>

</model>

I have context.xml file that is as follows:
<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>


    <!– Registration of new models –>   
   
      <bean id="someco.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
   
     <property name="workflowDefinitions">
        <list>   
           <props>
                    <prop key="engineId">activiti</prop>
                    <prop key="location">alfresco/extension/workflows/HelloWorldUI.bpmn20.xml</prop>
                    <prop key="mimetype">text/xml</prop>
                    <prop key="redeploy">false</prop>           
                </props>
            </list>
          </property>
   
     <property name="models">        
          <list>        
          <value>alfresco/extension/model/scWorkflowModel.xml</value>
           </list>     
         </property>

     <property name="labels">
            <list>
                <value>alfresco.extension.messages.scWorkflow</value>
            </list>
        </property>
 
        </bean>
       

</beans>

The Alfresco Explorer have been configured as follows:
    <config evaluator="node-type" condition="scwf:submitHelloWorldTask"
replace="true">
        <property-sheet>
            <show-property name="scwf:helloName" />
        </property-sheet>
    </config>


It is said in the book that after this step I should be able to start the workflow from Alfresco Explorer client, I haven't touched the Share web client yet. Please help.

Thanks
Mdu

mduduzi
Confirmed Champ
Confirmed Champ
Hi,

I finally could start custom workflows and capture custom field Smiley Happy . I have a task of filtering workflows per role i.e disabling users who belong to a role to start or even see selected workflows. I am not sure if I make sense. What I need is for some user(s) not to be able to start certain workflows if possible those workflows shouldn't even be in their list of workflows.

Thanks
Mdu

jpotts
World-Class Innovator
World-Class Innovator
In the earlier problem, it looks like you are using the wrong bean for your workflow definitions and models. Instead of using the dictionary model bootstrap, use the workflow deployer, like this:
<bean id="someco.workflowBootstrap" parent="workflowDeployer">

Regarding restricting the list of workflows, there is nothing that does that out-of-the-box, but I've seen an add-on in the add-ons directory that claims to be able to do this. It is called workflow grants extension.

I haven't tried it yet, but it sounds promising.

Jeff

varshini
Champ in-the-making
Champ in-the-making
I am facing problem with custom workflow developed using activiti-explorer in alfresco 5.0

I deployed activiti-explorer war in alfresco webapps folder. I developed a custom workflow using activiti-explorer graphical design. I didn't write any xml code. I am unable to see my custom workflow deployed in alfresco. What configuration should I do inorder to see my custom workflow in the available workflows dropdown in alfresco. Do I have to write xml code inorder to develop custom workflows to see them in alfresco. Graphical design workflows doesn't work? Please help me.