cancel
Showing results for 
Search instead for 
Did you mean: 

Field Type on Parameter POC for job definition test must be specified

Former Member
0 Kudos

I am trying to add a parameter POC to a jobDefinition test by using RedwoodScript and am getting the following error

Caused by: JCS-122035: Unable to persist: JCS-MULTI: Modification vetoed: JCS-102074: Field Type on Parameter POC for job definition test must be specified

following is the script which I have coded

JobDefinition jobdef = jcsSession.getJobDefinitionByName('test');

JobDefinitionParameter jobdefparam;

jcsOut.println(jobdef.getName());

if (jobdef != null )

{

jobdefparam = jobdef.getJobDefinitionParameterByName("POC");

if (jobdefparam == null )

{

Long longObj2 = new Long("200");

jcsOut.println("No POC");

JobDefinitionParameter jdp = jobdef.createJobDefinitionParameter();

jdp.setName("POC");

jdp.setDefaultExpression(strList[3]);

jdp.setDisplayOrder(longObj2);

jcsSession.persist();

}

}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

{

boolean t = true;

boolean f = false;

JobDefinition jobdef = jcsSession.getJobDefinitionByName("Parameter Name");

JobDefinitionParameter jobdefparam;

if (jobdef != null )

{

jcsOut.println(jobdef.getName());

//Parameter Name

jobdefparam = jobdef.getJobDefinitionParameterByName("Parameter Name");

if (jobdefparam == null )

{

JobDefinitionParameter jdp = jobdef.createJobDefinitionParameter();

jdp.setName("Parameter Name");

jdp.setDefaultExpression("Parameter Value");

jdp.setDisplayOrder(new Long(200));

jdp.setDirection(ParameterDirection.In);

jdp.setDataType(ParameterType.String);

jcsOut.println(jdp.getName());

jcsSession.persist();

}

else {jcsOut.println("Job Name Not Found");}

}

}

Former Member
0 Kudos

Hi Babu Murthy,

To create a parameter do you must to set some mandatory attributes, like "Field Type". Bellow the mandatory attributes that you must to set with the respective method.

. Direction (setDirection) -> In, Out or In Out

. Parameter Type (setDataType) -> Character, Date, Date Time, Date Time Zone, File, Number, String or Time

. Display order (setDisplayOrder) -> Sequential number

. Default Value Editable (setEditable) -> None, Always, Never or Only When Null

. Simple Constraint Type (setSimpleConstraintType) -> Expression, List, None, Pair List, Query Filter or Table

P.S.: I'm not a Java specialist and I don't know how to use these methods. So, additional follow the API documentation to all Set methods, may be it help you to finalize your case.

setDataLength

public void setDataLength(Long newDataLength)

Set the value for DataLength. (The maximum length that a string parameter can be. If this value is null then the length will not be checked. This value is ignored for non-string parameters.) This value is optional.

Parameters:

newDataLength - the new value for DataLength.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setDataPrecision

public void setDataPrecision(Long newDataPrecision)

Set the value for DataPrecision. (The precision, or the total number of digits. Currently this field is ignored. Setting this value to anything other than null may cause unexpected behaviour in future releases.) This value is optional.

Parameters:

newDataPrecision - the new value for DataPrecision.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setDataScale

public void setDataScale(Long newDataScale)

Set the value for DataScale. (The number of digits to the right of the decimal pointi. Currently this field is ignored. Setting this value to anything other than null may cause unexpected behaviour in future releases.) This value is optional.

Parameters:

newDataScale - the new value for DataScale.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setDataType

public void setDataType(ParameterType newDataType)

Set the value for DataType. (The datatype of the parameter) This value is mandatory.

Parameters:

newDataType - the new value for DataType. If this is null, then the object cannot be persisted.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setDefaultExpression

public void setDefaultExpression(String newDefaultExpression)

Set the value for DefaultExpression. (The definition of the default parameter value. The interpretation of this expression is based upon the DefaultExpressionType.) This value is optional.

Parameters:

newDefaultExpression - the new value for DefaultExpression.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setDefaultValueEditable

public void setDefaultValueEditable(ValueEditable newDefaultValueEditable)

Set the value for DefaultValueEditable. (When is the DefaultValue Editable.) This value is optional.

Parameters:

newDefaultValueEditable - the new value for DefaultValueEditable.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setDirection

public void setDirection(ParameterDirection newDirection)

Set the value for Direction. (What direction is the parameter passed.) This value is mandatory.

Parameters:

newDirection - the new value for Direction. If this is null, then the object cannot be persisted.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setSimpleConstraintType

public void setSimpleConstraintType(SimpleConstraintType newSimpleConstraintType)

Set the value for SimpleConstraintType. (The type of simple constraint to apply.) This value is mandatory.

Parameters:

newSimpleConstraintType - the new value for SimpleConstraintType. If this is null, then the object cannot be persisted.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setSimpleConstraintData

public void setSimpleConstraintData(String newSimpleConstraintData)

Set the value for SimpleConstraintData. (The data for the simple constraint.) This value is optional.

Parameters:

newSimpleConstraintData - the new value for SimpleConstraintData.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setSimpleConstraintMessage

public void setSimpleConstraintMessage(String newSimpleConstraintMessage)

Set the value for SimpleConstraintMessage. (The data for the simple constraint.) This value is optional.

Parameters:

newSimpleConstraintMessage - the new value for SimpleConstraintMessage.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setSimpleConstraintOptional

public void setSimpleConstraintOptional(boolean newSimpleConstraintOptional)

Set the value for SimpleConstraintOptional. (Is the constraint optional?)

Parameters:

newSimpleConstraintOptional - the new value for SimpleConstraintOptional.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setDisplay

public void setDisplay(boolean newDisplay)

Set the value for Display. (Is the parameter displayed?)

Parameters:

newDisplay - the new value for Display.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setPassword

public void setPassword(boolean newPassword)

Set the value for Password. (Is the parameter concealed?)

Parameters:

newPassword - the new value for Password.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setDisplayOrder

public void setDisplayOrder(Long newDisplayOrder)

Set the value for DisplayOrder. (In which position is this parameter displayed by a front end?) This value is mandatory.

Parameters:

newDisplayOrder - the new value for DisplayOrder. If this is null, then the object cannot be persisted.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setEditable

public void setEditable(EditableType newEditable)

Set the value for Editable. (May the default parameter value be overwritten?) This value is mandatory.

Parameters:

newEditable - the new value for Editable. If this is null, then the object cannot be persisted.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setGroupName

public void setGroupName(String newGroupName)

Set the value for GroupName. (The GUI name of the parameter group) This value is optional.

Parameters:

newGroupName - the new value for GroupName.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setPartOfKey

public void setPartOfKey(boolean newPartOfKey)

Set the value for PartOfKey. (Is this a parameter a part of the key for this JobDefinition? That is if getJobDefinition().getKeepType() == JobDefinitionKeepType.Key, then should this parameter be used to filter the results.)

Parameters:

newPartOfKey - the new value for PartOfKey.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setNullable

public void setNullable(boolean newNullable)

Set the value for Nullable. (Is the parameter optional?)

Parameters:

newNullable - the new value for Nullable.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setRuntime

public void setRuntime(boolean newRuntime)

Set the value for Runtime. (Is the parameter determined at runtime?)

Parameters:

newRuntime - the new value for Runtime.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.

setJobFormat

public void setJobFormat(String newJobFormat)

Set the value for JobFormat. (The format mask for the parameter in which the Job uses its value.) This value is optional.

Parameters:

newJobFormat - the new value for JobFormat.

Throws:

ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.