Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$TaskID - remove deprecated code #388

Closed
rsoika opened this issue Jun 7, 2018 · 16 comments
Closed

$TaskID - remove deprecated code #388

rsoika opened this issue Jun 7, 2018 · 16 comments

Comments

@rsoika
Copy link
Member

rsoika commented Jun 7, 2018

remove method calls getProcessID and replace with getTaskID

@rsoika rsoika added this to the 4.3.3 milestone Jun 7, 2018
rsoika added a commit that referenced this issue Jun 7, 2018
rsoika added a commit that referenced this issue Jun 7, 2018
rsoika added a commit that referenced this issue Jun 7, 2018
rsoika added a commit that referenced this issue Jun 7, 2018
@chrisw14
Copy link

When processing a workitem the $taskId does not get updated at the moment.
Maybe it's possible to fix this? Otherwise I have to change it back to $processId...

And would it be possible to log the following log at the fine level when using the simulation service?
Otherwise there are many useless logs for me...
17:50:10,120 INFO [org.imixs.workflow.WorkflowKernel] (default task-45) processing=b7e4b092-3d29-4e81-a755-0eb10270f98d, MODELVERSION=...

Thank you!

@rsoika
Copy link
Member Author

rsoika commented Jun 10, 2018

Of course, the $taskID as well as the $processID should be written back in parallel with the current version. Otherwise this would be a bug. I have to check this.....

@rsoika
Copy link
Member Author

rsoika commented Jun 10, 2018

This is how the 'setTaskID()' method is implemented at the moment in ItemCollection:

	public void setTaskID(int taskID) {
		replaceItemValue(WorkflowKernel.TASKID, taskID);
		// deprecated processID is still supported for a long period. See issue #384
		replaceItemValue("$processid", taskID);
	}

Do you set "$processid" or "$taskID" by your self? The only place where this ID is changed should be the WorkflowKernel method 'process'.

@chrisw14
Copy link

Here only the $processID will be set but not the $taskID I think?

@rsoika
Copy link
Member Author

rsoika commented Jun 10, 2018

yes ! this is a bug

@rsoika
Copy link
Member Author

rsoika commented Jun 10, 2018

But you where not in the master branch:

documentResult.setTaskID(Integer.valueOf(itemColNextTask.getItemValueInteger("numprocessid")));

@rsoika rsoika added the testing label Jun 10, 2018
@chrisw14
Copy link

Hm I downloaded imixs-workflow-core in version 4.3.2 over maven and there only the $processID is set in the WorkflowKernel :-(

@rsoika
Copy link
Member Author

rsoika commented Jun 11, 2018

Yes this is right. You are working on the edge to the next version ;-)
This version is only available in the Master branch. But you don't need to use the latest version with the new methods. Just go ahead with your existing code with version 4.3.2. It is still working. Methods will be marked as deprecated in the future. But there is no pressure.

@chrisw14
Copy link

chrisw14 commented Jun 12, 2018 via email

@rsoika
Copy link
Member Author

rsoika commented Jun 12, 2018

ok - I am not sure where you see the problem.
If you like to work with the latest master version 4.3.3-SNAPSHOT the workflow kernel will set both - the $processid and the $taskid. You usually have no need to set this field by yourself.

Both fields ($processid and $taskid) will be supported in the future. In you code you can use the new fluent interface to init a new workitem:

workitem=new ItemCollection().model("xxx").task(1000).event(10);
workflowService.process(workitem);

You should not change the taskid/processid in you code after a new process instance was processed.

Do you have a code example what is going wrong in you code?

Why do you think that the process method did not handle both fields?

@chrisw14
Copy link

chrisw14 commented Jun 12, 2018

Hm. Im working with version 4.3.2 and the WorkflowKernel looks from 467 like this:
grafik

Of course I don't manipulate the $processId or $taskID by myself, only by the workflow engine.
But the processEvent-method of the WorkflowKernel (called by process method) doesn't set the $taskID.
I think it would be better if the $taskID would be set there too because otherwise the $taskID has a wrong value. Why it's only set in 4.3.3-SNAPSHOT and not in 4.3.2? You would have the choice if you are using $taskID or $processID because both values are right...

@rsoika
Copy link
Member Author

rsoika commented Jun 12, 2018

Ok now I understand you.
Introducing the new items "$eventid" and "$taskID" is a change taking place in the medium term.

This means: with version 4.3.2 we first introduced the new item $eventid and we also provide the new getter/setter methods (get/setEventID and get/setTaskID). Some parts of the code have been deprecated. This version is full backward compatible and shows only some warnings if $activityID is still used. This was necessary to prepare the code of the engine itself for the new concept. But applications usually interact with the WorkflowService and will not see much of this change. As a result of this version the engine is still not setting the new $taskid in most of the cases - as you have recognized.

With version 4.3.3 we started some more refactoring for the support the "$taskid" and guarantee the this field is set correctly. In this version also the method processEvent was refactored. If you are using this new version you will see the new $taskid in your workitems. Also this version is full backward compatible. But this is still work in progress.

In any case you will see the field "$processid" for a long long period of time in your workitems. You can work with this field equally as with the field "$taskid". This is the reason for issue #384 .

