[JBoss jBPM] - Re: Starting a Process Through API
by dhanushgopinath
The process is this :
<?xml version="1.0" encoding="UTF-8"?>
| <process
| name="Workflow1"
| targetNamespace="http://www.altair.com/EPM/BPEL/Workflow1"
| xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema"
| xmlns:tns="http://www.altair.com/EPM/BPEL/Workflow1" xmlns:ns0="http://www.altair.com/EPM/Workflow1Dataschema"
| xmlns:ns1="http://www.altair.com/WF/Framework/HumanTaskDataSchema" xmlns:ns2="http://www.altair.com/WF/Framework/TaskSchema">
| <import namespace="http://www.altair.com/EPM/Workflow1" location="Workflow1.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
| <import namespace="http://www.altair.com/EPM/Workflow1InvokeBatchMesh" location="Workflow1InvokeBatchMesh.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
| <import namespace="http://www.altair.com/WF/Framework/HumanTaskDataSchema" location="HumanTaskDataSchema.xsd" importType="http://www.w3.org/2001/XMLSchema"/>
| <partnerLinks>
| <partnerLink name="BatchMeshPL" xmlns:tns="http://www.altair.com/EPM/Workflow1InvokeBatchMesh" partnerLinkType="tns:Workflow1BatchMeshPLT" myRole="Workflow1ReceivePortTypeRole" partnerRole="Workflow1InvokeBatchMeshPortTypeRole"/>
| <partnerLink name="StartWorkflowPL" xmlns:tns="http://www.altair.com/EPM/Workflow1" partnerLinkType="tns:Workflow1PLT" myRole="Workflow1PortTypeRole"/>
| </partnerLinks>
| <variables>
| <variable name="humanTask" type="ns1:HumanTaskComplexType"/>
| <variable name="StartWorkflowOut" xmlns:tns="http://www.altair.com/EPM/Workflow1" messageType="tns:Workflow1ReplyResponse"/>
| <variable name="StartWorkflowIn" xmlns:tns="http://www.altair.com/EPM/Workflow1" messageType="tns:Workflow1StartRequest"/>
| <variable name="ReceiveMeshFileIn" xmlns:tns="http://www.altair.com/EPM/Workflow1InvokeBatchMesh" messageType="tns:ReceiveBMS"/>
| <variable name="BatchMeshOut" xmlns:tns="http://www.altair.com/EPM/Workflow1InvokeBatchMesh" messageType="tns:InvokeBMSResponse"/>
| <variable name="BatchMeshIn" xmlns:tns="http://www.altair.com/EPM/Workflow1InvokeBatchMesh" messageType="tns:InvokeBMSRequest"/>
| </variables>
| <sequence>
| <receive name="StartWorkflow" createInstance="yes" partnerLink="StartWorkflowPL" operation="StartWorkflow" xmlns:tns="http://www.altair.com/EPM/Workflow1" portType="tns:Workflow1PortType" variable="StartWorkflowIn"/>
| <assign name="Assign1">
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns0:meshingData</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns0:meshingData</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns0:meshingData/ns0:partFile1</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns0:meshingData/ns0:partFile1</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns0:meshingData/ns0:partFile2</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns0:meshingData/ns0:partFile2</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns0:meshingData/ns0:meshSize</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns0:meshingData/ns0:meshSize</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskID</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskID</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPriority</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPriority</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskStatus</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskStatus</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskCreationTime</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskCreationTime</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskCompletionTime</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskCompletionTime</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:group/ns1:id</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:group/ns1:id</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:group/ns1:groupName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:group/ns1:groupName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:userID</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:userID</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:firstName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:firstName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:lastName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:lastName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:userEmail</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:userEmail</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:group/ns1:id</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:group/ns1:id</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:group/ns1:groupName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:group/ns1:groupName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:department</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:user/ns1:department</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:userID</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:userID</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:firstName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:firstName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:lastName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:lastName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:userEmail</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:userEmail</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:group/ns1:id</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:group/ns1:id</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:group/ns1:groupName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:group/ns1:groupName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:department</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskPotentialOwners/ns1:multipleUsers/ns1:User/ns1:department</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:group/ns1:id</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:group/ns1:id</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:group/ns1:groupName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:group/ns1:groupName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:userID</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:userID</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:firstName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:firstName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:lastName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:lastName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:userEmail</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:userEmail</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:group/ns1:id</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:group/ns1:id</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:group/ns1:groupName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:group/ns1:groupName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:department</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:user/ns1:department</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:userID</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:userID</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:firstName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:firstName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:lastName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:lastName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:userEmail</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:userEmail</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:group/ns1:id</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:group/ns1:id</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:group/ns1:groupName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:group/ns1:groupName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:department</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskExcludedOwners/ns1:multipleUsers/ns1:User/ns1:department</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:id</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:id</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedAt</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedAt</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:userID</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:userID</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:firstName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:firstName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:lastName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:lastName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:userEmail</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:userEmail</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:group/ns1:id</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:group/ns1:id</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:group/ns1:groupName</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:group/ns1:groupName</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:department</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:addedBy/ns1:department</to>
| </copy>
| <copy>
| <from>$StartWorkflowIn.Workflow1StartRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:text</from>
| <to>$BatchMeshIn.InvokeBMSRequestPart/ns1:humanTaskInfo/ns1:taskComments/ns1:text</to>
| </copy>
| </assign>
| <invoke name="BatchMeshHumanTask" partnerLink="BatchMeshPL" operation="BatchMesh" xmlns:tns="http://www.altair.com/EPM/Workflow1InvokeBatchMesh" portType="tns:Workflow1InvokeBatchMeshPortType" inputVariable="BatchMeshIn" outputVariable="BatchMeshOut"/>
| <receive name="ReceiveMeshFile" createInstance="no" partnerLink="BatchMeshPL" operation="ReceiveMeshFile" xmlns:tns="http://www.altair.com/EPM/Workflow1InvokeBatchMesh" portType="tns:Workflow1ReceivePortType" variable="ReceiveMeshFileIn"/>
| <assign name="Assign2">
| <copy>
| <from>$ReceiveMeshFileIn.ReceiveBMSPart/ns0:task/ns2:taskIsHuman</from>
| <to>$StartWorkflowOut.Workflow1ReplyResponsePart/ns0:done</to>
| </copy>
| </assign>
| <reply name="Reply1" partnerLink="StartWorkflowPL" operation="StartWorkflow" xmlns:tns="http://www.altair.com/EPM/Workflow1" portType="tns:Workflow1PortType" variable="StartWorkflowOut"/>
| </sequence>
| </process>
|
And the code is this :
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration
| .getInstance();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| BpelGraphSession graphSession = BpelGraphSession
| .getContextInstance(jbpmContext);
|
| BpelProcessDefinition bpelProcDef = graphSession
| .findLatestProcessDefinition("ProcessDefinitionName","ProcessDefintiion Target URI";
|
| ProcessInstance procInstance = jbpmContext.newProcessInstance("ProcessDefintionName");
| procInstance.signal();
| jbpmContext.close();
I am not currently setting any input variables, just wanted to see if its starts. I inspected the root token of the procInstance variable and found that its node is null.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185708#4185708
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4185708
17 years, 5 months
[Javassist user questions] - Unexpected change of CtConstructor parameter type
by Juda
I've noticed strange CtConstructor's constructor behavior. The following code illustrates the problem:
| import javassist.ClassPool;
| import javassist.CtClass;
| import javassist.CtConstructor;
|
| public class Test {
| Test( Test t ){}
|
| public static void main(String[] args) throws Exception {
| ClassPool pool = ClassPool.getDefault();
|
| CtClass baseCtClass = pool.getCtClass( Test.class.getName() );
| CtClass childCtClass = pool.makeClass( Test.class.getName() + "$$Ex", baseCtClass );
|
| assert baseCtClass.getDeclaredConstructors().length == 1;
| assert baseCtClass.getDeclaredConstructors()[0].getParameterTypes().length == 1;
| assert baseCtClass.getDeclaredConstructors()[0].getParameterTypes()[0].equals( baseCtClass );
|
| assert childCtClass.getDeclaredConstructors().length == 0;
|
| CtConstructor childCtor = new CtConstructor( baseCtClass.getDeclaredConstructors()[0], childCtClass, null );
| childCtor.setBody( "{ super($$); }" );
| childCtClass.addConstructor( childCtor );
|
| assert childCtClass.getDeclaredConstructors().length == 1;
| assert childCtClass.getDeclaredConstructors()[0].getParameterTypes().length == 1;
| assert childCtClass.getDeclaredConstructors()[0].getParameterTypes()[0].equals( baseCtClass );
| //the last assert fails (at least using Sun's jdk 1.6 u 10 / javassist 3.9.0 )
| //for some reason ctor parameter type is Test$$Ex instead of Test
| }
| }
|
Last program assertion fails. The CtConstructor parameter is changed from Test to the Test$$Ex. Is it done on purpose?
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185706#4185706
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4185706
17 years, 5 months
Delivery Notification <buhgalter@gunsanelectric.com>
by Postmaster@lists.jboss.org
This is a delivery status notification, automatically generated by MTA smtpgw.borusantelekom.com on Thu, 30 Oct 2008 14:50:41 +0200
Regarding recipient(s) : buhgalter(a)gunsanelectric.com
Delivery status : Failed. Message could not be delivered to domain <gunsanelectric.com> .Failed while initiating the protocol. <[('buhgalter(a)gunsanelectric.com', 511, 'sorry, no mailbox here by that name (#5.1.1 - chkuser)')]>
MTA Response :511
The original message headers are included as attachment.
17 years, 5 months