Dear people,
i have error when i assign user using <select> option list. i want to get the value from option, then use the value to send email as an actor.
i attached the snapshot and .par file below.
thanks
forms.xml
i have error when i assign user using <select> option list. i want to get the value from option, then use the value to send email as an actor.
i attached the snapshot and .par file below.
thanks
forms.xml
Code: Select all
ActorSuperAssignHandler.Java
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow-forms PUBLIC "-//OpenKM//DTD Workflow Forms 2.4//EN"
"http://www.openkm.com/dtd/workflow-forms-2.4.dtd">
<workflow-forms>
<workflow-form task="assignResign">
<input label="IT" name="ituser"></input>
<select name="superiors" label="List Superior">
<option label="Andy Permadi" value="andyperm" />
<option label="Andy Gunawan" value="andyguna" />
<option label="Usertest" value="usertest" />
</select>
<button label="Next" name="next" />
</workflow-form>
<workflow-form task="appIT">
<button label="Approved" name="approve" transition="accept" />
</workflow-form>
<workflow-form task="appSup">
<button label="Approved" name="approve" transition="accept" />
</workflow-form>
<workflow-form task="processToFinance">
<button label="Approved" name="approve" />
</workflow-form>
<workflow-form task="financeClear">
<button label="Approved" name="approve" />
</workflow-form>
</workflow-forms>
Code: Select all
actorSuperAction.java
package openkm.workflow.action;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.taskmgmt.def.AssignmentHandler;
import org.jbpm.taskmgmt.exe.Assignable;
import com.openkm.bean.form.Select;
//import com.openkm.bean.form.SuggestBox;
public class ActorSuperAssignHandler implements AssignmentHandler {
private static final long serialVersionUID = 1L;
@Override
public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
Select superiors = (Select) executionContext.getContextInstance().getVariable("superiors");
/*
if (superiors != null) {
assignable.setActorId(superiors.getName());
} else {
assignable.setActorId("okmAdmin");
}*/
}
}
Code: Select all
package openkm.workflow.action;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import com.openkm.bean.form.Select;
//import com.openkm.bean.form.SuggestBox;
public class actorSuperAction implements ActionHandler {
private static final long serialVersionUID = 1L;
//public static String user="";
@Override
public void execute(ExecutionContext executionContext) throws Exception {
Select superiors = (Select) executionContext.getContextInstance().getVariable("superiors");
//user = superiors.getValue();
if (superiors != null) {
executionContext.getContextInstance().setVariable("superiors", superiors.getName());
}
}
}
Code: Select all
<mail-node name="mailSuper" actors="#{superiors}">
<subject>
test mailSuper
</subject>
<text>
test workflow OpenKM
</text>
<transition to="Superior" name="to Superior"></transition>
</mail-node>
Attachments
(25.27 KiB) Downloaded 311 times