So don't be confused. If you use the latest version just make sure that you use get/setTaskID and get/setEventID instead of deprecated code dealing with $processid and $activityid. Your application should not be affected. In the worst case you will see some warnings in the server log file. But your code will not break - if so, than please let me know.

@chrisw14
Copy link

chrisw14 commented Jun 13, 2018

If you like to work with the latest master version 4.3.3-SNAPSHOT the workflow kernel will set both

I tried it to switch to the snapshot version but now maven has a problem. Has something changed here?


[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building imixs-workflow 4.3.3
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for javax.faces:jsf-api:jar:2.2 is missing, no dependency information available
[WARNING] The POM for org.imixs.workflow:imixs-workflow-engine:jar:4.3.3 is missing, no dependency information available
[WARNING] The POM for org.imixs.workflow:imixs-workflow-jax-rs:jar:4.3.3 is missing, no dependency information available
[WARNING] The POM for org.imixs.workflow:imixs-workflow-faces:jar:4.3.3 is missing, no dependency information available
[INFO] Downloading: http://oss.sonatype.org/content/repositories/snapshots/org/imixs/workflow/imixs-workflow-core/4.3.3/imixs-workflow-core-4.3.3.pom
[INFO] Downloading: https://raw.githubusercontent.com/imixs/imixs-mvn-repo/master/org/imixs/workflow/imixs-workflow-core/4.3.3/imixs-workflow-core-4.3.3.pom
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/imixs/workflow/imixs-workflow-core/4.3.3/imixs-workflow-core-4.3.3.pom
[WARNING] The POM for org.imixs.workflow:imixs-workflow-core:jar:4.3.3 is missing, no dependency information available
[INFO] Downloading: http://oss.sonatype.org/content/repositories/snapshots/org/imixs/workflow/imixs-workflow-core/4.3.3/imixs-workflow-core-4.3.3.jar
[INFO] Downloading: https://raw.githubusercontent.com/imixs/imixs-mvn-repo/master/org/imixs/workflow/imixs-workflow-core/4.3.3/imixs-workflow-core-4.3.3.jar
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/imixs/workflow/imixs-workflow-core/4.3.3/imixs-workflow-core-4.3.3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.385 s
[INFO] Finished at: 2018-06-13T17:54:24+02:00
[INFO] Final Memory: 8M/21M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project imixs-workflow: Could not resolve dependencies for project org.imixs.workflow:imixs-workflow:war:4.3.3: The following artifacts could not be resolved: org.imixs.workflow:imixs-workflow-engine:jar:4.3.3, org.imixs.workflow:imixs-workflow-jax-rs:jar:4.3.3, org.imixs.workflow:imixs-workflow-faces:jar:4.3.3, org.imixs.workflow:imixs-workflow-core:jar:4.3.3: Failure to find org.imixs.workflow:imixs-workflow-engine:jar:4.3.3 in http://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-snaptshots has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

@rsoika
Copy link
Member Author

rsoika commented Jun 13, 2018

The current version under development is located in the master branch. This is version "4.3.3-SNAPSHOT" and not "4.3.3".
If you checkout the master branch form GitHub and build the project you see a message like:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Imixs Workflow
[INFO] Core API
[INFO] Engine
[INFO] Web Tools
[INFO] RESTful API
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Imixs Workflow 4.3.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------

If you build the project not form sources you can only use the latest released version 4.3.2.
Version 4.3.2 is perfectly fine. Please do not be confused because of the new item "$taskid". In some weeks version 4.3.3 will be released with the new field. You application will not be effected from this internal new fields. It will work with 4.3.2 and later with 4.3.3

@chrisw14
Copy link

Okay, but 4.3.3-SNAPSHOT wasn't found?
grafik

@rsoika
Copy link
Member Author

rsoika commented Jun 13, 2018

I have deployed the snapshot release
Please make sure that you have the following snapshot-repo defined in your project pom.xml or maven config:

	<repositories>
		<!-- Sonatype Snapshot repository -->
		<repository>
			<id>sonatype-snaptshots</id>
			<name>Sonatype Snapshot repository</name>
			<url>http://oss.sonatype.org/content/repositories/snapshots</url>
		</repository>
	</repositories>

@rsoika rsoika closed this as completed Jun 24, 2018
bvfalcon pushed a commit to bvfalcon/imixs-workflow that referenced this issue Jul 6, 2021
bvfalcon pushed a commit to bvfalcon/imixs-workflow that referenced this issue Jul 6, 2021
bvfalcon pushed a commit to bvfalcon/imixs-workflow that referenced this issue Jul 6, 2021
bvfalcon pushed a commit to bvfalcon/imixs-workflow that referenced this issue Jul 6, 2021
bvfalcon pushed a commit to bvfalcon/imixs-workflow that referenced this issue Jul 6, 2021
bvfalcon pushed a commit to bvfalcon/imixs-workflow that referenced this issue Jul 6, 2021
bvfalcon pushed a commit to bvfalcon/imixs-workflow that referenced this issue Jul 6, 2021
bvfalcon pushed a commit to bvfalcon/imixs-workflow that referenced this issue Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants