cancel
Showing results for 
Search instead for 
Did you mean: 

more actor

mabu_alf
Champ in-the-making
Champ in-the-making
Hi, I try to define a workflow and i need to use more than two actor in the workflow process.
I'd like to use "initiator", "assignee" and "assignee2" (for example). The "initiator" start workflow and select the "assignee"; the "assignee" perform a task and select the "assignee2" and the last one perform another action and terminate the workflow. I try to define:

<type name="wf:send2">
   <parent>bpm:workflowTask</parent>
   <mandatory-aspects>
      <aspect>bpm:assignee2</aspect>
   </mandatory-aspects>
</type>

in the myWorkflowModel.xml and


<swimlane name="assignee2">
       <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{bpm_assignee2}</actor>
       </assignment>
</swimlane>

<task-node name="revisione-tecnica">
   <task name="wf:send2" swimlane="assignee2" />
   <transition name="" to="end"/>
</task-node>

in the myWorkflow_processdefinition.xml but it failed. This is the error:


15:33:08,474 ERROR [[Catalina].[localhost].[/alfresco]] Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextListener
org.alfresco.error.AlfrescoRuntimeException: Workflow deployment failed
   at org.alfresco.repo.workflow.WorkflowDeployer.deploy(WorkflowDeployer.java:224)
   at org.alfresco.repo.workflow.WorkflowDeployer.onBootstrap(WorkflowDeployer.java:235)
   at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:45)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:225)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:323)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
   at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
   at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
   at org.apache.catalina.core.StandardService.start(StandardService.java:450)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Caused by:o rg.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/myWorkflowModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:111)
   at org.alfresco.repo.workflow.WorkflowDeployer.deploy(WorkflowDeployer.java:177)
   … 33 more
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to compile model wf:workflowmodel
   at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:112)
   at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:134)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModel(DictionaryDAOImpl.java:93)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:107)
   … 34 more
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Mandatory aspect bpm:assignee2 of class wf:send2 is not found
   at org.alfresco.repo.dictionary.M2ClassDefinition.resolveDependencies(M2ClassDefinition.java:217)
   at org.alfresco.repo.dictionary.CompiledModel.resolveDependencies(CompiledModel.java:236)
   at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:98)
   … 37 more

Does someone can help me?
4 REPLIES 4

grimme
Champ in-the-making
Champ in-the-making
hi mabu,

the line
<aspect>bpm:assignee2</aspect>

refers to an aspect definition.
Alfresco tells you that it can't find the aspect bpm:assignee2 because you didn't define any aspect with name bpm:assignee2.

I'd suggest to create a property on your task that represents the 2nd person of the workflow and use thisone in your process definition.

For example create a property assignee2 of type d:text on your workflowtask.

Grimme

davidc
Star Contributor
Star Contributor
The aspect bpm:assignee encapsulates an association to a person.

You can replicate this aspect if you wish to support multiple assignees.

e.g.

<aspect name="bpm:assignee2">
            <associations>

                <association name="bpm:assignee2">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cmSmiley Tongueerson</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </target>
                </association>

            </associations>
</aspect>

mabu_alf
Champ in-the-making
Champ in-the-making
Thak you very much, Grimme and davidc!

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

Thank you for this. Very helpful.
I would like to add a field sendMail in the property of the assigneeX. I have done this :

model.xml


                <type name="sgfwf:submitStartReviewByBoss3">
                        <parent>sgfwf:common</parent>
                        <!– To select a user –>
                        <mandatory-aspects>
                                <aspect>sgfwf:assignee1</aspect>
                                <aspect>sgfwf:assignee2</aspect>
                                <aspect>sgfwf:assignee3</aspect>
                        </mandatory-aspects>
                </type>

<aspects>
                <aspect name="sgfwf:assignee1">
                        <properties>
                                <property name="sgfwf:sendMail">
                                        <type>d:boolean</type>
                                        <default>true</default>
                                </property>
                        </properties>
                        <associations>
                                <association name="sgfwf:assignee1">
                                        <source>
                                                <mandatory>false</mandatory>
                                                <many>false</many>
                                        </source>
                                        <target>
                                                <class>cm:person</class>
                                                <mandatory>true</mandatory>
                                                <many>false</many>
                                        </target>
                                </association>
                        </associations>
                </aspect>


Actually, in share the workflow shows the user selector. All is working. However I don't know how to show the email field sendMail (in share-config-custom.xml) and how to get this property in my workflow (I get null) :

Activiti workflow

<userTask id="modifyReview1" name="Validation 1"
                        activiti:assignee="${sgfwf_assignee1.properties.userName}"
                        activiti:formKey="sgfwf:modifyReviewTaskReviewByBoss3">
                        <extensionElements>
                                <activiti:taskListener event="create"
                                        class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
                                        <activiti:field name="script">
                                                <activiti:string>
                                                        if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate;
                                                        if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
                                                        logger.debug(" mails create : "+task.getVariable('sgfwf_assignee1.properties.sendMail'));
                                                        </activiti:string>
                                        </activiti:field>
                                </activiti:taskListener>

Any ideas ?

(Alfresco 4.0b/Activiti).