Failed to start workflow

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

Failed to start workflow

Hi everyone, 

I am trying to implement simple document approval hierarchy workflow. When I try to start workflow from form it shows this..

Log is showing following error..

org.springframework.extensions.webscripts.WebScriptException: 00100003 Script url /api/workflow/activiti$DocumentApprovalHierarchy/formprocessor does not support the method GET
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:180)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Model file :

<?xml version="1.0" encoding="UTF-8"?>
<model name="cr:contentReviewModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>Content Review Model</description>
<author>Yash</author>
<version>1.0</version>

<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0"
prefix="d" />
<import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<!-- Import Alfresco System Model Definitions -->
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
</imports>

<namespaces>
<namespace uri="http://www.crwf.org/model/workflow/1.0"
prefix="cr" />
</namespaces>

<types>
<type name="cr:documentHierarchy">
<parent>bpm:startTask</parent>
<properties>
<!-- <property name="cr:documentInitialComment"> <title>Workflow Initiator's
Comment</title> <type>d:text</type> </property> -->
</properties>
<overrides>
<property name="bpmSmiley TongueackageItemActionGroup">
<default>read_package_item_actions</default>
</property>
<!-- <property name="bpmSmiley SurprisedutcomePropertyName"> <default>{http://www.crwf.org/model/workflow/1.0}documentInitialComment
</default> </property> -->
</overrides>
</type>

<type name="cr:documentReview">
<parent>cr:submit</parent>
<properties>
<!-- <property name="cr:documentInitialCommentReview"> <title>Workflow
Initiator's Comment</title> <type>d:text</type> </property> -->
<property name="cr:documentReviewerFeedback">
<title>Reviewer's Comment</title>
<type>d:text</type>
</property>
</properties>
<overrides>
<property name="bpmSmiley TongueackageItemActionGroup">
<default>read_package_item_actions</default>
</property>
<property name="bpmSmiley SurprisedutcomePropertyName">
<default>{http://www.crwf.org/model/workflow/1.0}documentReviewerFeedback
</default>
</property>
</overrides>
</type>

<type name="cr:documentApproval">
<parent>cr:submit</parent>
<properties>

<!-- <property name="cr:documentInitialCommentApproval"> <title>Workflow
Initiator's Comment</title> <type>d:text</type> </property> -->
<property name="cr:documentReviewerFeedbackApprpoval">
<title>Reviewer's Comment</title>
<type>d:text</type>
</property>
</properties>
<overrides>
<property name="bpmSmiley SurprisedutcomePropertyName">
<default>{http://www.crwf.org/model/workflow/1.0}taskOutCome
</default>
</property>
</overrides>
</type>

<type name="cr:submit">
<parent>bpm:activitiOutcomeTask</parent>
<properties>
<property name="cr:submitProperty">
<type>d:text</type>
<constraints>
<constraint type="LIST">
<parameter name="allowedValues">
<list>
<value>Submit</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
</properties>
<overrides>
<property name="bpmSmiley TongueackageItemActionGroup">
<default>read_package_item_actions</default>
</property>
<property name="bpmSmiley SurprisedutcomePropertyName">
<default>{http://www.crwf.org/model/workflow/1.0}submitProperty
</default>
</property>
</overrides>
</type>
</types>
</model>

bpmn file :

<?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:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="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="DocumentApprovalHierarchy" name="Document Approval Hierarchy" isExecutable="true">
<startEvent id="startevent1" name="Start" activiti:formKey="crSmiley Very HappyocumentApprovalHierarchy"></startEvent>
<userTask id="documentReviewTask" name="Review Task" activiti:candidateGroups="GROUP_Reviewer" activiti:formKey="cr:documentReview">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
execution.setVariable('reviewerComment',"Reviewed");
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="documentApprovalTask" name="Approval Task" activiti:candidateGroups="GROUP_Approver" activiti:formKey="cr:documentApproval" >
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
execution.setVariable('cr_documentReviewCommentApproval',reviewerComment);
</activiti:string>
</activiti:field>
</activiti:taskListener>

</extensionElements>
</userTask>
<endEvent id="endevent1" name="End"></endEvent>


<sequenceFlow id="flow1" name="flow1" sourceRef="startevent1" targetRef="documentReviewTask"/>
<sequenceFlow id="flow2" name="flow2" sourceRef="documentReviewTask" targetRef="documentApprovalTask"/>
<sequenceFlow id="flow3" name="flow3" sourceRef="documentApprovalTask" targetRef="endevent1"/>

</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
<bpmndi:BPMNPlane bpmnElement="DocumentApprovalHierarchy" id="BPMNPlane_myProcess">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="60.0" y="90.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="documentReviewTask" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="140.0" y="80.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="documentApprovalTask" id="BPMNShape_usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="290.0" y="80.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="470.0" y="100.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

share-config-custom.xml

<alfresco-config>

<config evaluator="string-compare" condition="activiti$DocumentApprovalHierarchy">
<forms>
<form>
<field-visibility>
<show id="packageItems" />

</field-visibility>
<appearance>
<set id="items" appearance="title" label-id="workflow.set.items" />
<field id="packageItems" set="items" />
</appearance>
</form>
</forms>
</config>

<config evaluator="task-type" condition="cr:documentReview">
<forms>
<form>
<field-visibility>
<show id="cr:reviewerFeedback" />
<show id="packageItems" />
<show id="cr:submitProperty" />
</field-visibility>
<appearance>
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="response" appearance="title" label-id="Submit" />
<field id="cr:submitProperty" set="response">
<control
template="/org/alfresco/components/form/controls/workflow/activiti-transitions.ftl" />
</field>
<field id="packageItems" set="items" />
</appearance>
</form>
</forms>
</config>

<config evaluator="task-type" condition="cr:documentApproval">
<forms>
<form>
<field-visibility>
<show id="cr:documentReviewerFeedbackApprpoval" />
<show id="packageItems" />
<show id="cr:submitProperty" />
</field-visibility>
<appearance>
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="response" appearance="title" label-id="Submit" />
<field id="cr:submitProperty" set="response">
<control
template="/org/alfresco/components/form/controls/workflow/activiti-transitions.ftl" />
</field>
<field id="packageItems" set="items" />
</appearance>
</form>
</forms>
</config>

</alfresco-config>

Kindly help me to find solution.

3 Replies
Highlighted
Senior Member II

Re: Failed to start workflow

Hi,

I have checked your code and it is working fine.I am not getting any error.

Workflow is started with Workflow Start Task and  it is directly send to Review Task.

Thanks,

Sanjay

Thanks & Regards,
Sanjay
Highlighted
Active Member

Re: Failed to start workflow

I am using SDK 3.0.1 and All-In-One project. Does it make any issue?

Highlighted
Senior Member II

Re: Failed to start workflow

I dont think it make any issue either you use sdk2/sdk3 all-in-one or separate repo and share.

Main thing here is proper way creation of bpmn file and register it,workflow model file and register it and make share configuration.

Thanks & Regards,
Sanjay