AnsweredAssumed Answered

Process variable issue in domain classes where one to one relation exists

Question asked by srikanthkollipara on Oct 7, 2015
Latest reply on Nov 30, 2015 by srikanthkollipara
Hi,

I have a form where user enters the information while raising a request. This information will be stored in multiple tables.

Parent Domain – RequestDetails
Child – RequestAttributes
Child – RequestStipulations


The relation is RequestDetails to RequestAttributes is one-to-one.
For RequestDetails–Request stipulataions is one-to-many.

My bpmn file looks like:

<blockcode>
<process id="sampleRequest" name="Sample Request">
        <startEvent id="start" />
        <sequenceFlow id="flow0" targetRef="submitWorkflowRequest"
                      sourceRef="start" />
        <userTask id="submitWorkflowRequest" activiti:formKey="/SampleRequest/create"
                  name="Submit Workflow Request">
            <documentation>Workflow request submitted by ${username}</documentation>
            <potentialOwner>
                <resourceAssignmentExpression>
                    <formalExpression>user(${username})</formalExpression>
                </resourceAssignmentExpression>
            </potentialOwner>

        </userTask>

        <sequenceFlow id="flow1" targetRef="handleWorkflowRequest"
                      sourceRef="submitWorkflowRequest" />
        <userTask id="handleWorkflowRequest" activiti:formKey="/SampleRequest/approval"
                  name="Handle Workflow Request">
            <documentation>Workflow request submitted by ${username}</documentation>
            <potentialOwner>
                <resourceAssignmentExpression>
                    <formalExpression>user(tenantManager)</formalExpression>
                </resourceAssignmentExpression>
            </potentialOwner>
        </userTask>

        <sequenceFlow id="flow2" targetRef="end0"
                      sourceRef="handleWorkflowRequest">
        </sequenceFlow>
        <endEvent id="end0" />
</blockcode>

Now when user enters data on the create form and clicks on complete button to submit the request. I am calling the below snippet:

<blockcode>
if (RequestDetailsInstance.save(flush: true, failOnError: true)) {
            flash.message = "Request ${RequestDetailsInstance.id} created"

            params.id = RequestDetailsInstance.id
            if (params.complete) {
                completeTask(params)
                render "Request created with id:  ${RequestDetailsInstance.id} "

            }else {
                saveTask(params)
                render "Request saved with id:  ${RequestDetailsInstance.id} "
            }
</blockcode>

It is succesfully saving the data into all the 3 tables by following the relationships among them.
when the control comes to completeTask(params), it is throwing an exception saying, could not find a variable type to serialize [here it is showing the child domain class object variables].

Can anyone help me in resolving this.

Outcomes