12-18-2012 03:22 PM
12-19-2012 03:22 AM
12-19-2012 07:36 AM
Can you give an example of that? It's a long time ago since we wrote those enum form properties 😉i have example - Vacation request
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" id="definitions" targetNamespace="http://activiti.org/bpmn20">
<process id="vacationRequest" name="Vacation request">
<startEvent id="request" activiti:initiator="employeeName">
<extensionElements>
<activiti:formProperty id="numberOfDays" name="Number of days" type="long" value="1" required="true"/>
<activiti:formProperty id="startDate" name="First day of holiday (dd-MM-yyy)" datePattern="dd-MM-yyyy hh:mm" type="date" required="true"/>
<activiti:formProperty id="vacationMotivation" name="Motivation" type="string"/>
</extensionElements>
</startEvent>
<sequenceFlow id="flow1" sourceRef="request" targetRef="handleRequest"/>
<userTask id="handleRequest" name="Handle vacation request">
<documentation>
${employeeName} would like to take ${numberOfDays} day(s) of vacation (Motivation: ${vacationMotivation}).
</documentation>
<extensionElements>
<activiti:formProperty id="vacationApproved" name="Do you approve this vacation" type="enum" required="true">
<activiti:value id="true" name="Approve"/>
<activiti:value id="false" name="Reject"/>
</activiti:formProperty>
<activiti:formProperty id="managerMotivation" name="Motivation" type="string"/>
</extensionElements>
<potentialOwner>
<resourceAssignmentExpression>
<formalExpression>management</formalExpression>
</resourceAssignmentExpression>
</potentialOwner>
</userTask>
<sequenceFlow id="flow2" sourceRef="handleRequest" targetRef="requestApprovedDecision"/>
<exclusiveGateway id="requestApprovedDecision" name="Request approved?"/>
<sequenceFlow id="flow3" sourceRef="requestApprovedDecision" targetRef="sendApprovalMail">
<conditionExpression xsi:type="tFormalExpression">${vacationApproved == 'true'}</conditionExpression>
</sequenceFlow>
<task id="sendApprovalMail" name="Send confirmation e-mail"/>
<sequenceFlow id="flow4" sourceRef="sendApprovalMail" targetRef="theEnd1"/>
<endEvent id="theEnd1"/>
<sequenceFlow id="flow5" sourceRef="requestApprovedDecision" targetRef="adjustVacationRequestTask">
<conditionExpression xsi:type="tFormalExpression">${vacationApproved == 'false'}</conditionExpression>
</sequenceFlow>
<userTask id="adjustVacationRequestTask" name="Adjust vacation request">
<documentation>
Your manager has disapproved your vacation request for ${numberOfDays} days. Reason: ${managerMotivation}
</documentation>
<extensionElements>
<activiti:formProperty id="numberOfDays" name="Number of days" value="${numberOfDays}" type="long" required="true"/>
<activiti:formProperty id="startDate" name="First day of holiday (dd-MM-yyy)" value="${startDate}" datePattern="dd-MM-yyyy hh:mm" type="date" required="true"/>
<activiti:formProperty id="vacationMotivation" name="Motivation" value="${vacationMotivation}" type="string"/>
<activiti:formProperty id="resendRequest" name="Resend vacation request to manager?" type="enum" required="true">
<activiti:value id="true" name="Yes"/>
<activiti:value id="false" name="No"/>
</activiti:formProperty>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${employeeName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
<sequenceFlow id="flow6" sourceRef="adjustVacationRequestTask" targetRef="resendRequestDecision"/>
<exclusiveGateway id="resendRequestDecision" name="Resend request?"/>
<sequenceFlow id="flow7" sourceRef="resendRequestDecision" targetRef="handleRequest">
<conditionExpression xsi:type="tFormalExpression">${resendRequest == 'true'}</conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow8" sourceRef="resendRequestDecision" targetRef="theEnd2">
<conditionExpression xsi:type="tFormalExpression">${resendRequest == 'false'}</conditionExpression>
</sequenceFlow>
<endEvent id="theEnd2"/>
</process>
</definitions>
12-19-2012 07:37 AM
Hello Activity Forum,
I am just wondering if this is with purpose, but with form properties for the enum type default value are not automatically filled.
If not purposeful, can this be corrected?
Regards,
A.
12-19-2012 05:07 PM
<?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:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsmgdi="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="process1" name="process1">
<startEvent id="startevent1" name="Start"></startEvent>
<userTask id="usertask1" name="Exam selection" activiti:assignee="kermit">
<extensionElements>
<activiti:formProperty id="examtype" name="Exam type" type="enum" default="h">
<activiti:value id="m" name="Maths"></activiti:value>
<activiti:value id="l" name="Literature"></activiti:value>
<activiti:value id="h" name="History"></activiti:value>
</activiti:formProperty>
</extensionElements>
</userTask>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow2" name="" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_process1">
<bpmndi:BPMNPlane bpmnElement="process1" id="BPMNPlane_process1">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35" width="35" x="110" y="150"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55" width="105" x="220" y="140"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35" width="35" x="420" y="150"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="145" y="167"></omgdi:waypoint>
<omgdi:waypoint x="220" y="167"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="325" y="167"></omgdi:waypoint>
<omgdi:waypoint x="420" y="167"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
12-20-2012 04:51 AM
This is how it is done as the result of the Eclipse Designer; refer to line activiti:formProperty id="examtype":
….
<extensionElements>
<activiti:formProperty id="examtype" name="Exam type" type="enum" default="h">
<activiti:value id="m" name="Maths"></activiti:value>
<activiti:value id="l" name="Literature"></activiti:value>
<activiti:value id="h" name="History"></activiti:value>
</activiti:formProperty>
</extensionElements>
</userTask>
public class EnumFormPropertyRenderer extends AbstractFormPropertyRenderer {
public EnumFormPropertyRenderer() {
super(EnumFormType.class);
}
@SuppressWarnings("unchecked")
@Override
public Field getPropertyField(FormProperty formProperty) {
ComboBox comboBox = new ComboBox(getPropertyLabel(formProperty));
comboBox.setRequired(formProperty.isRequired());
comboBox.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty)));
comboBox.setEnabled(formProperty.isWritable());
Map<String, String> values = (Map<String, String>) formProperty.getType().getInformation("values");
if (values != null) {
for (Entry<String, String> enumEntry : values.entrySet()) {
// Add value and label (if any)
comboBox.addItem(enumEntry.getKey());
if (enumEntry.getValue() != null) {
comboBox.setItemCaption(enumEntry.getKey(), enumEntry.getValue());
}
}
}
return comboBox;
}
}
12-21-2012 04:29 AM
09-27-2013 05:18 PM
12-29-2013 01:15 PM
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.