cancel
Showing results for 
Search instead for 
Did you mean: 

activiti:formProperty value not getting set

darshan_hardas
Champ in-the-making
Champ in-the-making
We are having a BPMN XML file to where we need to share the properties from startEvent in one of exclusive gateway of a user task. We tried setting the default, value and also the variable. But still it is not working and always the value is empty.




<?xml version="1.0" encoding="UTF-8" ?>
<definitions id="definitions"
  targetNamespace="http://activiti.org/bpmn20"
  xmlns:activiti="http://activiti.org/bpmn"
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
  xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <process id="IndividualAppealNM" name="Individual Appeal for New Mexico state exchange">    
 
     <startEvent id="request" activiti:initiator="requesterName">
       <extensionElements>
           <activiti:formProperty id="groupName" name="Group Name" type="string"/>
           <activiti:formProperty id="requesterName" name="Requester Name" type="string"/> 
           <activiti:formProperty id="leaveReason" name="leave Reason" type="string" value="SomeValue"/>
       </extensionElements>
    </startEvent>
    <sequenceFlow id="flow1" sourceRef="request" targetRef="checkleaveReason" />

   <exclusiveGateway id="checkleaveReason" name="check leave Reason?" />
   <sequenceFlow id="flow201" sourceRef="checkleaveReason" targetRef="reviewLeaveForm">
      <conditionExpression xsi:type="tFormalExpression">${leaveReason!= 'test'}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow202" sourceRef="checkleaveReason" targetRef="theEndAll">
      <conditionExpression xsi:type="tFormalExpression">${leaveReason== 'test'}</conditionExpression>
    </sequenceFlow>
   
    <userTask id="reviewLeaveForm" name="Review leaveForms" >
      <documentation>
           Review the leave.
      </documentation>
         <extensionElements>
  
           <activiti:formProperty id="leaveReason" name="Motivation" type="string" >${leaveReason}</activiti:formProperty>
           
      </extensionElements>
         <potentialOwner>
           <resourceAssignmentExpression>
              <formalExpression>${groupName}</formalExpression>
           </resourceAssignmentExpression>
         </potentialOwner>        
    </userTask> 
    <sequenceFlow id="flow3" sourceRef="reviewLeaveForm" targetRef="proceedWithLeaveReason" />
   
   
    <exclusiveGateway id="proceedWithLeaveReason" name="Validate the leave to proceed" />
   
    <sequenceFlow id="flow1702" sourceRef="proceedWithLeaveReason" targetRef="theEndAll">
      <conditionExpression xsi:type="tFormalExpression">${leaveReason == 'Medical'}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow1703" sourceRef="proceedWithLeaveReason" targetRef="theEndAll">
      <conditionExpression xsi:type="tFormalExpression">${leaveReason== 'Casual'}</conditionExpression>
    </sequenceFlow>

<endEvent id="theEndAll" />
  
  </process>
 
</definitions>



The xml is pretty much similiar to the above code.
Please guide us.

Thanks in advance.

5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
Hmm that should do it.

Are you submitting your variables correctly? How does this call into the api looks like?

Is the database table for variables ACT_RU_VARIABLE populated with the values?

darshan_hardas
Champ in-the-making
Champ in-the-making
Thanks for the reply!!!

We are getting the value of the submitted variables in the exclusiveGateway i.e. checkleaveReason gets the value of "leaveReason".
But when we use the variables in the userTask, it does shows up and the value is always null
<code>
<activiti:formProperty id="leaveReason" name="Motivation" type="string" >${leaveReason}</activiti:formProperty>
</code>

We also tried
<code>
<activiti:formProperty id="leaveReason1" name="Motivation" type="string" >${leaveReason}</activiti:formProperty>
<activiti:formProperty id="leaveReason2" name="Motivation" type="string" value="${leaveReason}" />
<activiti:formProperty id="leaveReason2" name="Motivation" type="string" variable=${leaveReason} />
</code>

But always the value is coming as null or empty.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hello,

Good description how form properties work is in the jUnite tests (e.g. org.activiti.engine.test.api.form.FormServiceTest#testFormPropertyHandling). I would say >${leaveReason}</ is not needed.
Just use the simple


<activiti:formProperty id="leaveReason" name="leave Reason" type="string" />

in the user task. (it should work)

Regards
Martin

darshan_hardas
Champ in-the-making
Champ in-the-making
We want to assign the value of "leaveReason" variable of the startEvent in the another userTask. Below is the code.
<code>
<activiti:formProperty id="leaveReason1" name="Motivation" type="string" >${leaveReason}</activiti:formProperty>
</code>

Here, the value of leaveReason1 is empty.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

try to use

<activiti:formProperty id="leaveReason1" name="Motivation" type="string"  value="${leaveReason}"></activiti:formProperty>

Regards
Martin
Getting started

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.