Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8742129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:26:42+00:00 2026-06-13T11:26:42+00:00

So for my project, we have some javascript code running as a rule within

  • 0

So for my project, we have some javascript code running as a rule within the Alfresco repository. So whenever a new document comes into a certain space, a new folder is dynamically created and that document is moved into that newly created space. Additionally, whenever a new folder is created, a property is updated like so for the document (expect caseID is actually a dynamically generated value based on a sequence in our database):

//Add caseID as a property of the folder
var props = new Array(1);
props["wf:caseIDNum"] = caseID;
var newAspect = newNewSpaceName.addAspect("wf:caseID",props);

However, now we want to be able to reference that newly created aspect/property during the course of our workflow in our share-workflow-form-config-.xml file so that it can be passed as a parameter to our control template. That is, currently we have:

<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions">
                  <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl"/>
               </field>

But what we want is something like the below:

<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions">
                  <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl">
                     <control-param name="caseID">wf:caseIDNum</control-param>
                  </control>
               </field>

So my question is, is that the proper syntax to pass a variable/property from the workflow model to the FTL file via the control param?

Edit (10/25/12) –

So based on the help given here, I tried to modify my ftl page like so…

custom-activiti-transitions.ftl:

<#assign caseID = "">
<#if field.control.params.caseID??>
    <#assign caseID = field.control.params.caseID>
<#else>
    <#assign caseID = null>
</#if>

<style type="text/css">

.button {
border: 1px solid #666;
background: #DCDCDC;
padding: 5px;
color: #333;
text-shadow: 1px 1px #fff;
-moz-border-radius: 5px;
-webkit-border-radius: 5px
border-radius: 5px;
cursor: pointer;
-moz-box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
-webkit-box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
a.button:hover {
background: #bbb;
color: #000;
text-shadow: 1px 1px #eee;
}

a.button:active {
position: relative;
top: 1px;
left: 1px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}

</style>

<a class="button" href="#" onClick="MyWindow=window.open('http://localhost:8080/alfresco/faces/jsp/custom/CodeSelector.jsp?caseID=${caseID}','My Window','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=300'); return false;" style="text-decoration:none" target="_blank"><span>Add Codes</span></a>

And in my share-workflow-form-config.xml, I changed any instance of:

<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions">
 <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl">
 </control>
</field>

to…

<field id="wf:submitCode" label-id="workflow.field.outcome" set="actions">
 <control template="/org/alfresco/components/form/controls/workflow/custom-activiti-transitions.ftl">
  <control-param name="caseID">wf:caseIDNum</control-param>
 </control>
</field>

My problem is that in the share-workflow-form-config.xml where I specify the control-param, I can get it to pass in a hard coded value like “30”. However, when I try to get the value of the workflow property like wf:caseIDNum, it returns the actual string in the parameter like:

http://localhost:8080/alfresco/faces/jsp/custom/CodeSelector.jsp?caseID=wfcaseIDNum

as opposed to the actual value for the property, i.e. “30”.

Any ideas on what I could be doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:26:43+00:00Added an answer on June 13, 2026 at 11:26 am

    It’s exactly as skuro said and you’re not doing this rightly.

    Very simple your config is correct but your ftl lacks some logic.

    Why will you first check on <#if field.control.params.caseID??>
    And then not assign it?

    It should be:

    <#if field.control.params.caseID??>
       <#assign caseID = field.control.params.caseID>
    <#else>
       <#assign caseID = 1>
    </#if>
    

    There is no need of a context or args or something.

    Take a look at the default ones like /org/alfresco/components/form/controls/textarea.ftl

    —– UPDATE —–

    So how can one access another field in this template.
    So we’ve got another field “wf:caseIDNum” and we want to access that one.

    You could use the following hacky mechanism to get it

    ${form.fields["prop_" + caseID?replace(":","_")].value}
    

    in the form.fields all the current form properties are stored.

    BTW don’t forget to show the “wf:caseIDNum” and the hidden.ftl template or else the property won’t be populated in the fields object ;).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Within my Website project, I have some aspx pages, javascript files, and a custom
I have some code in my project that saves an object to the database,
I have all my javascript code for i project in a single minified library.
I have a JavaScript code that I want to bring the idea into my
I have seen the oddest behavior from JavaScript and would love some insight into
I'm busy on a project and I have some extra javascript files that need
I have a zend framework project and I am loading some javascript in a
I work with my student group on a project : We have some problems
So I have this project in PHP where I have some include files next
I'm working on a windows phone project where I have some xml files with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.