i have created a dossier document in Spagobi Tool. My presentation template contains 2 slides and i have created 2 task nodes accordingly in the workflow process.
When i execute my dossier document on the server it is throwing an error stating "Some problems have occurs while starting collaboration process".
Following is the workflow process definition i have submitted in the template build on the server.
<?xml version="1.0" encoding="UTF-8"?>
<process-definition
xmlns="http://jbpm.org/3/jpdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jbpm.org/3/jpdl http://jbpm.org/xsd/jpdl-3.0.xsd"
name="BookletWorkflowProcess">
<swimlane name="/spagobi/admin">
<assignment class="it.eng.spagobi.booklets.assignmenthandlers.SpagoBISwimlaneAssignment"></assignment>
</swimlane>
<swimlane name="/spagobi/dev">
<assignment class="it.eng.spagobi.booklets.assignmenthandlers.SpagoBISwimlaneAssignment"></assignment>
</swimlane>
<swimlane name="/spagobi/test">
<assignment class="it.eng.spagobi.booklets.assignmenthandlers.SpagoBISwimlaneAssignment"></assignment>
</swimlane>
<start-state name="start">
<transition name="" to="ProcessOOTemplate"></transition>
</start-state>
<node name="ProcessOOTemplate">
<transition name="" to="fork1"></transition>
<event type="node-enter">
<action name="process_ootemplate_action" class="it.eng.spagobi.booklets.automatictasks.ProcessOOTemplateAction"></action>
</event>
</node>
<fork name="fork1">
<transition name="toaddnote1" to="AddNote1"></transition>
<transition name="toaddnote2" to="AddNote2"></transition>
</fork>
<task-node name="AddNote1">
<task name="add_note_task1" swimlane="/spagobi/dev">
<event type="task-create">
<script>
<expression>
taskInstance.setVariableLocally("spago_handler", "AddNoteHandler");
taskInstance.setVariableLocally("spagobi_booklet_pageindex", "1");
</expression>
</script>
</event>
</task>
<transition name="" to="join1"></transition>
</task-node>
<task-node name="AddNote2">
<task name="add_note_task2" swimlane="/spagobi/test">
<event type="task-create">
<script>
<expression>
taskInstance.setVariableLocally("spago_handler", "AddNoteHandler");
taskInstance.setVariableLocally("spagobi_booklet_pageindex", "2");
</expression>
</script>
</event>
</task>
<transition name="" to="join1"></transition>
</task-node>
<join name="join1">
<transition name="" to="GenerateFinalDocument"></transition>
</join>
<node name="GenerateFinalDocument">
<transition name="" to="ValidateFinalDocument"></transition>
<event type="node-enter">
<action name="generate_final_document_action" class="it.eng.spagobi.booklets.automatictasks.GenerateFinalDocumentAction"></action>
</event>
</node>
<end-state name="end1"></end-state>
<task-node name="ValidateFinalDocument">
<task name="validate_document_task" swimlane="/spagobi/admin">
<event type="task-create">
<script>
<expression>
taskInstance.setVariableLocally("spago_handler", "ValidateFinalDocumentHandler");
</expression>
</script>
</event>
</task>
<transition name="" to="end1"></transition>
</task-node>
</process-definition>
Can someone help me find the roots to this issue and possible solutions if any?
Related
Is it possible in Spring WebFlow to pass the value of a button to the flow...?
Something like this:
<button name="_eventId_next" type="submit" id="BTN_START" value="1" />
and then try to get it into the flow like this:
<view-state id="information" view="information">
<transition on="back" to="init" validate="false"/>
<transition on="next" to="followPage">
<set name="buttonValue" value="[button.value]" />
</transition>
</view-state>
and use it in anothor JSP page?
Thanks to everyone could help me.
// Daniele.
Hi, I am using spring webflow2.4.4 with spring4.1.3.
I am trying to pass values between two flows as below.
sending value from flow first xml
<action-state id="submit">
<evaluate expression="someMethod(form)" result="flowScope.saveStatus" />
<set name="flowScope.value1" value="form.value1" />
<set name="flowScope.value2" value="form.value2" />
<transition on="success" to="view" />
</action-state>
<subflow-state id="view" subflow="flow/path/view">
<input name="value1" value="value1" />
<input name="value2" value="value2" />
...
</subflow-state>
reeving data in flow second view xml
<input name="value1" type="string" />
<input name="value2" type="string" />
now in view xml I am able to receive value for "value1" what I passed from first flow but getting value for 'value2' is null.
I tried switching the position in first flow as below
<action-state id="submit">
<evaluate expression="someMethod(form)" result="flowScope.saveStatus" />
<set name="flowScope.value2" value="form.value2" />
<set name="flowScope.value1" value="form.value1" />
<transition on="success" to="view" />
</action-state>
<subflow-state id="view" subflow="flow/path/view">
<input name="value2" value="value2" />
<input name="value1" value="value1" />
...
</subflow-state>
Now I am able to see value of 'value2' but value for 'value1' receiving is null.
What is wrong here? see below debug logs for both example
1st trial
DEBUG SubflowState - Calling subflow 'flow/path/view' with input map['value1' -> 'ABCDF', 'value2' -> [null]]
2nd trial
DEBUG SubflowState - Calling subflow 'flow/path/view' with input map['value2' -> 'ABCDF', 'value1' -> [null]]
I want to pass both thew values to second flow but it second parameter is getting skipped somehow.
this is a very common mistake. the action state is transitioning when it gets a success and stops evaluating the rest of the commands.
you need to use <on-entry> to separate the two:
the commands you want to set or evaluate (value1 & value2)
the command that will be evaluated for the transition, here someMethod(form))
use this instead:
<action-state id="submit">
<on-entry>
<set name="flowScope.value2" value="form.value2" />
<set name="flowScope.value1" value="form.value1" />
</on-entry>
<evaluate expression="someMethod(form)" result="flowScope.saveStatus" />
<transition on="success" to="view" />
</action-state>
Thanks rptmat57, below code worked for me.
<action-state id="submit">
<evaluate expression="someMethod(form)" result="flowScope.saveStatus" />
<transition on="success" to="view" >
<set name="flowScope.value2" value="form.value2" />
<set name="flowScope.value1" value="form.value1" />
</transition>
</action-state>
I am starting with spring web flow, reading and following the documentation. I have created a new flow:
test-flow.xml
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<var name="testName" class="com.project.TestView" />
<view-state id="test">
<on-entry>
<set name="flowScope.name" value="testName.name" />
</on-entry>
<transition on="test" to="saveName"/>
</view-state>
<subflow-state id="subTest" subflow="testSub-flow">
<input name="nameVar" value="name" />
<transition to="error" />
</subflow-state>
<view-state id="error" />
<end-state id="finish" />
</flow>
And I am trying to create a testSub-flow.xml
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<input type="String" name="nameVar" />
<on-start>
<evaluate expression="com.project.TestView.printSomething(nameVar)" result="flowScope.testPrint" />
</on-start>
<view-state id="printTest" >
<transition on="restart" to="endSub" />
</view-state>
<end-state id="endSub" />
</flow>
The method called is:
#Transactional(readOnly = true)
public String printSomething(String text){
System.out.print(text + " this is a test");
return text + " this is a test";
}
I get some exception in the browser when it is loading the main flow, test-flow.xml
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction#6ca837 targetAction = [EvaluateAction#7aed3a expression = com.project.TestView.printSomething(nameVar), resultExpression = flowScope.testPrint], attributes = map[[empty]]] in state 'null' of flow 'test' -- action execution attributes were 'map[[empty]]'
What could be the problem?? Thanks in advance.
At first sight, it seems that it can not find any start-state. Try adding start-state attribute in flow tag:
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
start-state="test">
If that does not fix the problem, it could be that flow builder can not find a state named "saveName". The problem could be in this line:
<transition on="test" to="saveName"/>
If you want to invoke the subflow when "test" event occurs, you write "subTest" instead of "saveName" in order to call the subflow.
So, that line should be:
<transition on="test" to="subTest"/>
Also, note that you are not specifying any view for those view-states.
Hope this helps.
I have an action-state that evaluates an expression and then transitions to various other states depending on the result. One of the result states is a subflow-state that hands control to another flow, example;
<action-state id="doWork">
<evaluate expression="someAction.doWork(someInput)" />
<transition on="WORKSUCCESS" to="workSuccess" />
<transition on="WORKFAIL" to="fixFail" />
</action-state>
<subflow-state id="fixFail" subflow="someOtherPlace/someOtherWorkToFixFail">
<input name="someNumber" value="1" type="java.lang.Integer" />
<transition on="finish" to="workSuccess" />
</subflow-state>
As you can see I can pass an input into the subflow via the input tag but my question is how can I specify and pass additional inputs that I want present if and only if the subflow-state is being called from the transition WORKFAIL? Assume the subflow-state "fixFail" can be called from other action-states.
I've tried things similar to the following with no effect;
<action-state id="doWork">
<evaluate expression="someAction.doWork(someInput)" />
<transition on="WORKSUCCESS" to="workSuccess" />
<transition on="WORKFAIL" to="fixFail">
<attribute name="newInput" value="3000" type="java.lang.Integer" />
</transition>
</action-state>
<subflow-state id="fixFail" subflow="someOtherPlace/someOtherWorkToFixFail">
<input name="someNumber" value="1" type="java.lang.Integer" />
<input name="someNumber2" value="flowScope.newInput" type="java.lang.Integer" />
<transition on="finish" to="workSuccess" />
</subflow-state>
There are three ways you can do this. You can do it through the conversation, session or as attributes passed in.
ConversationScope: If a field is in the conversationScope the field is visible anywhere in that specific flow as well as that flow's subflows (and their transitions)
SessionScope: (Probably not what you
want) Is visible to all flows and
their subflows
Finally you can pass the field as an attribute into the subflow state for example
<subflow-state id="fixFail" subflow="someOtherPlace/someOtherWorkToFixFail">
<input name="someNumber" value="1" type="java.lang.Integer" />
<input name="someNumber2" value="flowScope.newInput" type="java.lang.Integer" />
<transition on="finish" to="workSuccess" />
</subflow-state>
In your subflow's xml
<?xml version="1.0" encoding="UTF-8"?>
<flow>
<input name="someNumber"/>
<input name="someNumber2"/>
...
</flow>
In this example someNumber and someNumber two are passed in as attributes to your subflow. In which you can evaluate them as ${someNumber}
Edit:
This is to address your comment question. If you wanted to set a variable in the conversation scope on a specific transition you can do:
<transition on="WORKFAIL" to="fixFail" >
<set name="conversationScope.someVariable" value="Hello World"/>
</transition>
Then in your jsp
${someVariable} <!-- This will print out 'Hello World' -->
I have a Java web application using spring web flow.
How do I pass values from one flow to another flow?
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<persistence-context />
<var name="editBean" class="jp.co.anicom.domain.User" />
<var name="deleteBean" class="jp.co.anicom.domain.User" />
<var name="authorityBean" class="jp.co.anicom.domain.Authority" />
<on-start>
<set name="flowScope.username" value="requestParameters.username" />
</on-start>
<action-state id="queryAll">
<evaluate expression="employeeAction.GetAuthority(flowScope.username)"
result="authorityBean" />
<transition to="editForm" />
</action-state>
<view-state id="editForm" model="editBean" view="../xhtml/framework/edit">
<transition on="editButton" to="validateAccount" />
<transition on="delete" to="getId" />
<transition on="back" to="editSuccessful" />
</view-state>
<action-state id="validateAccount">
<evaluate expression="employeeAction.GetEmployee(flowScope.username, oldPassword)"
result="editBean" />
<transition to="checkUserAccount" />
</action-state>
<action-state id="getId">
<evaluate expression="employeeAction.GetEmployee(flowScope.username)"
result="deleteBean" />
<transition to="deleteUser" />
</action-state>
<decision-state id="checkUserAccount">
<if test="editBean == null" then="queryAll"
else="confirmPassword" />
</decision-state>
<decision-state id="confirmPassword">
<if test="newPassword.equals(confirmPassword)" then="editUser1"
else="queryAll" />
</decision-state>
<action-state id="editUser1">
<set name="editBean.password" value="newPassword" />
<transition to="editUser2" />
</action-state>
<action-state id="editUser2">
<evaluate
expression="employeeAction.editEmployee(editBean, authorityBean.authority)" />
<transition to="editSuccessful" />
</action-state>
<action-state id="deleteUser">
<evaluate expression="employeeAction.deleteEmployee(deleteBean)" />
<transition to="editSuccessful" />
</action-state>
<end-state id="editSuccessful"
view="externalRedirect:contextRelative:/admin_main.do" commit="true" />
<end-state id="displayError" view="../xhtml/framework/displayError" />
<end-state id="dummy1" view="../xhtml/framework/dummy" />
<global-transitions>
<transition on-exception="java.lang.Exception" to="displayError" />
</global-transitions>
</flow>
I am having a problem with the edit functionality here. In my edit page I have username, oldpassword, newpassword and confirm password fields.
First in validateAccount state I check if the username and oldpassword exists in the database, if it it doesn't exist I forward it to queryall state.
If it exists I check if the new password and confirmpassword values are the same, if they are the same I proceed with the editing.
If not I return again to queryAll.
QueryAll state gets the authority of the user to populate it in the form upon re-displaying the page. When I leave the password fields blank and the first time I click edit button It throws a java.lang.NullPointerException.
Create your two flows as subflows and then the data in each flow should be available in the parent and the other subflows.
Mapping data to the subflow happens
before the subflow session is started.
Mapping data from the subflow back to
the parent flow is done when the
subflow completes and the parent flow
session resumes.