cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Action Block Input Values: Invalid Assignment Target

Former Member
0 Kudos

Hi all,

My first custom action block... It works fine if I don't link to any of the inputs.

If I link a value to, say, templateName I get an error as below.

The only thing that looks wrong to me is that in the window to link the inputs, the icon

on templateName is not the "T", it is the same icon as on the action name.

I believe it is getting compiled with 1.4.2_07... And I got the Lighthammer.jar from our server.

Here is the error:

[INFO ]: Execution Started At: 22:23:58
[ERROR]: STEP EXCEPTION () : Invalid Assignment Target: [AmyTest5_Label_0.TemplateName]
[ERROR]: STEP EXCEPTION (AmyTest5_Label_0) : Invalid Assignment Target: [AmyTest5_Label_0.TemplateName]
[ERROR]: STEP EXCEPTION (Sequence) : Invalid Assignment Target: [AmyTest5_Label_0.TemplateName]
[ERROR]: TRANSACTION EXECUTION TERMINATED
[INFO ]: Execution Completed At: 22:23:58 Elapsed Time was 0 mS

Here is the catalog.xml


<?xml version="1.0" encoding="UTF-8"?>
<ComponentCatalog>
	<Category Name="AmyTest5" Description="Loftware FTP">
		<Component 
			Type="Action" 
			Name="AmyTest5" 
			Description="AmyTest5" 
			Label="AmyTest5 Label" 
			ClassName="com.haworthinc.flex.actions.PrintLabelAction" 
			AssemblyName="AmyTest5.jar" 
			Dependencies="commons-net-1.3.0.jar,jakarta-oro-2.0.8.jar" 
			HelpFileName=""/>
	</Category>
</ComponentCatalog>

And here is the java code


package com.haworthinc.flex.actions;

import com.sap.xmii.xacute.core.ILog;
import com.sap.xmii.xacute.core.Transaction;

public class PrintLabelAction extends com.sap.xmii.xacute.actions.ActionReflectionBase {

    private static final long serialVersionUID = 1L;
    
	private String messageOut;
	
	private String templateName;
	private String printerName;
	private String duplicates;

	public PrintLabelAction() {
		messageOut = "";
	}

	public String GetIconPath() {
		return "/com/haworthinc/flex/actions/resources/icons/under_construction.png";
	}

	public void Invoke(Transaction arg0, ILog arg1) throws Exception {
		try {
			PrintLabelTest testMe = new PrintLabelTest();
			messageOut = testMe.ftpFile(printerName, templateName, duplicates);
		} catch (Exception e) {
			System.out.println(this.getClass().getName());
			e.printStackTrace();
			messageOut = e.toString();
		}
	}

	public boolean isConfigurable() {
		return false;
	}

	// *************** Output variables ****************
	public String getMessageOut() {
		return messageOut;
	}
	
	// *************** Input variables *****************
    	public void setDuplicates(String duplicates) {
    			this.duplicates = duplicates;
    	}

    	public void setTemplateName(String templateName) {
    			this.templateName = templateName;
    	}

    	public void setPrinterName(String printerName) {
    			this.printerName = printerName;
    	}

}

Any ideas?

--Amy Smith

--Haworth

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Amy.

It's an easy fix. You also need to provide getXXX methods for all of your properties in your action. For example:


public String getTemplateName() {
     return this.templateName;
}

Also, be sure to do the same for the printerName property as well.

This should fix you up!

Rick

Former Member
0 Kudos

Thanks Rick --- I was confused because outputs don't require setters, so I assumed inputs didn't need getters. Is there any documentation other than the blogs on writing Custom Action Blocks? I will want to do more then my Loftware/simple block.

For instance if I want the Rowsets as input, what is the class? etc.

Thanks again Rick, I really appreciate this forum and everyone's quick response.

--Amy Smith

--Haworth

jcgood25
Active Contributor
0 Kudos

Amy,

There is a Customization category on the SDN MII Wiki with some article pointers.

There is also a Custom Action Developer Kit in the SDN download area (for Manufacturing...12.0 Sample Projects)

Regards,

Jeremy

Former Member
0 Kudos

Hi, Amy.

You'll want to use the XMLDataType "type". It includes a bunch of very convenient methods for accessing the XML structures. There are also a number of very helpful (but probably undocumented) methods in the MII libraries/jars for accessing "Rowsets" style XML (e.g. getting a list of rows to loop through, getting a specific column value in a row, etc.).

This special type is what you'll use for XML inputs or outputs.

Rick

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

We have a custom control to print the lable through Zebra printer in xMII.

There is a BLS to print the Lable.

I want to print another ticket with small variation(add one more barcode on same lable).

I just copied BLS which prints lables,changed the ZPL command as per reqiuirement.

This doesn't work. it is giving error

[6782F712-EB0F-C015-8AB1-66D0BBBBA134][ERROR]: ACTION FAILED: End Action ZebraPrint_1 : (Sends Files to Zebra Printer)

What might be the reason?

Thanks

A

agentry_src
Active Contributor
0 Kudos

Aarti,

This thread is marked answered. Please start a new message.

Thanks,

Mike

Former Member
0 Kudos

Sometimes I would get this error when I updated the jar on the server but didn't clean out all the caches or missed replacing the jar in one of the locations. Sometimes I think I had to make a new transactions as well, but that may have been because I changed the custom action too much.