03-12-2009 12:06 PM
You have been assigned to a task named Third Party Review. Take the appropriate action by clicking one of the links below:Good
third_reject
http://localhost:8080/alfresco/service/someco/bpm/review?id=jbpm$43-@&action=third_reject&guest=true
third_approve
http://localhost:8080/alfresco/service/someco/bpm/review?id=jbpm$43-@&action=third_approve&guest=tru...
The Web Script /alfresco/service/someco/bpm/review has responded with a status of 500 - Erreur Interne de Servlet.
500 Description: Le serveur a recontrer une erreur interne qui l''a empêché de satisfaire la requête.
Message: Wrapped Exception (with status template): null
Exception: org.alfresco.web.scripts.WebScriptException - Wrapped Exception (with status template): null
org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:595)
Server: Alfresco Labs v3.0.0 (Stable 1526) schema 1 002
Time: 12 mars 2009 16:46:58
Diagnostics: Inspect Web Script (com/someco/bpm/review.get)
<webscript>
<shortname>BPM Review</shortname>
<description>Review and approve a BPM task</description>
<url>/someco/bpm/review?id={idArgument}&action={transArgument}</url>
<format default="html">extension</format>
<authentification>guest</authentification>
<transaction>none</transaction>
</webscript>
<html>
<body>
<p>Signaled ${args.id} for transition ${args.action}</p>
</body>
</html>
package com.someco.scripts;
import java.util.HashMap;
import java.util.Map;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.cmr.workflow.WorkflowService;
import org.alfresco.web.scripts.Status;
import org.alfresco.web.scripts.WebScriptRequest;
import org.apache.log4j.Logger;
public class GetReview extends org.alfresco.web.scripts.DeclarativeWebScript {
private WorkflowService workflowService;
private Logger logger;
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status) {
final String id = req.getParameter("id");
final String action = req.getParameter("action");
if (id == null || action == null) {
status.setCode(400);
status.setMessage("Required data has not been provided");
status.setRedirect(true);
}
Map<String, Object> model = new HashMap<String, Object>();
model.put("response", AuthenticationUtil.runAs(new RunAsWork<String>() {
public String doWork() throws Exception {
logger.debug("About to signal id:" + id + " with transition:" + action);
workflowService.signal(id, action);
logger.debug("Signal sent.");
return "Success";
}
},
"admin"));
return model;
}
public WorkflowService getWorkflowService() {
return workflowService;
}
public void setWorkflowService(WorkflowService workflowService) {
this.workflowService = workflowService;
}
}
03-12-2009 12:56 PM
03-12-2009 08:00 PM
03-13-2009 04:54 AM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="webscript.com.someco.bpm.review.get" class="com.someco.scripts.GetReview" parent="webscript">
<property name="workflowService">
<ref bean="WorkflowService" />
</property>
</bean>
</beans>
Actually I done what was written on the book :s (I didn't create extra files or modify something that weren't supposed to be ^^')
logger.debug("id: " + id + "\r\n" + "action: " + action);
Just after declaring the strings id and action in the class GetReview.java. Guess what ? the line didn't show up in the log:
09:36:41,921 DEBUG [com.someco.bpm.ExternalReviewNotification] Mail action executed
09:37:41,750 INFO [org.alfresco.web.scripts.AbstractRuntime] Caught exception & redirecting to status template: Wrapped Exception (with status template): null
(I declared my logger in the log4j.properties files, if you're asking):
# Mail Getter reviewer
log4j.logger.com.someco.scripts.GetReview=debug
The first line indicates that the mail is sent (which is normal because I received it lol).03-13-2009 05:26 AM
logger = Logger.getLogger(GetReview.class);
09-23-2009 07:10 AM
11-18-2009 12:44 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.