Sign In   Register
  Wednesday, 27 February 2019
  7 Replies
  230 Visits
0
Votes
Undo
  Subscribe

I need to use the same form version throughout the workflow even if a new form version is pushed.

I'm trying to add the following property { "name": "Task Form Version", "value": "1" } to each review step, however, I need to assign it a dynamic value that always return the form version used in the first submission.

I tried to assign it “$func.startSubmission().getVersion().getVersionNumber()” but got the following error.

Error ID ******
Time *****
Type Collaboration Job
Name IllegalArgumentException
Message Form Version not found for Form Code: test-form2 Version Number: { <ObjectId:Submission, submission_oid=360760>; committed; [ abandonmentFormStatus: null abandonmentTimestamp: null abandonmentTy  

Thank you,

Ahmed.

3 years ago
·
#13611
0
Votes
Undo

Great stuff and .  Thanks for helping out.

0
Votes
Undo

Thats even better. Thanks for confirming.

3 years ago
·
#13609
0
Votes
Undo

Hi Nirmal, 

Larry's suggestion did work. Using the property names instead of the get methods solved the issue.

3 years ago
·
#13608
0
Votes
Undo

Awesome - Works now - Thank you, Larry!

"value": "$func.startSubmission().Version.VersionNumber"

0
Votes
Undo

Hi Ahmed,

It seems what I have suggested earlier (via email) is the right way to do it. Can you please try what Larry has suggested? If that doesn't work, we need to create a groovy service called "Get Start Form Version" that returns the version number for start submission and you can use below.

{ "name": "Task Form Version", "value": “$func.invoke("Get Start Form Version”) }

Groovy script needs to return the version number

import com.avoka.tm.job.* 
import com.avoka.tm.vo.* 
import com.avoka.tm.job.Jobs
import com.avoka.tm.vo.JobAction
import com.avoka.tm.vo.SvcDef
import com.avoka.tm.vo.User
import groovy.transform.TypeChecked

import javax.servlet.http.HttpServletRequest
import groovy.transform.TypeChecked
@TypeChecked
public class GetStartFormVersion{

// Injected at runtime
public Logger logger
 Object invoke(SvcDef svcDef, HttpServletRequest request, User user, JobAction jobAction, Map params) {

    // Job parameter will be automatically injected for you at runtime 
    Job job = params["job"]
    Txn txn = Jobs.getStartTxn(job) 
    return txn.formVersionNumber
 }
}
0
Votes
Undo

Hi Ahmed,

What you had assigned it to should in theory work. I was able to replicate this with the same error message.

Can you please try this velocity template - I am using property names instead of getter methods.

"value": "$func.startSubmission().version.versionNumber"

or with capital first letter property names works as well

"value": "$func.startSubmission().Version.VersionNumber"


I think we should als
o look at adding a helper method $func.startFormVersion() in a future version.

Cheers

Larry Bunton

Collaboration Jobs - Lead Architect

0
Votes
Undo

hi , the way you are doing it seems good to me. 

{ "name": "Task Form Version", "value": “$func.startSubmission().getVersion().getVersionNumber()” }

Are your originating and the task forms of the same form code?

  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!

Q&A Forum - Tips

The purpose of the Temenos Journey Manager platform (TJM) Q&A forum is for all clients and partners to seek help...

Read More

Not a member?

Register to ask a question and access to more content.

Join now

Looking for something else?

You can request access to:

  • Courses
  • Full Release Notes
  • Product Downloads
  • SDK

Request access

Leader Board

1
Mark Murray
User's Points: 1376
2
Lin Vanoevelen
User's Points: 1046
3
Julio Berrueco Pinto
User's Points: 715
4
Matthew White
User's Points: 398
5
Chad Thomas
User's Points: 300